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

WOOCS Round currency raw price last full digit to zero doesn't work after updating to v.2.3.3

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,

 

The following code for rounding currency raw price last full digit to zero doesn't work after updating to v.2.3.3:

 

___________________________________________________________

global $WOOCS;

if($WOOCS->current_currency=="MKD") {

add_filter('woocs_raw_woocommerce_price', function($price) {

if (($price <= 10))

{

$price = round($price / 10, 0) * 10;

return $price;

} else

{

$price = ceil($price/10) * 10;

return $price;

}

});}

___________________________________________________________

 

Can you check what is the problem?

 

Marko

Hello Marko

Give me a screenshot of all the code

While I see that the code is better to change - https://c2n.me/49CshsH.png

and  drop  me  exact  link to  the  issue

Please  renew  your  support

 

 

 

Hello,

That is the whole code, it's a snippet in the functions.php file and it rounds the last digit of the price to zero. It works with v.2.3.2

<?php

global $WOOCS;
if($WOOCS->current_currency=="MKD") {
add_filter('woocs_raw_woocommerce_price', function($price) {
if (($price <= 10))
{
$price = round($price / 10, 0) * 10;
return $price;
} else
{
$price = ceil($price/10) * 10;
return $price;
}
});}

 

also for variable products goes like this:

global $WOOCS;
if($WOOCS->current_currency=="MKD") {
add_filter('woocs_woocommerce_variation_prices', function($price) {
if (($price <= 10))
{
$price = round($price / 10, 0) * 10;
return $price;
} else
{
$price = ceil($price/10) * 10;
return $price;
}
});}

I guess it's something with this new hook introduced in v.2.3.3:

https://currency-switcher.com/hook/woocs_price_shortcode/

If this is complete code then this shouldn't work at all

Please drop  me exact  link to  the  issue  and  FTP+wp-admin access  - https://c2n.me/43SC6rb.png ->https://c2n.me/42BAoj4.png