You appear to be a bot. Output may be restricted
Description
Check if the minimum cart amount is satisfied for the discount to hold.
Usage
$bool = EDD_Discount::is_min_price_met( $set_error );
Parameters
- $set_error
- ( bool ) optional default: 1 – Whether an error message be set in session.
Returns
bool Is the minimum cart amount met?
Source
File name: easy-digital-downloads/includes/class-edd-discount.php
Lines:
1 to 21 of 21
public function is_min_price_met( $set_error = true ) { $return = false; $cart_amount = edd_get_cart_discountable_subtotal( $this->ID ); if ( (float) $cart_amount >= (float) $this->min_price ) { $return = true; } elseif( $set_error ) { edd_set_error( 'edd-discount-error', sprintf( __( 'Minimum order of %s not met.', 'easy-digital-downloads' ), edd_currency_filter( edd_format_amount( $this->min_price ) ) ) ); } /** * Filters if the minimum cart amount has been met to satisify the discount. * * @since 2.7 * * @param bool $return Is the minimum cart amount met or not. * @param int $ID Discount ID. */ return apply_filters( 'edd_is_discount_min_met', $return, $this->ID ); }