View Single Post
  #57  
Old 05-14-2007, 07:11 AM
  hoosierglass's Avatar 
hoosierglass hoosierglass is offline
 

X-Adept
  
Join Date: Aug 2006
Location: Zionsville, IN
Posts: 974
 

Default Re: Improved minicart display

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.
__________________
X-Cart Gold 4.7.7
Custom Work from www.luminointernet.com
www.indy-pen-dance.com
Reply With Quote