WC_Coupon::set_product_ids
Set the product IDs this coupon can be used with.
Method of the class: WC_Coupon{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Coupon = new WC_Coupon(); $WC_Coupon->set_product_ids( $product_ids );
- $product_ids(array) (required)
- Products IDs.
Changelog
| Since 3.0.0 | Introduced. |
WC_Coupon::set_product_ids() WC Coupon::set product ids code WC 10.6.2
public function set_product_ids( $product_ids ) {
$this->set_prop( 'product_ids', array_filter( wp_parse_id_list( (array) $product_ids ) ) );
}