PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Incorrect currencies/ prices showing on overview and detail pages when cache is enabled (W3TotalCache - Redis)

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
12

Hi,

We are experiencing problems with your plugin, where currencies/ prices are sometimes showing incorrectly based on the country IP. This happens sporadically on the overview and detail pages (example overview page: https://gofluo.com/product-category/new-arrivals/), so we think this is caused by page caching. We are using Redis cache setup with the W3TotalCache plugin, if we disable caching the problems seem to disappear. We played around with the currency plugin settings, but nothing seems to fix the issue (attached you will find a screenshot of the settings active at the moment).

Some weeks ago we already looked into this, but saw that the prices are retrieved with an Ajax call that is not cached so it doesn't feel logic to us.

Can you please help us fix this problem, while our client is getting a lot of daily messages about this bug.

Kind regards,

Tom

 

 

 

 

Hello

Please paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png

read  this  - https://currency-switcher.com/using-geolocation-causes-problems-doesnt-seem-to-work-for-me

Try  in  file -  wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php - add  code - https://share.pluginus.net/image/i20230118103229.png

$products_currency = array();

Hi Pablo,

Will ask my client for the license key, while they did not share their CodeCanyon account.

We already read the post about GEO.

We currently where forces to enable another caching plugin, so can't test if the code you propose solves our issues. To my understanding, is this a piece of code that will be in a new version of the plugin?

Hello

Ok!  We are waiting for the license code

Hi Pablo,

Our client did not find a license code, but the purchase code is the same I reckon?

But like many others on this form, I can't find where to submit the code, can you give me more clear instructions?

 

 

Hello

To get  license  key - https://codecanyon.net/downloads -> https://c2n.me/49ZXJv0.png

Please paste the license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png

Thanks Pablo, license key is added.

We tested the edit you proposed for woocs.php on line 4343 and this seems to help. Is there a plugin update scheduled to add this code for all users, or a setting where specific users can enable this new feature? Obviously when we process this edit, this will be overwritten when we update the plugin.

Ps: on our overview pages, the default currency is shown by default and overwritten on Ajax request. We have to hide the price for a few seconds to prevent users from seeing a wrong currency, is there any way we can fix that?

Example overview page: https://owow.dev/gofluo/product-category/women/clothing-women/bodyglowers-women/

The price changes after a 2 - 3 seconds, because the ajax action"woocs_get_products_price_html" changes the price that is in cache.

Hello

Of course this will be included in the new version

We have to hide the price for a few seconds to prevent users from seeing a wrong currency, is there any way we can fix that? - Please  check  this  option  - https://share.pluginus.net/image/i20230120112450.png

Hi Pablo, thank you!

We already had the price preloader enabled, so that does not solve it for us. Does it speed it up slightly or what does it do exactly?

Hello

This should hide prices before they are redrawn.

 Does it speed it up slightly - the speed depends only on your site because the prices are redrawn after the page is fully loaded

Okay, on the detail page this Ajax redraw is working. But when a user selects another variation, the loader keeps spinning. Can you help us out there?

We disabled the function on live, you can see it go wrong on our staging site: https://owow.dev/gofluo/product/reversible-bodywarmer-with-reflective-neon-red-side-nightglow/?attribute_pa_color=red

Hello

https://c2n.me/4hEHyHX.png - This is a third party functionality.

You need to create a function for the variant switch events:

jQuery('.woocs_price_code').removeClass('woocs_preloader_ajax');

 

We now disabled the Ajax redraw function and made a custom function, where the prices are shown after all Ajax requests are completed (Ajax.stop). This seems to work good, is there a reason you implement this different (while your implementation has issues with other plugins)?

Hello

Great! I do not know how you implemented it, but there is probably a reason why the developers did it this way

Hi Pablo, our custom script which hides the prices is working nicely. We have been testing a bit more and what we notice is that when we switch countries with VPN, the prices on the detail page are always showing correct with the first load but the overview page is taking a bit longer. At the start we thought, it's just taking some time until the new IP is set, but now we discovered that the prices on the overview page are only showing correct after we opened a detail page first. Now our question is, is this only happening when a user switches countries or can this also happen for normal users that don't switch IP's?

The prices on the detail page are retrieved differently from the overview page, for example if we enable the Ajax redraw function this only has an effect on the detail pages. So maybe the request on the detail page is triggering a currency switch in your plugin, and the request on the overview page is not? Can you explain a bit more how this works?

Hello

Sorry, I didn't understand your question.

Plugin works the same on any page.

After the page is fully loaded, the JS script checks all prices and makes an Ajax request. And if the current currency does not match the currency of the page, the JS script redraws the prices

Hi, when the problem occurs the Ajax request is present but the response s empty. So this means the site thinks the currency is already correct? We tested this problem one hour later and now it doesn't happen anymore. We experienced this problem also one week ago, so it's a recurring problem. Could it be related to the cache being purged, while it does seem to happen especially when the cache just has been purged?

Ps: could you also let us know why the Ajax redraw (when enabled) is only working on our detail pages, does this has something to do with the way prices are retrieved?

Hello

. So this means the site thinks the currency is already correct?  - Yes!

Ajax redraw does not happen if there is a GET['currency']

is only working on our detail pages  - This should work with all prices displayed by standard woocommerce functions. These prices should have this template - https://c2n.me/4hInrZ3.png

 

12