3

Folks:

I'm setting up a multi-currency site (CAD, USD, EUR). I'd like the user to be able to select their currency before they actually put anything in the cart. And once selected, prices throughout the site display prices in that currency AND the cart carries that currency to the end of the transaction.

From the docs (https://craftcommerce.com/docs/payment-currencies), I have tried option 2 but it does not appear to work. I can only speculate that because there is nothing in the cart, the currency can't be updated.

Is the only option to use option 1 and set up multiple locales to set the PHP constant to the appropriate currency? Multiple locales seems to be overkill for just a currency conversion but if that's what's needed then I'll do that.

EDIT

Here's the form I'm using to attempt to change the currency after there's something in the cart. But it doesn't change the currency for some reason:

<form method="POST">
  <input type="hidden" name="paymentCurrency" value="USD">
  <input type="hidden" name="action" value="commerce/cart/updateCart">
  <input type="hidden" name="redirect" value="commerce/cart">
  <input type="submit" value="Convert to USD" />
</form>

Anyone have any idea what I'm missing here? This is following option #2 I believe.

UPDATE

This turned out to be an issue with my version of PHP (5.5.38) and CraftCommerce. It should not be a problem for others (hopefully).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.