View Single Post
  #2  
Old 05-12-2003, 01:41 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

heres the products.tpl with the add to cart etc. i usually make my own buttons for this so you may want to do the same. Just make new template files and drop them in the buttons folder

Code:
{* $Id: products.tpl,v 1.21.2.2 2003/03/11 10:49:14 svowl Exp $ *} {section name=product loop=$products} <table border=0 width=100% cellpadding="5" cellspacing="0"> <tr> <td width=90 align=center valign=top> <a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=70 product=$products[product].product}</a></td> <td valign=top> {$products[product].product}</font> <font size=1> {$products[product].descr|truncate:300:"...":true} </font> <hr size=1 noshade align=left> {if $active_modules.Subscriptions ne "" and $products[product].catalogprice} {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else} {if $products[product].price ne 0} {if $products[product].discount ne 0} <font class=MarketPrice>{$lng.lbl_market_price}: <s> {math equation="price/(1-(discount/100))" price=$products[product].price discount=$products[product].discount format="%d.00" assign=unformatted}{include file="currency.tpl" value=$unformatted} </s></font> {/if} <font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].discount ne 0}, save {$products[product].discount}%{/if}{if $config.General.use_vat eq "Y"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if} {else} <font class=ProductPrice>{$lng.lbl_enter_your_price}</font> {/if} {/if} </td> </tr> <tr> <td width=90 align=center valign=top></td> <td valign=top> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" width="50%"><a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="buttons/details.tpl"}</a></td> <form name=orderform_{%product.index%} method=post action="cart.php?mode=add"> <td align="left" width="50%"> <a href="javascript: document.orderform_{%product.index%}.submit()"> {include file="buttons/add_to_cart.tpl"}</a> <input type=hidden name=amount value=1> <input type=hidden name=mode value=add> <input type=hidden name=productid value="{$products[product].productid}"> <input type=hidden name=cat value="{$smarty.get.cat}"> <input type=hidden name=page value="{$smarty.get.page}"> </td></form> </tr> </table> </td> </tr> </table> {/section}


heres my modified cart.tpl with update / delete / go back / checkout etc

Code:
{* $Id: cart.tpl,v 1.45.2.1 2003/01/20 12:57:59 svowl Exp $ *} {include file="location.tpl" last_location=$lng.lbl_your_shopping_cart} <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 $products ne ""} <form action="cart.php" method=post name=cartform> <table border=0 width=100% cellpadding="0" cellspacing="5"> {section name=product loop=$products} <tr> <td width=100 valign=top> <a href="product.php?productid={$products[product].productid}">{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}</a> </td> <td valign=top> <font class=ProductTitle>{$products[product].product|escape}</font> {$products[product].descr|truncate:150:"...":true} {if $products[product].product_options ne ""} {$lng.lbl_selected_options}: {$products[product].product_options|replace:"\n":" \n"} {/if} <div align=left> {if $active_modules.Subscriptions ne "" and $products[product].catalogprice} {include file="modules/Subscriptions/subscription_priceincart.tpl"} {else} <font class=ProductPriceConverting>{include file="currency.tpl" value=$products[product].price} x <input type=text size=3 name="productindexes[{$smarty.section.product.index}]" value="{$products[product].amount}"> = </font><font class=ProductPrice>{math equation="price*amount" price=$products[product].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.General.use_vat eq "Y"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if} {/if} </div> </td> </tr> <tr> <td width=100 valign=top></td> <td valign=top> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td width="50%"><a href="cart.php?mode=delete&productindex={$smarty.section.product.index}">{include file="buttons/delete_item.tpl"}</a> </td> <td width="50%"><a href="javascript: document.cartform.submit()">{include file="buttons/update.tpl"}</a> </td> </tr> </table> </td> </tr> {/section} </table> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td> <hr size=1 noshade> </td> </tr> </table> {if $active_modules.Gift_Certificates ne ""} {include file="modules/Gift_Certificates/gc_cart.tpl"} {/if} <div align=right> {include file="customer/main/cart_totals.tpl"} </div> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td> <hr size=1 noshade> </td> </tr> </table> <table width="100%" border="0" cellspacing="5" cellpadding="0"> <tr> <td width="100"></td> <td>{include file="buttons/go_back.tpl"} </td> <td>{include file="buttons/checkout.tpl"} </td> </tr> </table> </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}

be sure to back things up first just in case
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote