如何让这段代码调用多个产品,而不是像现在这样只调用一个产品?
add_filter( 'woocommerce_coupon_is_valid_for_product', 'quadlayers_exclude_product_from_product_promotions', 9999, 4 );
function quadlayers_exclude_product_from_product_promotions( $valid, $product, $coupon, $values ) {
// PRODUCT ID = 813869026091
if ( 813869026091 == $product->get_id() ) {
$valid = false;
}
return $valid;
}```
I am trying to get this statement to say if the id is 005 OR 077 then exclude it from the coupon. Right now I can only get 1 ID in the code (I don't know PHP very well. Thank you
1条答案
按热度按时间jutyujz01#