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)

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


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

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