First off, thanks for this module! I love it, it does exactly what my client wants!

But also, my clients wants to have pricing shown in multiple currencies. This is accomplished with the commerce_multicurrency module.

That module and this do not play very well together. I hope to fix this and supply patches in both places to make each play nicer with the other.

Specifically, Commerce Multicurrency offers two approaches:

  1. Convert currency on the fly to the user's currency: This works awesome with Commerce Price Table, except for one small problem (below).
  2. Have multiple currency price points defined for a product: This doesn't work in at all, the product edit page shows the currency prices above, then the pricing table below (but it only knows about the main currency). I don't see this working easily, so recommend we leave that as unsupported for the time being.

The problem with #1 is that when the user chooses a new currency with the commerce_multicurrency "Currency Chooser" block, this new currency is printed on the price table (even though the prices on the price table are actually in the original product currency). (see attachment table1.jpg). All that's wrong is it's printing CAD in the price table, when those are actually GBP prices. That currency there should come not from the user's currently selected currency via the chooser, but from the currency that goes with the product price!

You can see the shopping cart calculation is correct though... I ordered 20 items and it's showing the correct CAD price, not 20 * the GBP price... Then if I enter a quantity and move on to the view cart screen, it works perfectly from then on (see table2). I can update the quantity and price_table gets the correct price, and then multi-currency converts this price to CAD correctly for me. Perfect!

So.. what Im going to try and do is figure out how to make the proper currency code show up on the price table on the product reference node. Everything else is working for me as far as I can tell! I'll submit a patch here when I have it going. Meanwhile, any tips, warnings etc. would be appreciated! Thanks again for this great module.

CommentFileSizeAuthor
table2.jpg40.08 KBdamien_vancouver
table1.jpg66.14 KBdamien_vancouver
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mihai7221’s picture

Hi,
Any luck in finding a solution to this problem ?

damien_vancouver’s picture

Ah no, I ended up working around it by only using one of the modules instead. Hopefully the above gives you a starting point though!

mihai7221’s picture

I need to use both for discounts based on quantity

mihai7221’s picture

Issue summary: View changes

fix typos

guruslot’s picture

Any news on Commerce Multicurrency?

I'd like the module use the currency of original price to replace only a value according the quantity but not the currency code.
After that I'm looking a way to convert the price into site default currency. I see that this Action could be added thru 'Convert the unit price to a different currency'.

Please advice on how to prevent the module to replace the currency code.

say.hello’s picture

Category: Feature request » Bug report

I change the category from Feature request to Bug report because this are no new features to be added but the module is not working correctly. Actually, as long as this bug is not fixed this module cannot really be used in a multi-currency environment so it's quite a serious bug.

say.hello’s picture

I found out that it is possible to make Method 1 work:

Commerce Multicurrency offers two methods of handling prices in different currencies.
Method 1: Convert currency on the fly to the user's currency using an exchange rate.
Method 2: Have multiple currency price fields defined for a product.

Commerce Price Table only supports Method 1. In order to make Method 1 work the following product pricing rules must be enabled in the shown order:

(1) Override price with price table
(2) Convert the unit price to a different currency (this rule implements Method 1)

Anonymous’s picture

None of the quantity cases in 'commerce_price_table_get_amount_qty' actually take the product's currency into account and just returns the first price it finds that matches the indicated quantity.

  // Sort the items by quantity and return the matching one.
  uasort($items, 'commerce_price_table_sort_by_qty');
  foreach ($items as $item) {
    if ($quantity <= $item['max_qty'] && $quantity >= $item['min_qty']) {
      return $item;
    }
  }

  // Handle the unlimited qty.
  foreach ($items as $item) {
    if ($item['max_qty'] == -1) {
      return $item;
    }
  }

  // We fallback to the higher one if no match was found.
  return end($items);

I've patched things up for a specific use case of mine but I'll see if I can come up with something a little more general.