Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Claudio Sanches

    (@claudiosanches)

    You can use the wc_payment_discounts_apply_discount filter for it.

    Here one example that you can use creating a new plugin or in your theme functions.php:

    function custom_wc_payment_discounts_min_order( $avaliable, $cart ) {
    	$subtotal     = $cart->cart_contents_total;
    	$min_subtotal = 100;
    
    	if ( $min_subtotal <= $subtotal ) {
    		return true;
    	}
    
    	return false;
    }
    
    add_filter( 'wc_payment_discounts_apply_discount', 'custom_wc_payment_discounts_min_order', 10, 2 );
    
    Thread Starter dorananCS

    (@doranancs)

    Great !
    Many thanks!

    Thread Starter dorananCS

    (@doranancs)

    Hi,

    I updated WooCommerce to version 2.4.6 but this code not work now.

    Could you help me please?

    Many thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I determine minimum order to give discount’ is closed to new replies.