WC_Coupon::set_excluded_product_ids()publicWC 3.0.0

Set the product IDs this coupon cannot be used with.

Method of the class: WC_Coupon{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Coupon = new WC_Coupon();
$WC_Coupon->set_excluded_product_ids( $excluded_product_ids );
$excluded_product_ids(array) (required)
Exclude product IDs.

Changelog

Since 3.0.0 Introduced.

WC_Coupon::set_excluded_product_ids() code WC 8.7.0

public function set_excluded_product_ids( $excluded_product_ids ) {
	$this->set_prop( 'excluded_product_ids', array_filter( wp_parse_id_list( (array) $excluded_product_ids ) ) );
}