Strange behaviour Currency Selector

  • Posts: 26
  • Thank you received: 3
  • Hikashop Business
1 year 1 month ago #356471

-- url of the page with the problem -- : www.collectcamera.eu/j4/en-us/
-- HikaShop version -- : 5.0.0
-- Joomla version -- : 4.4.0
-- PHP version -- : 8.2.12
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : no errors

Hi Guys,
I'm experiencing some behaviour in the currency selector that I cannot explain and hope you can.
We're in the process of upgrading a webshop from J3 to J4 and taking the opportunity to bring it up to date.
The original site is still live running on older versions of PHP and Hikashop (Business).
We created a copy on J3 and brought it up to date as to PHP, Hikashop and all other extensions.
We've also set up a trial site to explore different options as to the look and feel on J4.
The 2 trial sites both on Hikashop 5.0.0 show the same behaviour in the currency switcher.

Recreate as follows:
Open site " www.collectcamera.eu/j4/en-us/ " and click on: Leica equipment.
There is as of now just 1 product, it shows a price underneath the image in euro.
In the banner area the currency switcher is visible, select a different currency (US$) and the currency of the product price will change as expected, but the selector still shows euro.
Now try to select the original euro currency and you'll find that it does not respond. Actually the currency selector will allow changing to any currency except the one it shows.
Now select the Rollei Equipment product category and you'll see the currency selector showing the proper currency (US$), but when you go back to the Leica Equipment it reverts back to euro.

We investigated already some ideas - it's not a caching induced problem, there is also no override for the currency switch. I feel I must be overlooking some setting or something.
Any help is appreciated.

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13399
  • MODERATOR
1 year 1 month ago #356476

Hi,

Caching would also be the first I'm thinking about.
The currency change is properly taken into account by HikaShop, so it seems strange that the module doesn't see it.
That's because if you look at the code of the file modules/mod_hikashop_currency/tmpl/default.php, it uses the function hikashop_getCurrency to get the current currency.
That's the same function used everywhere in HikaShop to get the current currency. So if the module sees the old currency with this function call, I don't see why it would be different for the rest of HikaShop. And thus the only reason would be some kind of caching system which would actually display the HTML of the module from a previously generated cache, instead of the current state.

In that file, add this code at the top:

<?php echo date('m/d/Y h:i:s a', time()); ?>
It will display the current time at the top of the currency switcher module.
That way, you can see if the time changes or not each time the switcher module is displayed.
If it's not a new time after you change the currency, but the same old time as before you change it, it means there is some caching going on.

Please Log in or Create an account to join the conversation.

  • Posts: 26
  • Thank you received: 3
  • Hikashop Business
1 year 1 month ago #356519

Thanks for the explanation and tip.
It proved that it was indeed a server side caching thing after all.
All caching is now switched off on all levels and it seems to work again the way it should.
Thanks again for your quick support.
André

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum