woocommerce_coupon_validate_minimum_amount

woocommerce_coupon_validate_minimum_amount

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_coupon_validate_minimum_amount') is found 1 times:

  • /includes/class-wc-discounts.php line 723
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    */
    protected function validate_coupon_minimum_amount( $coupon ) {
        $subtotal = wc_remove_number_precision( $this->get_object_subtotal() );
     
        if ( $coupon->get_minimum_amount() > 0 && apply_filters( 'woocommerce_coupon_validate_minimum_amount', $coupon->get_minimum_amount() > $subtotal, $coupon, $subtotal ) ) {
            /* translators: %s: coupon minimum amount */
            throw new Exception( sprintf( __( 'The minimum spend for this coupon is %s.', 'woocommerce' ), wc_price( $coupon->get_minimum_amount() ) ), 108 );
        }
     
        return true;
    }