I've got a situation where I'm implementing a 3rd party shopping cart to process transactions, but I'm using static pages (for now) to display our product catalog to our customers. I've been able to modify the shopping cart code so that, when a user adds a product from our site to their cart, the "Continue Shopping" button will return them to the product page from which they came (ala $_SERVER['HTTP_REFERER']).
The problem arises when the user views to their shopping cart from a product page and then makes changes to their cart, such as removing or changing the quantity of an item. Because the shopping cart page uses itself to process the change, $_SERVER['HTTP_REFERER'] becomes the shopping cart page, not the product page from which they came. Thus, the "Continue Shopping" button takes them back to their shopping cart.
I could instead check the value of $_SERVER['HTTP_REFERER'] and determine if it is the shopping cart and, if so, just send them to the product catalog index. But, that's not the page from which they came. I'd much rather send them back to the product page from which the came to the shopping cart.
Any thoughts???