ModularMerchant
Knowledge Base
Shopping Cart Software Online Manual
Emptying a Customer's Basket Using "Add to Cart" links
Credit Card Security Codes and Shopping Carts Optimize Shopping Cart Product Pages for SEO
Location Home > Editorial > Blogs > Tips, Tricks and Astounding Revelations

Emptying a Customer's Basket Using "Add to Cart" links

"Add to Cart" links are quite useful for adding products to a customer's order, but did you know that they can also be used to empty a customer's cart too? This can be very useful when you want to remove any products present in the customer's cart before adding new products to it.

To empty the contents of the customer's cart, include the variable empty=Y in the "Add to Cart" link code.

example
This modified "Add to Cart" link will first empty the customer's shopping basket, and then add product SID 123 to it:
http://www.MyStore.com/quick_basket.php?id1=123&qty1=1&empty=Y

The order of the variables in the link does not matter. The empty=Y variable may appear first, second, third, etc. in the link's list of variables.

The value of the empty variable can be anything, it doesn't necessarily need to be "Y" as used in the examples above.

reference
If you aren't familiar with "Add to Cart" links, be sure to read the introduction to "Add to Cart" links Knowledge Base article.


— Last Edited - 12/5/2012 2:18pm PST
Rank and add a comment to this article
Only logged in users may leave comments and rank articles. Log in to have your say!
  Knowledge Base Home

  QuickCode™ Tag Glossary

  Modular Merchant.com Homepage

Not Logged in.
Either Log in or create a User Account.

Other articles in this category...

Credit Card Security Codes and Shopping Carts

Emptying a Customer's Basket Using "Add to Cart" links

Optimize Shopping Cart Product Pages for SEO

Preventing Fraudulent Shopping Cart Transactions