Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

The universal solution "Continue Shopping Button"

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #61  
Old 10-17-2008, 11:27 AM
  Blazeland's Avatar 
Blazeland Blazeland is offline
 

Advanced Member
  
Join Date: Mar 2005
Posts: 46
 

Default Re: The universal solution "Continue Shopping Button"

Nice mod, works perfectly. Thanks.
__________________
X-Cart Version 4.1.10
Reply With Quote
  #62  
Old 10-18-2008, 09:03 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: The universal solution "Continue Shopping Button"

Quote:
Originally Posted by Michael Burns
X-cart total newbie here. PHP, and SQL challenged.. Could someone please post or pm me the files and the edits including making the button, and all things needed to make this work in 4.1.10. I would love the ability to send the user back to the catagory they were viewing just before they hit add to cart. Right now the only thing I can tell thim is hit their backspace key to go back to that position.

Thanks Mike

Are you using Fast Lane Checkout? If so, there is a "continue shopping" button that will send the customer back to the home page. Much easier than using the backspace key

This mod is if you want to send the customer somewhere else, and it gets quite complicated because people want the customer to be returned to different places.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #63  
Old 10-22-2008, 05:57 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: The universal solution "Continue Shopping Button"

Was Updated first page with the latest forum messages from this thread.
Reply With Quote
  #64  
Old 10-22-2008, 07:43 AM
 
Michael Burns Michael Burns is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 41
 

Default Re: The universal solution "Continue Shopping Button"

Thanks for the help Yurij. Got it working now.
__________________
Version 4.4.3 Gold mod illiterate and mostly confused
Reply With Quote
  #65  
Old 10-23-2008, 02:23 AM
 
TanyaG TanyaG is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 94
 

Default Re: The universal solution "Continue Shopping Button"

Thanks a lot for your help Yurij. Great work.
__________________
Tanya

x-cart version: 4.1.7 4.1.9. 4.2
Reply With Quote
  #66  
Old 11-30-2008, 05:02 AM
 
xsurf xsurf is offline
 

Advanced Member
  
Join Date: Mar 2008
Posts: 56
 

Default Re: The universal solution "Continue Shopping Button"

Just when you would have thought all permutations have been considered, time for a new challenge .

What I am trying to do is the following: if arrived to the cart by adding an item, then "continue shopping" should return me to the product category.

BUT if someon arrives to the cart in any other way (e.g. clicking on "view cart" from anywhere), then "continue shopping" should return them to the page they were on when they clicked on "view cart".

I tried
PHP Code:
x_session_register("back_url");
if (
strpos($_SERVER['HTTP_REFERER'], "cart.php") == false)
{
    
$back_url $_SERVER['HTTP_REFERER'];
}
if (
$mode == "add")

    
$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); 

but off course that just always gets me back to the page I was on before, never to the product category page, since every time cart.php?mode=add is called, it is immediately followed by a regular call to cart.php (with the referrer remaining the product detail page)...


Help?
__________________
X-cart Gold 4.1.12
One Page Checkout
CDSEO Pro
Smart Search
PHP 5.2.5
FreeBSD
Reply With Quote
  #67  
Old 12-02-2008, 07:02 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: The universal solution "Continue Shopping Button"

Quote:
Originally Posted by xsurf
Just when you would have thought all permutations have been considered, time for a new challenge .

What I am trying to do is the following: if arrived to the cart by adding an item, then "continue shopping" should return me to the product category.

BUT if someon arrives to the cart in any other way (e.g. clicking on "view cart" from anywhere), then "continue shopping" should return them to the page they were on when they clicked on "view cart".

I tried
PHP Code:
x_session_register("back_url");
if (
strpos($_SERVER['HTTP_REFERER'], "cart.php") == false)
{
    
$back_url $_SERVER['HTTP_REFERER'];
}
if (
$mode == "add")

    
$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); 

but off course that just always gets me back to the page I was on before, never to the product category page, since every time cart.php?mode=add is called, it is immediately followed by a regular call to cart.php (with the referrer remaining the product detail page)...


Help?



I'm not sure, but try used next code (i don't tested this code enough):

PHP Code:
x_session_register("back_url");
x_session_register("skip_one_redirect");

if (
$mode == "add")

    
$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];
                
$skip_one_redirect 1
            }
        }        
    }
} else {
    if (
$skip_one_redirect==) {
        
$skip_one_redirect=0;
    } else {
        if (
strpos($_SERVER['HTTP_REFERER'], "cart.php") === false)
        {
            
$back_url $_SERVER['HTTP_REFERER'];
        }
    }
}

$smarty->assign("back_url"$back_url); 
Reply With Quote
  #68  
Old 01-14-2009, 11:32 AM
 
nivag nivag is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 76
 

Default Re: The universal solution "Continue Shopping Button"

Does anyone know how to get the same effect in 4.2 ? so that the customer goes back to the products lists and not the main home page ?

Thanks in advance !
Reply With Quote
  #69  
Old 02-27-2009, 04:41 AM
 
zebragrf zebragrf is offline
 

Newbie
  
Join Date: Sep 2005
Location: US
Posts: 3
 

Default Re: The universal solution "Continue Shopping Button"

I tried each one of those and they did not work for me.

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.
__________________
Jeff French
Reply With Quote
  #70  
Old 02-27-2009, 05:26 AM
 
zebragrf zebragrf is offline
 

Newbie
  
Join Date: Sep 2005
Location: US
Posts: 3
 

Default Re: The universal solution "Continue Shopping Button"

For some reason, it does not affect my page. Granted, I am coming from a static page outside of x-cart but why shouldn't it go BACK to that page?

Here is the link: https://www.thinscentsonline.com/store/cart.php?keep_https=yes
__________________
Jeff French
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:00 AM.

   

 
X-Cart forums © 2001-2020