Quote:
Originally Posted by Pinestream
My first X-Cart contribution.....
People have been asking how to return to the same page, not the cart, after removing a product from the min-cart. Simple -- find this code section in cart.php:
# DELETE PRODUCT
if ($mode == "delete" && !empty($productindex)) {
...
...
...
$cart = func_array_merge($cart, func_calculate($cart, $products, $login, $current_area, 0));
--> ADD THIS:
$return_url = $_SERVER['HTTP_REFERER'];
func_header_location($return_url);
}
That's it. Just remember -- it would be wise to add some input validation/filtering on $_SERVER['HTTP_REFERER'].
|
I could not get this to work, but noticed this line:
PHP Code:
func_header_location("cart.php");
which I changed to:
PHP Code:
func_header_location("home.php");
This work great. Again thanks to all who have contributed to this mod.