add items to a cart - POST, GET or GET + special code?
Posted 06 March 2006 - 11:19 PM
One reason I don't like POST for this purpose is that if the user refreshes the page, they get the annoying WARNING regarding POST data.
However, with the GET method, after an item has been added to the cart (?additem=1234), if the user refreshes the page, the item gets added again (if the item can be sold multiple times).
Some sites don't let items increment in a cart unless the user changes the item quantity in the cart and then updates the cart. Other sites let you click the add cart item again and the item increments by 1.
I've figured out a solution for this using a session switch. It's not hard to do, but I'm just curious as to what other's preferred method is for carts - if you have a cart on your site.
Posted 07 March 2006 - 01:49 AM
I'm going to continue using GET for the cart. However, when I'm done with my add item script, I will simply reload the page without the additem in the url. This way the page can be refreshed without adding another item. The back button will take you back to the item you were looking at. You can add the item again and it will increment. It works, I love it!
Posted 07 March 2006 - 04:02 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users