Jump to content
Andrewg1639

Different currencies not working

Recommended Posts

I have setup multiple currency on our Cubecart 4 website.

We have AUD, USD, CAD, GBP etc.

The currencies work perfect and all products show up in the correct price when changing currency, however when you go to checkout, no matter which currency you are in, it will put the payment through as USD.

How can we fix this? Can anyone please help?

Share this post


Link to post
Share on other sites

"It will put the payment through..."

Are you saying that during the steps of going through checkout, the prices are still being displayed in the currency the customer chose? That is, the customer is not aware of the actual currency (and actual amount in that currency) with which to have the transaction conducted until they enter their credit card number?

Or are you saying that the checkout screens - from the first - switch back to showing the store's actual working currency?

There would need to be a determination what currency(s) your payment processor accepts. If several currencies, the module would need to be coded to send the desired currency and correct converted amount. Then someone would need to be informed who pays for the international exchange fee.

Share this post


Link to post
Share on other sites
5 hours ago, bsmither said:

"It will put the payment through..."

Are you saying that during the steps of going through checkout, the prices are still being displayed in the currency the customer chose? That is, the customer is not aware of the actual currency (and actual amount in that currency) with which to have the transaction conducted until they enter their credit card number?

Or are you saying that the checkout screens - from the first - switch back to showing the store's actual working currency?

There would need to be a determination what currency(s) your payment processor accepts. If several currencies, the module would need to be coded to send the desired currency and correct converted amount. Then someone would need to be informed who pays for the international exchange fee.

Thanks for your reply.

Yes throughout checkout it will show the currency the customer chose, however as soon as it loads to the PayPal screen and they login it converts back to USD.

Our Paypal accepts multiple currencies as we use the same PayPal account on other websites and payments come through in multiple currencies.

Currently we only have Paypal setup as a payment processor.

 

"If several currencies, the module would need to be coded to send the desired currency and correct converted amount. Then someone would need to be informed who pays for the international exchange fee."

Would we need to get some custom work done to re code Cube Cart to send the desired currency and converted amount?

As paypal stores the currency in the currency that was paid there should not be any exchange fees, (Unless we later change that currency back to USD)

Share this post


Link to post
Share on other sites

Ok, so what you are using is the PayPal standard gateway (as opposed to the PayPal Pro gateway)?

If so, maybe making small but key edits to the gateway code would suffice.

We also need to keep in mind CubeCart handles all pricings internally in its default currency. We can make changes to the gateway code to send off the "exchange-rate" value and the currency for it, but when CubeCart sends out emails and when the admin views the order summary, all prices will be in the default currency. I am certain that when the customer logs back in to review past orders, the prices will be in the store's default currency (until the customer re-selects the desired currency).

I will need to make some experiments.

Share this post


Link to post
Share on other sites

Also just adding to what you said, I have changed the default currency to Euro for testing and it is as you say, the payments on checkout are now only going to Euro as soon as it goes to Paypal.

Share this post


Link to post
Share on other sites

And as I said, you may also find the emails sent to the customer is expressed in Euros, even if the customer was viewing the store prices in Australian Dollars.

Share this post


Link to post
Share on other sites

Assuming you have the ability to make test payments with your PayPal account in a "sandbox" mode, let's try a few things.

In the PayPal (standard) module folder, the file gateway.class.php:

Near line 71, find:

'amount' => $this->_basket['total'],

We need to exchange CubeCart's internally managed prices at the default currency
rate with the customer's chosen currency rate. To do this, change the line to:

'amount' => $GLOBALS['tax']->priceConvertFX($this->_basket['total']),

We also need to send the currency code that corresponds to the exchanged rate. In the same file:

Near line 77, find:

'currency_code' => $default_currency,

Change to:

'currency_code' => $current_currency_code,

There isn't a function in the Tax class to get the currently used currency code.
But if a customer changes the displayed currency, that currency code is stored in
"Session" so that it will be used from page to page.

Near line 66, find:

$default_currency = $GLOBALS['config']->get('config', 'default_currency');

But what if the customer has NOT chosen a different currency. The currency code
is not in "Session" as there is no need to remember the default currency. We
need to make sure if we have the one, then use it, or use the other.

On a blank line just after the above statement, add:

$current_currency_code = ($GLOBALS['session']->has('currency', 'client')) ? $GLOBALS['session']->get('currency', 'client') : $GLOBALS['config']->get('config', 'default_currency');

Finally, for the currency that was used, we need to implement a way to log that in the transaction log. (Solution later.)

As well as getting the exchanged currency in emails sent to the customer (and optionally admin emails).

Keep in mind that reconciling external reports that show actual currencies transacted will not match what CubeCart reports, as the true prices, taxes, shipping charges, etc are always databased in CubeCart's default currency rate.

Make copious experiments.

 

Edited by bsmither

Share this post


Link to post
Share on other sites

I think using $GLOBALS['tax']->priceConvertFX() isn't going to work, because at some point in the checkout process, the Tax class gets reloaded with the default currency, and has no provision for re-re-loading with the customer's currency after that.

Share this post


Link to post
Share on other sites
18 hours ago, bsmither said:

I think using $GLOBALS['tax']->priceConvertFX() isn't going to work, because at some point in the checkout process, the Tax class gets reloaded with the default currency, and has no provision for re-re-loading with the customer's currency after that.

Thanks, thats a pity though, do you think we may be out of options for this in that case?

Share this post


Link to post
Share on other sites

Hi bsmither

would this issue with the currencies be resolved if we were to upgrade to CubeCart 6?

eg would we be able to have multi currencies and have the customer be able to choose which currency they prefer and therefore always have payments, credits, emails etc reflected in that chosen currency?

 

or would it still use the default currency ?

Share this post


Link to post
Share on other sites

For now, I will say no, what you want to show is still not available with CC6114.

Additionally to the above, part of this is because the currency that being shown during checkout is not databased as part of the Order Summary.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...