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

Hide cents from cart total

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 tried do round off for cart total (hide cents from cart total) I used the following code

add_filter( 'woocommerce_calculated_total', 'custom_calculated_total' );
function custom_calculated_total( $total ) {
$total = round($total / 10) * 10;
return ($total);
}

but it's not work so could you please help me to fix it ?

Best regards
Rawaf

Hello Rawaf

Please  try  to use  this code:

add_filter( 'woocommerce_calculated_total', 'custom_calculated_total',9999 );

function custom_calculated_total( $total ) {

$total = round($total / 10) * 10;

return ($total);

}

I did a test - https://share.pluginus.net/image/i20230113085013.png

thank you for your response

I tried it but it's not working any other suggest please ?

example: https://ibb.co/FXk8cvk

Hello

perhaps you have a third-party plugin that changes prices