I have this problem : i’m working on a small e-shop and I have about 60 products in the database . all the products have a code , like : 4444, 5334, 3244 and so on . The problem is that there are also product packs and they are made out of several products .
I have to do this : everytime there is an update to the CART there must be a script checking if the products in CART can make a PRODUCT PACK and replace all the products from the CART with that product pack .
What do you think would be the best way to do this check / change ?
Assuming
$packsis an array of arrays of items, and$cartis an array of items: