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)
-   -   Add View Cart and Checkout buttons to product.tpl (X-Cart 4.1.3) (https://forum.x-cart.com/showthread.php?t=25968)

ShishaPipeUK 10-20-2006 08:17 AM

Add View Cart and Checkout buttons to product.tpl (X-Cart 4.1.3)
 
1 Attachment(s)
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 :)


All times are GMT -8. The time now is 06:22 AM.

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