Quote:
Originally Posted by glsp
I added a file "continue_shopping.tpl" in /skin1/buttons so I could use the Continue Shopping link at the top and bottom of my cart:
PHP Code:
{include file="buttons/button.tpl" button_title=$lng.lbl_continue_shopping href="$back_url"}
My store is straight forward, so the only pages a customer could come from that would make sense to return to are category pages and product pages, so in cart.php, I have:
PHP Code:
# # Continue Shopping link # x_session_register("back_url"); $referrer = $_SERVER['HTTP_REFERER']; if (strpos($referrer, "home.php") || strpos($referrer, "product.php")) { $back_url = $referrer; } else if (!$back_url) { $back_url = 'home.php'; }
$smarty->assign("back_url", $back_url); # End Continue Shopping
|
strpos($referrer, "product.php") - will don't work with url rewrite mods (DSEFU, CDSEO and etc).