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

Mini cart currency issue and currency by language

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 Pablo,

Can you please, help to fix a couple moments on https://www.shop.handmadehome.me/

  1. A small issue with mini cart currency.  When cart is empty  main currency permanently displayed:

 

 

If I add a product to the cart, the currency will be changed and  displayed correctly. So the issue only appears when cart is empty:

 

 

 

2. The second issue with currency by WPML language. I want to set RUB for Russian language.

I added your code from https://currency-switcher.com/switch-currency-with-language-change, but it doesn't work.

add_filter('wp_head', function() {
$lang = ICL_LANGUAGE_CODE;
global $WOOCS;
switch ($lang)
{
case 'ru':
$WOOCS->set_currency('RUB');
break;
default:
$WOOCS->set_currency('USD');
break;
}
});

Just in case you're wondering why it worked for the first case, I also have GeoIp rules:

So if I use non-russian ip and switch to Russian language I see USD instead RUB

(Language switcher at very bottom of website)

Thank you!

 

 

Hello

  1. Yes, when there are no products in the cart to save resources, the cart is not redrawn
  2. I  did  a  test. I switch the language, the currency switches too.

Oops truly works:) I'm sorry, that should be a cache plugin.

Can I ask which rule dominates: currency by language or currency by GeoIp?

For example, if I set USD for US in GeoIp and RUB for Russian language. If visitor from US switch into Russian language what currency  would be displayed?

And is this a good idea to create such rules?

Thank you!

The thing that I also have GeoIp rule Russia=RUB. But looks like currency only depends on language, GeoIp rule doesn't count..? I expected that visitors from Russia  see RUB in any case (GeoIP) and other visitors  see currency depending on language.(Russian=RUB, English=USD)

your custom code is what switches the currency. Other rules with this code do not work

Thank you so much!

Welcome;)