Emptying Cart on Add Product

Posts: 6
Joined: 04/15/2008

Is there any way to empty the shopping cart whenever a product is added outside of using the "e" option on the custom cart links?

I have three products, which are all mutually exclusive. Two of these products can only ever have a quantity of one (1). The third product can have a variable quantity (i.e. 1 or more).

When I only had the two original products, I was using custom cart links to include the "e" option to empty the cart. However, since adding the third variable product, I was hoping to use the add cart link default buttons using the display quantity option, which is really nice since it hides the display quantity field if the product enters a "0" default value.

Unfortunately, I haven't been able to find a configurable for emptying the cart on product add when using the add cart link buttons. I'm more then happy to do this within a module hook if I can find the right one as well.

Any advice is greatly appreciated. Thanks!

Posts: 3744
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Something this complicated is going to require custom development. You can take action when someone submits an add to cart form, and that is how you're going to have to empty the cart contents when appropriate.

Posts: 6
Joined: 04/15/2008

Thanks again, Ryan!