Hi! You’ll need a small code snippet to accomplish this. I don’t know your particular settings (otherwise I could simplify this), but this should cover all scenarios:
add_filter( 'woocommerce_cart_contents_total', 'woocommerce_cart_contents_total_no_decimals', 10, 1 );
function woocommerce_cart_contents_total_no_decimals( $total ) {
$settings = get_option('wpmenucart');
if (isset($settings['total_price_type']) && $settings['total_price_type'] == 'subtotal') {
if ( WC()->cart->display_prices_including_tax() ) {
$amount = WC()->cart->get_subtotal() + WC()->cart->get_subtotal_tax();
} else {
$amount = WC()->cart->get_subtotal();
}
} else {
if ( WC()->cart->display_prices_including_tax() ) {
$amount = WC()->cart->get_cart_contents_total() + WC()->cart->get_fee_tax() + WC()->cart->get_cart_contents_tax();
} else {
$amount = WC()->cart->get_cart_contents_total();
}
}
return wc_price( $amount, array( 'decimals' => 0 ) );
}
If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters