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

Continue Shopping

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #61  
Old 12-30-2005, 08:42 PM
 
dchihorn dchihorn is offline
 

Advanced Member
  
Join Date: Mar 2005
Location: USA - Texas - DFW
Posts: 34
 

Default

Thank you again, it is much appreciated your patience and continued responses. From all initial tests, it is working great.
__________________
--------------------------
X-cart ver 4.0.16
Reply With Quote
  #62  
Old 01-03-2006, 05:23 PM
  JWait's Avatar 
JWait JWait is offline
 

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

Default

I ended up using the code supplied by xgarb, but I found that I had to modifiy the continue_shopping.tpl from

{* source: http://forum.x-cart.com/viewtopic.php?t=1124 *}
{if $goto eq "product" and $last_productid neq ""}
{assign var="href" value="`$WebDir`/product.php?productid=`$last_productid`"}
{elseif $last_cat neq ""}
{assign var="href" value="`$WebDir`/home.php?cat=`$last_cat`"}
{else}
{assign var="href" value="`$http_location`"}
{/if}
[img]{$ImagesDir}/buttons/continue_shopping.gif[/img]

to

{* source: http://forum.x-cart.com/viewtopic.php?t=1124 *}
{if $goto eq "product" and $last_productid neq ""}
{assign var="href" value="`$WebDir`product.php?productid=`$last_produ ctid`"}
{elseif $last_cat neq ""}
{assign var="href" value="`$WebDir`home.php?cat=`$last_cat`"}
{else}
{assign var="href" value="`$WebDir`home.php"}
{/if}
{include file="buttons/button.tpl" button_title=$lng.lbl_continue_shopping style="button" href="$href"}

The reason? What if the customer wasn't in a category before clicking the 'continue shopping' button? I found it was going the home page, which in my case is index.html, so I made it go to home.php instead. I'm not sure if the code is exactly right, but it works
__________________
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 02-01-2006, 06:55 AM
  NightFire's Avatar 
NightFire NightFire is offline
 

X-Adept
  
Join Date: Jul 2004
Location: The Netherlands
Posts: 561
 

Default

Quote:
Originally Posted by JWait
I ended up using the code supplied by xgarb, but I found that I had to modifiy the continue_shopping.tpl from

CODE....

The reason? What if the customer wasn't in a category before clicking the 'continue shopping' button? I found it was going the home page, which in my case is index.html, so I made it go to home.php instead. I'm not sure if the code is exactly right, but it works

I tried to implement this code. Made the button continue_shopping.tpl and added it into cart.tpl. But when I click on the button I'm send back to home.php, and not the category where I am from. So it doesn't work.
__________________
Best regards,
Niki Buitenrust Hettema

X-Cart Gold 4.1.8 (Live & Loaded)
Royal Bhaktapur: Handmade products from Nepal - Pashmina's, scarfs, shawls, stola's and more...
Reply With Quote
  #64  
Old 03-03-2006, 01:10 PM
 
groovedis groovedis is offline
 

Advanced Member
  
Join Date: Apr 2005
Posts: 52
 

Default

Hi. I'm having a problem where if I buy a product featured on home.php and then click 'Continue Shopping' instead of taking me back to home.php it takes me to a category.

If I go to home.php, 'buy now' and then click 'continue shopping' it goes to home.php?cat=360 instead of home.php. Even though I've never even looked at home.php?cat=360.

If I browse a category (for example home.php?cat=527) and then go back to home.php and 'buy now' and then click 'continue shopping' it goes to home.php?cat=527 instead of home.php.

I've tried both xgarb and JWait's versions and the same thing happens. Any help would be most appreciated... thanks.
__________________
X-Cart version 4.0.13 (unix)
Reply With Quote
  #65  
Old 03-05-2006, 12:43 AM
 
xgarb xgarb is online now
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default

Nightfre, I guess you did this bit as well?
Quote:
add to config.php....

Code:
x_session_register("last_cat");
x_session_register("last_productid");

if($HTTP_GET_VARS['cat'] != "")
{
$last_cat = $cat;
}

if($HTTP_GET_VARS['productid'] != "")
{
$last_productid = $productid;
}

$smarty->assign("last_productid", $last_productid);
$smarty->assign("last_cat", $last_cat);

groovedis,
I think it's to do with the cats that the 'featured items' on the homepage are from. Not sure how you'd fix it, or if it's really worth worrying about.
__________________
Core version: 5.5.xx
Reply With Quote
  #66  
Old 06-21-2006, 03:11 PM
 
AKR AKR is offline
 

eXpert
  
Join Date: Oct 2003
Location: the edge of insanity
Posts: 233
 

Default

Quote:
Originally Posted by xgarb
Going from inthepink's code I did this...

create a tpl. file in buttons called continue_shopping.tpl

add the following code to it...

Code:
{* source: http://forum.x-cart.com/viewtopic.php?t=1124 *} {if $goto eq "product" and $last_productid neq ""} {assign var="href" value="`$WebDir`product.php?productid=`$last_productid`"} {elseif $last_cat neq ""} {assign var="href" value="`$WebDir`home.php?cat=`$last_cat`"} {else} {assign var="href" value="`$http_location`"} {/if} {include file="buttons/button.tpl" button_title="Continue Shopping" style="button" href="$href"}

add to config.php....

Code:
x_session_register("last_cat"); x_session_register("last_productid"); if($HTTP_GET_VARS['cat'] != "") { $last_cat = $cat; } if($HTTP_GET_VARS['productid'] != "") { $last_productid = $productid; } $smarty->assign("last_productid", $last_productid); $smarty->assign("last_cat", $last_cat);

You can then use....

Code:
{include file="buttons/continue_shopping.tpl"}

whereever you like to give you a continue shopping button. I've got it next to the checkout button and also below 'Your shopping cart is empty'

sweet!

and for those of us who want to use our own custom button, use balinor's fix in this post:

http://forum.x-cart.com/viewtopic.php?t=12078&highlight=buy+image
__________________
version: 4.4.1 Gold [Unix]
Reply With Quote
  #67  
Old 08-10-2006, 10:24 AM
 
Dawn Howard Dawn Howard is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 229
 

Default

There are so many posts in this thread, I'm sorry, but I do not understand most of them. Either it's not clear what files to make change or there are reported problems or the post is so old I don't want to try it on my version.

Can someone, obviously smarter than me, please post a clear explanation how to implement a Б─°continue shoppingБ─² button/link on the cart page that will take the customer back to the category they were shopping in? Please include the file name(s) that need to be edited.

Thank you!
__________________
Dawn
X-Cart Business 5.3.6.3
Mods:
Qty input - Custom Mod
Part numbers near title - Custom Mod
Membership approval before ordering - Custom Mod
Order Forms - Custom Mod
Freight on Board - Custom Mod
Catalog Order Form
Call For Price
Template: Crisp White skin
Running on Windows
Reply With Quote
  #68  
Old 08-13-2006, 08:05 PM
 
elomibao elomibao is offline
 

Member
  
Join Date: Sep 2004
Posts: 24
 

Default

Wow, I never thought I'd see this thread again.

I'll update the continue shopping thing that doesn't require javascript (I hope).
__________________
X-Cart Pro 4.0.5
Fedora Core 2
Apache 2.x/PHP 4.x
MySQL 3.x
Reply With Quote
  #69  
Old 08-23-2006, 05:45 AM
 
mikalou mikalou is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 71
 

Default Re: Continue Shopping

I have a solution that▓s based on the JavaScript history function (javascript: history.go(-1)) that some of the other solutions in this thread used. This will always take you back to the previous page which, logically, should always be the page you just clicked the ⌠add to cart■ button. So, if you clicked on the ⌠add to cart■ button from the home page, then selecting the ⌠continue shopping■ button will take you back to the home page. If you clicked on the ⌠add to cart■ button from a category page it will take you back to that category page. etc. The ⌠continue shopping■ button will only appear when a product was just added to the cart. So for instance, if you click on the ⌠View Cart■ link in the minicart from the home page, then the ⌠continue shopping■ button won▓t appear.

Step1: Edit: /cart.php

In the code:
Code:
if($mode=="add" and $productid) { if($config["General"]["redirect_to_cart"]=="Y") { func_header_location("cart.php?");
Revise to:
Code:
if($mode=="add" and $productid) { if($config["General"]["redirect_to_cart"]=="Y") {func_header_location("cart.php?mode=added");

Step 2: Edit: /skin1/customer/main/cart.tpl

Change:
Code:
{include file="buttons/continue_shopping.tpl"}

To:
Code:
{if $smarty.get.mode eq 'added'} {include file="buttons/continue_shopping.tpl"} {/if}
Short explanation of what▓s happening so far. We▓re using a smarty function to check the query string to see if the value ⌠mode■ is set to ⌠added■. If it is, then the ⌠continue shopping■ button is displayed.

Step 3: Create a file: skin1/buttons/continue_shopping.tpl
Code:
{include file="buttons/button.tpl" button_title=$lng.lbl_continue_shopping href=$href|default:"javascript: history.go(-1);" title=$title style=$style js_to_href="Y"}
In this code, we▓re using the JavaScript function to send the customer back one page. Logically, this should be the page the customer just clicked the ⌠add to cart■ button.
__________________
X-Cart Gold 4.2.2 - 3.1.19
Reply With Quote
  #70  
Old 01-11-2007, 07:51 AM
 
burtsTechie burtsTechie is offline
 

Member
  
Join Date: Sep 2006
Posts: 20
 

Default Re: Continue Shopping

I can't seem to get the config.php addition to work on 4.13. I can't get any pages to load after I make that change. I'm using xgard's code from earlier in this thread. Does anybody have any suggestions?
__________________
X-Cart Version: 4.15 (in development)
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 01:44 PM.

   

 
X-Cart forums © 2001-2020