If the promotion code is “MAG20” and the product code is “99” or the product code is “77” or the product code is “44”.. then do something.
(the promotion code is the same and the product list is the same too but it is large)
if ($promocode=="MAG20" && $productID=="44" && || $productID=="77") {
// wahay! run function
} else {
// no coupon for you
}
I was hoping that IF PROMO MAG20 AND CODE IS 99 OR CODE IS 77 would work && || – also is there a better way of doing this as the bracket is going to be big, 30+ products.
You should make an array out of all your names
then the if function
So you have 1 list of ID’s, and a short if statement