0

In Cartthrob I would like to only allow the user to purchase one product on checkout. If a new product is added to the cart it replaces the one already in the cart. Any suggestions?

0

(I work at Vector Media Group; we make CartThrob).

Depending on your site and product setup, you may be able to do this by using a clear_cart tag followed by an add_to_cart tag. These may be able to be on the same template, which you send a person to to add to your cart, or have the empty redirect to the add. This method won't work for products where you need to pass around options and such though.

The more reliable method that would let you handle more complexity is a simple extension that fires on add_to_cart. It can remove the old product when the new one is added. Feel free to contact us if you need help making that!

  • Hey Matt, in my case using the clear_cart tag on the same page as the add_to_cart form is working. Thanks for your help! – Thomas K Oct 22 '15 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.