WordPress at Your Fingertips
function is not described

WC_Discounts::validate_coupon_eligible_items() protected WC 3.2.0

Cart discounts cannot be added if non-eligible product is found.

{} It's a method of the class: WC_Discounts{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->validate_coupon_eligible_items( $coupon );
$coupon(WC_Coupon) (required)
Coupon data.

Changelog

Since 3.2.0 Introduced.

Code of WC_Discounts::validate_coupon_eligible_items() WC 5.6.0

protected function validate_coupon_eligible_items( $coupon ) {
	if ( ! $coupon->is_type( wc_get_product_coupon_types() ) ) {
		$this->validate_coupon_sale_items( $coupon );
		$this->validate_coupon_excluded_product_ids( $coupon );
		$this->validate_coupon_excluded_product_categories( $coupon );
	}

	return true;
}