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

Add View Cart and Checkout buttons to product.tpl (X-Cart 4.1.3)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 10-20-2006, 08:17 AM
  ShishaPipeUK's Avatar 
ShishaPipeUK ShishaPipeUK is offline
 

Senior Member
  
Join Date: Jul 2005
Location: London, England.
Posts: 118
 

Smile Add View Cart and Checkout buttons to product.tpl (X-Cart 4.1.3)

Mod for 4.1.3 X-cart version

I wanted my customer to be able to easily see the View Cart and Checkout button on the main product page where you have the add to cart and if the module is enabled the add to wish list. I do not have the "Redirect customer to cart:" option ticked in the general settings, as my customers don't like to have to press the continue to shop button once directed. My customers want to view the cart when they ask for it, not to be automatically redirected once they select a product.

You can see this mod at: http://www.theshisha.com/shopcart/product.php?productid=16324&cat=293&page=1

It▓s a simple mod, and below is the modification.

Edit the file at your_shopcart_directory/skin1/customer/main/product.tpl file

Find the below code from your_shopcart_directory/skin1/customer/main/product.tpl file:

{if $product.forsale ne "B"}
<table cellspacing="0" cellpadding="0">
<tr>
<td>{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;</td>
<td>
{if ($login ne "" || $config.Wishlist.add2wl_unlogged_user eq 'Y') && $active_modules.Wishlist ne ""}
{include file="customer/add2wl.tpl"}
{/if}
</td>
</tr>
</table>
{else}
{$lng.txt_pconf_product_is_bundled}
{/if}

And replace it with this code:

{if $product.forsale ne "B"}
<table cellspacing="0" cellpadding="0">
<tr>
<td>{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;</td>
<td>{if ($login ne "" || $config.Wishlist.add2wl_unlogged_user eq 'Y') && $active_modules.Wishlist ne ""}{include file="customer/add2wl.tpl"}{/if}</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;</td>
<td>{include file="buttons/view_cart.tpl" style="button" href="cart.php"}</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;</td>
<td>{include file="buttons/checkout.tpl" style="button" href="cart.php?mode=checkout"}</td>
</tr>
</table>
{else}
{$lng.txt_pconf_product_is_bundled}
{/if}

You can see from the below code the extra code to the above product.tpl file:

<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;</td>
<td>{include file="buttons/view_cart.tpl" style="button" href="cart.php"}</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;</td>
<td>{include file="buttons/checkout.tpl" style="button" href="cart.php?mode=checkout"}</td>

Now you need to make two button files and they are view_cart.tpl and checkout.tpl which need to be saved in your_shopcart_directory/skin1/buttons/

The first button at your_shopcart_directory/skin1/buttons/view_cart.tpl

{include file="buttons/button.tpl" button_title=$lng.lbl_view_cart href=$href title=$title style=$style}

The second button at your_shopcart_directory/skin1/buttons/checkout.tpl

{include file="buttons/button.tpl" button_title=$lng.lbl_checkout href=$href title=$title style=$style}

Thats it a nice simple custom addon to the x-cart product.tpl file that makes it easier for the customer to view the cart and checkout when they want too if you do not select the "Redirect customer to cart:" option in the admin general settings.

Yes i know near the login you have the small view cart and checkout, but some customers dont see this, where they see the product that they want
Attached Thumbnails
Click image for larger version

Name:	cartbuttons.jpg
Views:	145
Size:	7.7 KB
ID:	131  
__________________
Apache/2.0.55 (Red Hat) & MYSQL Server: 5.0.24
PERL: 5.008005 / PHP: 4.4.4 - 4.3.1 X-CART

Shop carts at
http://www.nightscene.co.uk/shop/home.php
http://www.theshisha.net/shopcart/home.php
http://www.system-maintenance.com/maint/home.php
http://www.tabac4u.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:23 PM.

   

 
X-Cart forums © 2001-2020