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

Rounding for converted shipping costs

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.

Is there a hook to perform rounding on converted shipping costs?

For currency I found these (shortened for clarity) and this makes sense to me and works well, but shipping still remains 'untidy'

add_filter('woocs_raw_woocommerce_price', function ($price) {
    return round($price * 2, 0) / 2;};
add_filter('woocs_woocommerce_variation_prices', function($price) {
    return round($price * 2, 0) / 2;};
[Note: I do have a purchase code but cant see where to add it :)]

Hello

Try  to add  this  in  functions.php

add_filter('woocommerce_package_rates', function($rates, $package) {
if(!class_exists('WOOCS')){
return $rates;
}
global $WOOCS;
if ($WOOCS->current_currency != $WOOCS->default_currency) {
foreach ($rates as $key=>$rate) {
$rates[$key]->cost = round($rate->cost * 2, 0) / 2;
}

}

return $rates;
}, 99999, 2);

 

But keep in mind that this rounding occurs before taxes are calculated.