Search code examples
phpphp4

PHP: Buy both and save $50?


OK my client wants to show a buy both feature in the cart, if they have 1 particular item type in the cart they want it to show up for another particular item type so if they buy both they can save $50 off the total. I am trying to wrap my head around what would be the best way to set this up so it couldn't be easily hacked (ie: adding both to the cart then removing one and keeping the discount)

does anyone have some general ideas in theory?

Thanks.


Solution

  • Why not perform the check right before they submit the order? that way, everytime they get to the submit order page, it will check if both items are present.