Jump to content

Missing Currency and Amount in Basket


Recommended Posts


I am testing a payment gateway which I just developped, and for some reason, very recently I have been getting the error that the currency and the amount are empty in the form. When I checked my soft I couldn't identify any obvious root cause. However when checking the logs which are at the bottom of the page, I indeed do not see any currency nor amount filled in (logs are attached). However, if I change the currency to GBP, I can see it in the logs, as below. If I change it back to EUR, I also can see it, so it isn't a problem of how the currency is set.

'__client' =>

'ip_address' =>
'useragent' => Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
'session_start' => 1623257111
'session_last' => 1623257114
'language' => fr-FR
'user_language' => fr-FR
'currency' => GBP
I had based my code on the parameter 'currency' always being present. Is that assumption wrong?
Also, for a reason which I ignore, although I still cannot see the amount in the logs after changing the currency back and forth, it is sent to the payment provider correctly. So I am assuming that Cubecart has it although I cannot see it.
Appreciate any helps anyone has here. Cheers,

missing currency logs.txt

Link to comment
Share on other sites

Inside the gateway class, $this->_basket['total'] should be available, as that is what is generally sent to the payment processor. You might want to send the basket total through (if this works the way I think it does):

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

as CubeCart will only work with prices in the store owner's default currency.

You might also see if this has a value:

$customer_currency_code = $GLOBALS['tax']->_currency_vars['code'];

The SESSION array will not have a client's currency if the customer has not changed from the store's default currency.

Link to comment
Share on other sites

Thanks! I got really confused that I was doing all my tests with the same user, user whom had changed the currency at some point, and hence I got always see the currency in the session parameters. But as soon as I got someone else to test my module everything failed. Sorted now, thanks!

Link to comment
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.

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...