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

Price Rounding depending on the active currency

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 tried this hook.

global $WOOCS;
$current_currency = $WOOCS->current_currency;
if($current_currency =="COP") {
add_filter('woocs_raw_woocommerce_price', function($price) {
$n = $price;
$x = 5000;
$new_price = (round($n)%$x === 0) ? round($n) : round(($n+$x/2)/$x)*$x;
// $price = ceil($price / 1000) * 1000;
return $new_price;
});
}

But the price actually rounds only if ?currency=COP is added at the end of the url. If I remove it i will not round.

Please Help

Hello

Please  disable  all  cache  and  do a  test

 

Hello I have disabled all cache and still not working without this ?currency=COP

I attached the screenshots for you to see.

thanks you in advance for your help!

Cache Settings

WITHOUT URL OPTIONS, NOT WORKING

 

WITH URL OPTIONS, ITS WORKING

Hello

Please  clear  transient - https://c2n.me/4bFCM4a.png

Drop  me  exact  link to the  issue

Hello

I just cleared all WooCommerce and Expired Transients, and i noticed that the price first show correctly rounded and in seconds it changes back to the original without rounding.

All Cache disabled. Here is a video of what i'm saying.
https://www.dropbox.com/s/t87excut58v3i9p/Multi%20Currency.mp4?dl=0

I just realized that i had the option of I am using cache plugin on my site enabled, so i disabled it.

i checked again and its working.  but now... can i enable the cache and this option?

As soon i activate this option I am using cache plugin on my site the prices are displayed without rounding.

Hello

Where did you insert your custom code?

I use this plugin https://wordpress.org/plugins/code-snippets/

Hello

Please  read  this - https://currency-switcher.com/hook/woocs_woocommerce_variation_prices/

And  add  this  code  to  functions.php