Well, I finally got around to trying this, and it doesn't work for me, despite having 4.1.9 .
Admittedly, x-cart is installed only as my shopping cart (so the actual "add to cart" button is clicked on from a page outside x-cart, and only then x-cart is entered, directly into the shopping cart) but still I would have thought
HTTP_REFERER would contain the correct value?
Yet back_url always ends up being
https://www.mysite.com/xcart/cart.php?keep_https=yes
The code I used was
PHP Code:
x_session_register("back_url");
if ($mode == "add" && strpos($_SERVER['HTTP_REFERER'], "cart.php")>0 )
{
$back_url = $_SERVER['HTTP_REFERER'];
}
$smarty->assign("back_url", $back_url);
And
PHP Code:
<a href="{$back_url}"><img src="{$ImagesDir}/ContinueShopping.gif" border="0" align="absmiddle" alt="Continue Shopping"></img></a>