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

Fox Currency + Litespeed Cache issue

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.

Hello,
I have a problem on my website while using both Fox Currency and LiteSpeed Cache. When visiting my website, the default currency is EUR. But when you go through the page (click on Shop, go to a Product page, then change currency by changing the language and go back to the home page the price will be in EUR instead of the selected currency). Is there any way to add an exception to LiteSpeed that will make sure the correct currency is displayed? Or is there a way to make sure the currency is not cached at all?

Just to clarify, I am using the"I am using cache plugin on my site" setting in FOX Currency settings. And I also turned on the"Is Multiple allowed?" so the customer can check out in selected currency.

Any idea on how to tackle this issue?

The website url is https://tropicalcupclub.com

Hello

I  did  a test. Everything seems to be working correctly

Please  drop  me  screenshots of  the  plugin  settings

I've added the screenshots of my plugin settings, but I tried to replicate the issue more consistently and I found out that if you just go to the home page, change currency a couple of times (I mean like 3-4) you'll notice the language will keep changing, but the currency will not. If necessary I can try and record it.

Hello

Ok!  But changing the currency depending on the language is a third-party functionality.

Please  remove  your  custom  code  and  try  to  do a  test  with  native  switcher

Settings are ok

Hi there,
The third-party functionality was taken from your website and it is precisely the code that FOX Currency switcher published (I assume it is correct, because it is posted on your website). So I assume it should work correctly?

This is the code I saw on your website for combining TranslatePress and FOX Currency switcher. And the only thing I have changed is the currency values to correspond to EUR and PLN.
As for the desting with native switcher it works as intended.


add_filter('wp_head', function() { 
$lang = get_locale(); 
global $WOOCS; 
switch ($lang) 
{ 
case 'bg_BG': 
$WOOCS->set_currency('BGN'); 
break; 
case 'en_GB': 
$WOOCS->set_currency('EUR'); 
break; 
default: 
$WOOCS->set_currency('USD'); 
break; 
} 
});

Hello

This code is not included in the plugin and is an example for users who have experience in programming. We are not responsible for this code

OK! And so we can conclude that the problem is in the code.

Perhaps this function is cached which causes incorrect currency switching:

$lang = get_locale();

You can try to  do a  test. Paste  this  code here - https://share.pluginus.net/image/i20230818112257.png

var_dump($lang );

so you can check if the language code always changes

 

I've added the code you said and I can see the language keeps changing everytime as it should, but the currency doesn't.

Ok! Try  this  code:

add_filter('wp_head', function() { 
$lang = get_locale(); 
global $WOOCS; 
switch ($lang) 
{ 
case 'bg_BG': 
$WOOCS->set_currency('BGN'); 
$_GET['currency']='BGN';
break; 
case 'en_GB': 
$WOOCS->set_currency('EUR'); 
$_GET['currency']='EUR';
break; 
default: 
$WOOCS->set_currency('USD'); 
$_GET['currency']='USD';
break; 
} 
});

Perfect! That seems to solve the caching issue. As for the custom mini cart currency, I guess I will have to tackle that issue with the plugin developer for any support in regards to that matter.
Thanks for helping out with this issue.

Hello

Great!  Welcome;)