Rounding prices doesn't work properly
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 pleaseIf 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.
Quote from leandroprz on December 10, 2020, 20:39I'm trying to round down prices to convert for example 695,18 ARS to 599 ARS. I mean, rounding down two digits minus 1 to make the price more attractive.
To do that I'm using this code:
add_filter('woocs_raw_woocommerce_price', function($price) { global $WOOCS; if ($WOOCS->current_currency == 'ARS' ) { return floor($price / 100) * 100 - 1; } else { return $price; } }); add_filter('woocs_woocommerce_variation_prices', function($price) { global $WOOCS; if ($WOOCS->current_currency == 'ARS') { return floor($price / 100) * 100 - 1; } else { return $price; } });I'm using this snippet and this other one as reference.
The issue is that sometimes the prices are rounding down as expected (599 ARS), but other times I can see the converted price with no rounding (695,18 ARS).
You can test this issue on any of these categories:
https://leandroperez.art/tienda/categoria/talleres/
https://leandroperez.art/tienda/categoria/cursos/
I'm trying to round down prices to convert for example 695,18 ARS to 599 ARS. I mean, rounding down two digits minus 1 to make the price more attractive.
To do that I'm using this code:
add_filter('woocs_raw_woocommerce_price', function($price) {
global $WOOCS;
if ($WOOCS->current_currency == 'ARS' ) {
return floor($price / 100) * 100 - 1;
} else {
return $price;
}
});
add_filter('woocs_woocommerce_variation_prices', function($price) {
global $WOOCS;
if ($WOOCS->current_currency == 'ARS') {
return floor($price / 100) * 100 - 1;
} else {
return $price;
}
});I'm using this snippet and this other one as reference.
The issue is that sometimes the prices are rounding down as expected (599 ARS), but other times I can see the converted price with no rounding (695,18 ARS).
You can test this issue on any of these categories:
Quote from Pablo Borysenco on December 11, 2020, 12:00Hello
I did a test - https://c2n.me/4abvYBG - everything seems to be working correctly
Hello
I did a test - https://c2n.me/4abvYBG - everything seems to be working correctly
Quote from leandroprz on December 11, 2020, 13:23Please check the individual products, that's where the issue can be seen properly.
Please check the individual products, that's where the issue can be seen properly.
Quote from Pablo Borysenco on December 14, 2020, 12:42Hello
Ok! Drop me exact link to the product with the issue
My test - https://c2n.me/4adsdwd
Hello
Ok! Drop me exact link to the product with the issue
My test - https://c2n.me/4adsdwd
Quote from leandroprz on December 14, 2020, 14:42This one should show AR$599 but when quickly changing from one "clase" to another you'll some something like AR$695,18
https://leandroperez.art/tienda/cursos/curso-de-captura-y-edicion-de-timelapse-de-dia-a-noche/
This other one should show AR$1.699 for the cheapest variation but when selecting the dropdown option you'll see AR$1.599 (plus sometimes the font looks bigger, I'm not sure why).
https://leandroperez.art/tienda/talleres/fotografia-nocturna-de-paisaje/
This one should show AR$599 but when quickly changing from one"clase" to another you'll some something like AR$695,18
https://leandroperez.art/tienda/cursos/curso-de-captura-y-edicion-de-timelapse-de-dia-a-noche/
This other one should show AR$1.699 for the cheapest variation but when selecting the dropdown option you'll see AR$1.599 (plus sometimes the font looks bigger, I'm not sure why).
https://leandroperez.art/tienda/talleres/fotografia-nocturna-de-paisaje/
Quote from Pablo Borysenco on December 15, 2020, 12:55Hello
Where you add this code?
Try to do a test with - https://c2n.me/4aeub8f.png
Hello
Where you add this code?
Try to do a test with - https://c2n.me/4aeub8f.png
Quote from leandroprz on December 15, 2020, 18:53I'm using the code on a custom plugin called funciones.php, line 711.
I have that cache option enabled as well since the day I installed Currency Switcher.
I'm using the code on a custom plugin called funciones.php, line 711.
I have that cache option enabled as well since the day I installed Currency Switcher.
Quote from Pablo Borysenco on December 16, 2020, 12:30Hello
Add to functions.php of the current theme and do a test
Hello
Add to functions.php of the current theme and do a test
Quote from leandroprz on December 16, 2020, 15:24I moved the code but unfortunately the issue is still there.
I moved the code but unfortunately the issue is still there.
Quote from Pablo Borysenco on December 17, 2020, 11:48Hello
For some reason, this custom code does not work in ajax mode( https://c2n.me/4agjSsT.png ).
OR third-party code changes prices in ajax mode. For example, plugins for discounts, extra cost, taxes
Hello
For some reason, this custom code does not work in ajax mode( https://c2n.me/4agjSsT.png ).
OR third-party code changes prices in ajax mode. For example, plugins for discounts, extra cost, taxes
Quote from leandroprz on December 17, 2020, 23:43Oh, that's too bad. Hope you can fix it in future updates of the plugin.
Oh, that's too bad. Hope you can fix it in future updates of the plugin.
Quote from Pablo Borysenco on December 18, 2020, 12:07Hello
Hope you can fix it in future - ??? - the problem is not related to our plugin. Most likely there is a problem with your website.
Hello
Hope you can fix it in future - ??? - the problem is not related to our plugin. Most likely there is a problem with your website.
Quote from leandroprz on December 28, 2020, 05:11Oh, I misunderstood.
Since you said the custom code doesn't work with AJAX I thought maybe it was something related to the Currency Switcher plugin.
Oh, I misunderstood.
Since you said the custom code doesn't work with AJAX I thought maybe it was something related to the Currency Switcher plugin.
Quote from Pablo Borysenco on December 28, 2020, 11:17Hello
the custom code doesn't work with AJAX - Yes, but only on your website
Hello
the custom code doesn't work with AJAX - Yes, but only on your website