Thread tagged as: Question

Help with perch_shop_set_discount_code

Hello, I need some PHP help here please.

I want to use a basic php page add_to_cart.php to add products to the cart getting the pid parameter from the url. Also for a specific pid I want it to apply a discount code. So this is what I did


$pid = perch_get('pid');

if ($pid === '11') {

I tested it with the specific pid and it worked but problem is that it now applies the discount to all products not only pid 11. And even if I remove the line with perch_shop_set_discount_code or disable the promotion, it still does apply the discount. Something is terribly wrong in my page but have no idea what. Anyone could guide me here?

Thanks in advance!

Proko Mountrichas

Proko Mountrichas 3 points

  • 2 years ago