I’m using this code to modify my total on the checkout page
However when I place the order, my order confirmation page and the order itself, emails etc reflect the unmodified checkout total
Can someone help with what step I am missing please?
add_action( 'woocommerce_review_order_before_order_total', 'mod_cart_total' );
function mod_cart_total() {
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
WC()->cart->total = 123.45; //modified checkout total which works on the checkout page but not anywhere else
}
I assumed setting the modified total would be reflected when the order is placed/saved