How to apply discount on woocommerce subtotal and total on checkout?

We are trying this type of code it changes subtotal but we want to change total according to subtotal without adding any discount field in order table.

// define the woocommerce_cart_subtotal callback 
function filter_woocommerce_cart_subtotal( $array, $int, $int ) { 
// make filter magic happen here... 
};       
// add the filter 
add_filter( 'woocommerce_cart_subtotal', 'filter_woocommerce_cart_subtotal', 10, 3 );

Read more here: How to apply discount on woocommerce subtotal and total on checkout?

Leave a Reply

Your email address will not be published. Required fields are marked *