Jump to content

detection product in cart


Recommended Posts

Hi guys, i search on the forum but couldn't find a similar topic.

I need to give a free product to some customers (which i identify outside the shop) and they need to have a choice of 2 products of which they can only choose one (gift). Now i need to be able to detect when a product is in the cart or not (so they can't add both free products or quantities of more than one)

I am able to catch the product being added on cart.php using $idProduct from the add function, but i cant see if the product exists in the cart. How can you get cart.php to call the function which returns the cart contents? if i could do that a simple foreach would solve the problem for me

Does any of you guys know how to do it?

Thank you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...