View Single Post
  #95  
Old 05-24-2010, 07:32 AM
 
successco successco is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: Washington USA
Posts: 42
 

Talking Re: The universal solution "Continue Shopping Button"

Quote:
Originally Posted by Yurij
UPDATE: 22-10-2008

1. Edit file cart.php, after next lines:

PHP Code:
...........
x_session_register("dhl_ext_country_store");
x_session_register("ga_track_commerce");
x_session_register("initial_state_orders", array());
x_session_register("initial_state_show_notif""Y");
x_session_register("enter_as_anonymous"false); 

add next lines:

a) return to the last page;
PHP Code:
#back URL when cont. shoping:
x_session_register("back_url");
if (
$mode == "add")
{
    
$back_url $_SERVER['HTTP_REFERER'];
}

$smarty->assign("back_url"$back_url); 



b) Is it any chance to send customers back into ROOT directory instead of subcategory? - Yes

PHP Code:
#back URL when cont. shoping:

x_session_register("back_url");
if (
$mode == "add")
{
    
$back_url $_SERVER['HTTP_REFERER'];

    
$id intval($productid);
    if (
$id>0) {
        
$cat_path func_query_first_cell("select categoryid_path from $sql_tbl[products_categories]$sql_tbl[categories] where (productid = $id)and(main='Y')and($sql_tbl[products_categories].categoryid=$sql_tbl[categories].categoryid)");
        if (!empty(
$cat_path)) {
            
$cats_path split("/ *",$cat_path);        
            if (!empty(
$cats_path[0])) {
                
$back_url "home.php?cat=".$cats_path[0];
            }
        }
    }
}
$smarty->assign("back_url"$back_url); 

c) Is it any chance to send customers back into PRODUCT category? - Yes

PHP Code:
#back URL when cont. shoping:

x_session_register("back_url");
if (
$mode == "add")
{
    
$back_url $_SERVER['HTTP_REFERER'];

    
$id intval($productid);
    if (
$id>0) {
        
$cat_path func_query_first_cell("select categoryid_path from $sql_tbl[products_categories]$sql_tbl[categories] where (productid = $id)and(main='Y')and($sql_tbl[products_categories].categoryid=$sql_tbl[categories].categoryid)");
        if (!empty(
$cat_path)) {
            
$cats_path split("/ *",$cat_path);        
            if (!empty(
$cats_path[0])) {
                
$last end($cats_path);
                
$back_url "home.php?cat=".$last;
            }
        }
    }
}
$smarty->assign("back_url"$back_url); 

2. Edit URL for "Continue Shopping Button", exm. for Fast Lan Check Out:
Edit file: "skin1/modules/Fast_Lane_Checkout/home_main.tpl", change line:
PHP Code:
<td>{include file="modules/Fast_Lane_Checkout/big_button.tpl" button_title=$lng.lbl_continue_shopping style="button" href="home.php"}</td

replaced by this code

PHP Code:
<td>{include file="modules/Fast_Lane_Checkout/big_button.tpl" button_title=$lng.lbl_continue_shopping style="button" href="`$back_url`"}</td




PS. I would be grateful for any comments on that decision. It should almost always work.

Works perfectly for returning to previous category from Checkout (not using Fast Lane), in version 4.1.6. with very extensive customizations. Took less than 5 minutes to integrate & test & adjust just a little to
PHP Code:
{include file="buttons/button.tpl" button_title=$lng.lbl_continue_shopping href=$back_url title=$title style=$style
Thank you very much for sharing this.
__________________
X-cart Gold 4.1.6
X-affiliate 4.1.6
Reply With Quote