PHP Shopping Cart Script - When to empty cart?
Posted
by
john
on Stack Overflow
See other posts from Stack Overflow
or by john
Published on 2012-07-04T03:08:20Z
Indexed on
2012/07/04
3:15 UTC
Read the original article
Hit count: 389
Im working on a shopping cart script in php and need some advice on how to handle the final process.
Once the customer has entered items into the cart, chosen shipping option, and then clicked the checkout button, they are then redirected to a paypal button which is dynamically generated using BMCreateButton.
My question is, when is the best time to empty the customers cart?
I have set up the auto return feature on paypal, which i was goin to use to then empty the cart, but its not very good as customers have to click a link in order to redirect.
So should i empty it when they click the checkout button just before the dynamic button?
I can also use these setting in php to prevent cach back button issues
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
What would to guys recommend?
cheers.
© Stack Overflow or respective owner