X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Continue Shopping (https://forum.x-cart.com/showthread.php?t=873)

groovedis 11-08-2005 02:48 PM

thanks xgarb.. you the man!

sean6869 12-08-2005 06:31 AM

Question
 
Whenever i add any of these methods my view cart page becomes almost blank. Any ideas? ive tried all of the methods above

xgarb 12-09-2005 12:48 AM

almost blank?

sean6869 12-10-2005 07:10 AM

yes
 
Yea the only thing that shows up is the categories on the left. the cart page gets blank.

shipmerchant 12-10-2005 10:23 AM

Re: yes
 
Quote:

Originally Posted by sean6869
Yea the only thing that shows up is the categories on the left. the cart page gets blank.


Why dont you post snippets of code you have modified so that we could try to help?

sean6869 12-10-2005 06:50 PM

thank you
 
i was using shan's method..

i would create a tpl file and put

then go to cart.tpl and put

Code:

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

and after i would upload and overwrite the original cart.tpl the page would get blank except a few things..

thank you again for helping me. if you have any suggestions please let me know. I think i might be editing the wrong file or putting it in the wrong place.

shipmerchant 12-10-2005 07:08 PM

Re: thank you
 
Quote:

Originally Posted by sean6869
i was using shan's method..

i would create a tpl file and put

then go to cart.tpl and put

Code:

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

and after i would upload and overwrite the original cart.tpl the page would get blank except a few things..

thank you again for helping me. if you have any suggestions please let me know. I think i might be editing the wrong file or putting it in the wrong place.



Hi,

First of all you dont need to create a new template, you need to simply add the code to you original cart template. If I understand you correctly you overwrote your original cart.tpl which is not what you were supposed to do. I would go back and restore your original copy of your cart.tpl then add the code to that template. Hope this makes sense? if not let me know and I will be more then happy to send you a copy of my stores cart.tpl so that you could get an idea. This great mod does work, but you have to follow the instructions as outlined.

Good luck and hang in there. :D

sean6869 12-10-2005 07:15 PM

ok
 
Well i followed shan's deal and he said to create a new tpl. as far as editing my cart.tpl, i restored it. um what method did you use? and would you be able to help me do that?

thank you.

btw, its just the basic blue template in which i used.

shipmerchant 12-10-2005 07:42 PM

Here is what I used which is pretty straight forward but I do understand how confusing too many instructions could be trust me.

Look on page 2 of this thread for a post by:

Page 2
andreas04031
Advanced Member Joined: 16 Jun 2004 Posted: Wed Feb 16, 2005 5:32 am Post subject:


Follow these instructions and it should get you going, if not let us know. We all were in the same boat one time or another, atleast I know I was.

Good luck

sean6869 12-10-2005 08:12 PM

hey
 
I followed that exactly and here is what it does.


http://www.numismaticenterprises.com/catrmessed.JPG

shipmerchant 12-11-2005 06:37 AM

This appears to be problem with the home.tpl possibly not loading. So this would fall into the installation category. This mod will not cause what you are seeing unless you have moded or overwrote some other files from the cart.

I highly doubt this was displaying like this before by simply [adding] the code for this mod to the template outlined in the instructions?

Here is the snippet from my cart.tpl, sorry about the notes but I do this to help me know why this code is in place; helpful during future upgrades and troubleshooting too:

Starts at line 92 or so.

{* L92 Skin1/customer/main/cart.tpl code below added to display continue shopping button on pages *}
<TD align="right"><TABLE border="0" cellspacing="0" cellpadding="0" onclick="javascript: self.location='home.php'" style="cursor: pointer;" valign="middle">
<TR><TD>[img]/skin1/images/but1.gif[/img]</TD>
<TD class="Button" valign="middle" nowrap><FONT class="Button">Continue shopping</FONT></TD>
<TD>[img]/skin1/images/but2.gif[/img]</TD></TR>
</TABLE>
{*end of code for continue shopping button*}


Hope it helps Good luck. :D [/u]

sean6869 12-11-2005 09:58 AM

...
 
the cart is NOT modded at all. this is the only modding i have done.

sean6869 12-11-2005 09:59 AM

Here
 
Here is my cart.tpl unmodded.


Code:

{* $Id: cart.tpl,v 1.74.2.10 2005/03/24 15:03:03 max Exp $ *}
<H3>{$lng.lbl_your_shopping_cart}</H3>
{$lng.txt_cart_header}
{if $active_modules.Gift_Certificates ne ""}
{$lng.txt_cart_note}
{/if}



{capture name=dialog}
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/cart_offers.tpl"}
{/if}



{if $products ne ""}
<FORM action="cart.php" method="post" name="cartform">
<TABLE border="0" width="100%">
{section name=product loop=$products}
{if $products[product].hidden eq ""}
<TR><TD width="90" align="center" valign="top">
{if $active_modules.Special_Offers ne "" and $products[product].have_offers}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{else}
{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$products[product].image_x image_y=$products[product].image_y product=$products[product].product tmbn_url=$products[product].tmbn_url}
{/if}
</TD>
<TD valign="top">
<FONT class="ProductTitle">{$products[product].product}</FONT>



<TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD>
{$products[product].descr}
</TD></TR></TABLE>




{if $products[product].product_options ne ""}
{$lng.lbl_selected_options}:

{include file="modules/Product_Options/display_options.tpl" options=$products[product].product_options}




{/if}
{assign var="price" value=$products[product].display_price}
{if $active_modules.Product_Configurator ne "" and $products[product].product_type eq "C"}
{include file="modules/Product_Configurator/pconf_customer_cart.tpl" main_product=$products[product]}
{assign var="price" value=$products[product].pconf_display_price}



{/if}
<DIV align="left">
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice and $products[product].product_type ne "C"}
{include file="modules/Subscriptions/subscription_priceincart.tpl"}
{else}
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/cart_price_special.tpl"}
{/if}
<FONT class="ProductPriceConverting">{include file="currency.tpl" value=$price} x {if $active_modules.Egoods and $products[product].distribution}1<INPUT type="hidden"{else}<INPUT type="text" size=3{/if} name="productindexes[{$products[product].cartid}]" value="{$products[product].amount}"> = </FONT><FONT class="ProductPrice">{math equation="price*amount" price=$price amount=$products[product].amount format="%.2f" assign=unformatted}{include file="currency.tpl" value=$unformatted}</FONT><FONT class="MarketPrice"> {include file="customer/main/alter_currency_value.tpl" alter_currency_value=$unformatted}</FONT>
{if $config.Taxes.display_taxed_order_totals eq "Y" and $products[product].taxes}
{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}
{/if}
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/cart_free.tpl"}
{/if}
{/if}




{include file="buttons/delete_item.tpl" href="cart.php?mode=delete"uctindex=`$products[product].cartid`"} 
{if $products[product].product_options ne ''}
{if $config.UA.platform eq 'MacPPC' && $config.UA.browser eq 'MSIE'}
{include file="buttons/edit_product_options.tpl" href="javascript:window.open('`$catalogs.customer`/popup_poptions.php?target=cart&id=`$products[product].cartid`','POptions','width=400,height=350,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');" js_to_href="Y"}
{else}
{include file="buttons/edit_product_options.tpl" href="javascript:window.open('`$catalogs.customer`/popup_poptions.php?target=cart&id=`$products[product].cartid`','POptions','width=400,height=350,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');"}
{/if}
{/if}
</DIV>
</TD></TR>
<TR><TD colspan="2"><HR size="1" noshade></TD></TR>
{/if}
{/section}
</TABLE>
{if $active_modules.Gift_Certificates ne ""}
{include file="modules/Gift_Certificates/gc_cart.tpl" giftcerts_data=$cart.giftcerts}
{/if}
{include file="customer/main/cart_totals.tpl"}




{if $js_enabled}
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
<TR>
<TD>
{include file="buttons/update.tpl" type="input" href="javascript: document.cartform.submit()" js_to_href="Y"}
 
{include file="buttons/button.tpl" button_title=$lng.lbl_clear_cart href="cart.php?mode=clear_cart"}
</TD>
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/cart_checkout_buttons.tpl"}
{/if}
<TD align="right">
{include file="buttons/button.tpl" button_title=$lng.lbl_checkout style="button"  href="cart.php?mode=checkout"}
</TD>
</TR>
</TABLE>
{else}
<INPUT type="hidden" name="mode" value="checkout">
{include file="submit_wo_js.tpl" value=$lng.lbl_checkout}
{/if}
</FORM>
{else}
{$lng.txt_your_shopping_cart_is_empty}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_items content=$smarty.capture.dialog extra="width=100%"}
{if $cart.coupon_discount eq 0 and $products ne ""}



{if $active_modules.Discount_Coupons ne ""}
{include file="modules/Discount_Coupons/add_coupon.tpl}
{/if}
{/if}


sean6869 12-11-2005 10:00 AM

and
 
here it is when its edited.


Code:

{* $Id: cart.tpl,v 1.74.2.10 2005/03/24 15:03:03 max Exp $ *}
<H3>{$lng.lbl_your_shopping_cart}</H3>
{$lng.txt_cart_header}
{if $active_modules.Gift_Certificates ne ""}
{$lng.txt_cart_note}
{/if}



{capture name=dialog}
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/cart_offers.tpl"}
{/if}



{if $products ne ""}
<FORM action="cart.php" method="post" name="cartform">
<TABLE border="0" width="100%">
{section name=product loop=$products}
{if $products[product].hidden eq ""}
<TR><TD width="90" align="center" valign="top">
{if $active_modules.Special_Offers ne "" and $products[product].have_offers}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{else}
{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$products[product].image_x image_y=$products[product].image_y product=$products[product].product tmbn_url=$products[product].tmbn_url}
{/if}
</TD>
<TD valign="top">
<FONT class="ProductTitle">{$products[product].product}</FONT>



<TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD>
{$products[product].descr}
</TD></TR></TABLE>




{if $products[product].product_options ne ""}
{$lng.lbl_selected_options}:

{include file="modules/Product_Options/display_options.tpl" options=$products[product].product_options}




{/if}
{assign var="price" value=$products[product].display_price}
{if $active_modules.Product_Configurator ne "" and $products[product].product_type eq "C"}
{include file="modules/Product_Configurator/pconf_customer_cart.tpl" main_product=$products[product]}
{assign var="price" value=$products[product].pconf_display_price}



{/if}
<DIV align="left">
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice and $products[product].product_type ne "C"}
{include file="modules/Subscriptions/subscription_priceincart.tpl"}
{else}
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/cart_price_special.tpl"}
{/if}
<FONT class="ProductPriceConverting">{include file="currency.tpl" value=$price} x {if $active_modules.Egoods and $products[product].distribution}1<INPUT type="hidden"{else}<INPUT type="text" size=3{/if} name="productindexes[{$products[product].cartid}]" value="{$products[product].amount}"> = </FONT><FONT class="ProductPrice">{math equation="price*amount" price=$price amount=$products[product].amount format="%.2f" assign=unformatted}{include file="currency.tpl" value=$unformatted}</FONT><FONT class="MarketPrice"> {include file="customer/main/alter_currency_value.tpl" alter_currency_value=$unformatted}</FONT>
{if $config.Taxes.display_taxed_order_totals eq "Y" and $products[product].taxes}
{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}
{/if}
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/cart_free.tpl"}
{/if}
{/if}




{include file="buttons/delete_item.tpl" href="cart.php?mode=delete"uctindex=`$products[product].cartid`"} 
{if $products[product].product_options ne ''}
{if $config.UA.platform eq 'MacPPC' && $config.UA.browser eq 'MSIE'}
{include file="buttons/edit_product_options.tpl" href="javascript:window.open('`$catalogs.customer`/popup_poptions.php?target=cart&id=`$products[product].cartid`','POptions','width=400,height=350,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');" js_to_href="Y"}
{else}
{include file="buttons/edit_product_options.tpl" href="javascript:window.open('`$catalogs.customer`/popup_poptions.php?target=cart&id=`$products[product].cartid`','POptions','width=400,height=350,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');"}
{/if}
{/if}
</DIV>
</TD></TR>
<TR><TD colspan="2"><HR size="1" noshade></TD></TR>
{/if}
{/section}
</TABLE>
{if $active_modules.Gift_Certificates ne ""}
{include file="modules/Gift_Certificates/gc_cart.tpl" giftcerts_data=$cart.giftcerts}
{/if}
{include file="customer/main/cart_totals.tpl"}




{if $js_enabled}
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
<TR>
<TD>
{include file="buttons/update.tpl" type="input" href="javascript: document.cartform.submit()" js_to_href="Y"}
 
{include file="buttons/button.tpl" button_title=$lng.lbl_clear_cart href="cart.php?mode=clear_cart"}
</TD>
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/cart_checkout_buttons.tpl"}
{/if}
<TD align="right"><TABLE border="0" cellspacing="0" cellpadding="0" onclick="javascript: self.location='home.php'" style="cursor: pointer;" valign="middle">
<TR><TD>[img]/shop/skin1/images/but1.gif[/img]</TD>
<TD class="Button" valign="middle" nowrap><FONT class="Button"> Continue shopping </FONT></TD>
<TD>[img]/shop/skin1/images/but2.gif[/img]</TD></TR>
</TABLE>
<TD align="right">
{include file="buttons/button.tpl" button_title=$lng.lbl_checkout style="button"  href="cart.php?mode=checkout"}
</TD>
</TR>
</TABLE>
{else}
<INPUT type="hidden" name="mode" value="checkout">
{include file="submit_wo_js.tpl" value=$lng.lbl_checkout}
{/if}
</FORM>
{else}
{$lng.txt_your_shopping_cart_is_empty}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_items content=$smarty.capture.dialog extra="width=100%"}
{if $cart.coupon_discount eq 0 and $products ne ""}



{if $active_modules.Discount_Coupons ne ""}
{include file="modules/Discount_Coupons/add_coupon.tpl}
{/if}
{/if}


shipmerchant 12-11-2005 10:10 AM

So when you place the original cart.tpl "un modified" does the store work and display as it should? Did it work prior to trying out this mod?
If it did simply restore it to its orginal working state, then try to add the code as outlined again.

I know this mod has worked great for me in versions 4.10 up to 4.17. What version are you using?
Hope this helps :D

sean6869 12-11-2005 10:33 AM

yep
 
:) yea as soon as i replace with the backup version the viewcart works just fine. And i am using the newest version out.X-Cart Gold v4.0.17

I dont know what to do. If that file looked like it was edited right then i dont know what to do next.
thanks.

dchihorn 12-29-2005 08:39 PM

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!


First, thank you for providing this.

What file did you include that last bit of code?

xgarb 12-30-2005 01:26 AM

Quote:

What file did you include that last bit of code?

Do you mean where do I put the final line of code?
Whereever you want the button to appear. Somewhere in cart.tpl next to the checkout button I believe is one location.

dchihorn 12-30-2005 08:48 AM

yes, thank you that is what I meant. Only problem now is, I cant find cart.tpl I find a cart.php but not .tpl

markwhoo 12-30-2005 11:37 AM

Quote:

Originally Posted by dchihorn
yes, thank you that is what I meant. Only problem now is, I cant find cart.tpl I find a cart.php but not .tpl


It is in skin1/customer/main/cart.tpl

dchihorn 12-30-2005 08:42 PM

Thank you again, it is much appreciated your patience and continued responses. From all initial tests, it is working great.

JWait 01-03-2006 05:23 PM

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 :)

NightFire 02-01-2006 06:55 AM

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.

groovedis 03-03-2006 01:10 PM

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.

xgarb 03-05-2006 12:43 AM

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.

AKR 06-21-2006 03:11 PM

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

Dawn Howard 08-10-2006 10:24 AM

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!

elomibao 08-13-2006 08:05 PM

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

I'll update the continue shopping thing that doesn't require javascript (I hope).

mikalou 08-23-2006 05:45 AM

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.

burtsTechie 01-11-2007 07:51 AM

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?

burtsTechie 01-12-2007 01:54 PM

Re: Continue Shopping
 
I'm FUBARing my site every time I try to get this config.php file to accept this code. I've had comments from test users that returning to the cart/home page is frustrating, and frustrating = no sales.

I've done some searching and discovered that $HTTP_GET_VARS has been deprecated for $_GET...so I've replaced that in the following code:

Code:

<?php

x_session_register("last_cat");
x_session_register("last_productid");

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

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

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

?>


And it still gives me the blank page of death. :(

Is there some kind of compiling going on or am I placing this in the wrong section of config.php? Help, please!

ps - replying to myself is sad. really sad.

vaughan 01-24-2007 06:21 AM

Re: Continue Shopping
 
using xgards code I was getting the same result when I added the code to config.php

Working on a new 4.1.5 site and found that if put the code into init.php instead all was well (at least so far).

burtsTechie 01-31-2007 07:14 AM

Re: Continue Shopping
 
thanks vaughan! I finally had a chance to implement your suggestion and it seems to be working on 4.15. I appreciate the help!

Sisom 02-03-2007 02:28 PM

Re: Continue Shopping
 
Quote:

Originally Posted by mikalou
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.


I don't understand why you wouldn't want to have the "continue shopping" button appearing in that case - as the customer would want to see it (at least, I would). I don't see why they wouldn't want to be able to continue shopping just because they got to the cart page from the home page, using the 'View cart' link in minicart.

While we're on the subject of the 'continue shopping' button, has anybody else found Amazon's shopping cart to be a nightmare? Say I add one item to the cart and then click on the 'Checkout' button - the next page gives you no option other than to continue with the Checkout process, you can't add any other items to the cart without having to use the back button, there isn't even a link to the Amazon home page or any other Amazon pages on their Checkout page! (At least, this is what's been happening to me).

kmg126 02-04-2007 10:51 AM

Re: Continue Shopping
 
Quote:

Originally Posted by GM
TRY THIS...

1:) Create a new button file in /buttons called

continue_shopping.tpl that contains the following code:

Code:

{include file="buttons/button.tpl" button_title=$lng.lbl_continue_shop}

2:) In Admin go to "languages" edit languages and create a new

entry called "lbl_continue_shop" (without the quotes)

Now in cart.tpl or where ever you want the button to appear just add this

code:


DONE!

I've tried to do several of the "Continue Shopping" fixes in this thread and none are really working for me. The one that works best is the one above. Creates a great Continue Shopping button, I've placed it exactly where I want it on the Checkout page, but when clicked, I'm redirected exactly back to the same Checkout page.
Can anyone tell me where the problem lies in the code? I'd like it to redirect back to the category or the home page would be fine too.
Thanks,
Karen

Sisom 02-04-2007 12:44 PM

Re: Continue Shopping
 
All I can offer is the code that I have in my cart.tpl, bear in mind I have 4.1, but I don't think it should make any difference.

<td>
{include file="buttons/button.tpl" button_title=$lng.lbl_continue_shopping href="javascript: history.go(-1);" style="button" js_to_href="Y"}</td>

kmg126 02-04-2007 06:44 PM

Re: Continue Shopping
 
Thanks, that worked great!
Karen

grayloon 03-01-2007 11:07 AM

Re: Continue Shopping
 
I'm using the code below, but I'm having one little problem - the cart page always takes me back to the category and never to the product detail page. I replaced $HTTP_GET_VARS with $_GET and put that part in the init.php instead of config.php. Any ideas?

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!


supercanon 03-14-2007 12:21 PM

Re: Continue Shopping
 
Quote:

Originally Posted by vaughan
using xgards code I was getting the same result when I added the code to config.php

Working on a new 4.1.5 site and found that if put the code into init.php instead all was well (at least so far).




Hello, I tried adding the code to boh config.php and init.php and I got a blank page.

finally, I added the code to /include/sessions.php and it worked !

I am using version 4.1.6

This is a great modification, thank you


All times are GMT -8. The time now is 06:20 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.