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

WPRocket working and Currency changed in functions for custom user groups

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.

Hi!

First of all thanks to all creators of FOX.

I'm using this plugin to change our fixed product prices over 3 currencies. Have B2C and a B2B setup.
Hope that this post helps another user to achieve their goals. (This post was closed so need to start a new one: https://pluginus.net/support/topic/fox-doesn-t-work-while-wp-rocket-is-active/)
On B2B I have this special code that hides"currency switch" at login and manually overrides currency for that group of users. ($ for usa_retailers, € for europe_retailers, £ for uk_retailers)

[code]

function change_currency_on_login() {
    global $WOOCS;
if (is_guest()) {
echo '<style >.menu-woocs { display: block; }</style>';
}
else if (is_costumer()) {
echo '<style >.menu-woocs { display: block; }</style>';
}
else if (is_retailer_northamerica()) {
$WOOCS->set_currency('USD');
echo '<style >.menu-woocs { display: none; }</style>';
}
else if (is_retailer_australia()) {
$WOOCS->set_currency('EUR');
echo '<style >.menu-woocs { display: none; }</style>';
}
else if (is_retailer_europe()) {
$WOOCS->set_currency('EUR');
echo '<style >.menu-woocs { display: none; }</style>';
}
else if (is_retailer_uk()) {
$WOOCS->set_currency('GBP');
echo '<style >.menu-woocs { display: none; }</style>';
}
else {
echo '<style >.menu-woocs { display: block; }</style>';
}
}
add_action('template_redirect', 'change_currency_on_login');
[/code]

 

On my options I have:
PHPSESSID in WpRocket never cache cookies.
"WelcomeCurrency" set to EUR
"Currency Storage" set to FOXSESSION
No GET data in link" ENABLED
"I am using cache plugin on my site" DISABLED
"Checkout by GeoIP rules" DISABLED

And this is all working. Dunno why"I am using cache plugin on my site" needs to be DISABLED because is kind of controversial... but well. Things happen!

Hello

Unfortunately I'm not sure if this is a good solution.

PHPSESSID in WpRocket never cache cookies. - In fact, with these settings you disable caching .  And when caching does not work, of course you can disable this setting -  "I am using cache plugin on my site" DISABLED