View Single Post
  #7  
Old 01-06-2004, 11:06 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

This is an example of product.tpl from a 3.3 version shop just to show you where the code went. I have commented the code for you:



Code:
{* $Id: product.tpl,v 1.59.2.2 2003/01/23 14:37:23 basil Exp $ *} {literal} <SCRIPT language=JavaScript1.2> <!-- function product_option(name_of_option) { {/literal} for(i=0; i<{php}echo count($product_options) {/php}; i++) if (document.orderform[i].name.search(name_of_option) != -1) return document.orderform[i]; return -1; {literal} } function FormValidation() { {/literal} {if $javascript_code} {$javascript_code} {else} return true; {/if} {literal} } --> </SCRIPT> {/literal} { include file="location.tpl" } {capture name=dialog} <table border=0 width=100%> <form name=orderform method=post action="cart.php?mode=add"> <tr> <td valign=top align=left rowspan=2 width=100> {include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product} </td> <td valign=top> <span class=> {if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{/if} </span> <table width=100% cellpadding=0 cellspacing=0 border=0> <tr><td colspan=2><font class=ProductDetailsTitle>{$lng.lbl_details}</font></td></tr> <tr><td class=Line height="1" colspan=2>[img]{$ImagesDir}/orangespacer.gif[/img]</td></tr> <tr><td colspan=2></td></tr> {if $config.General.show_in_stock eq "Y" and $product.distribution eq ""} <tr><td width=30%>{$lng.lbl_quantity}</td><td nowrap>{if $product.avail gt 0}{$product.avail}{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</td></tr> {/if} {if $product.weight ne "0.00"}<tr><td width=30%>{$lng.lbl_weight}</td><td nowrap>{$product.weight} {$config.General.weight_symbol}</td></tr>{/if} {* funkydunk - removed so that can show the product.param00 buy now button if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} {/if end of removed extra fields *} {if $active_modules.Subscriptions ne "" and $subscription} {include file="modules/Subscriptions/subscription_info.tpl"} {else} {if $product.discount ne 0} <tr> <td class=MarketPrice>{$lng.lbl_market_price}: </td> <td><s> {math equation="price+discount" price=$product.price discount=$product.discount format="%.2f" assign=unformatted}{include file="currency.tpl" value=$unformatted} </s> </td> </tr> {/if} <tr><td class=ProductPriceConverting>{$lng.lbl_price}:</td> <td> {if $product.price ne 0} <font class=ProductDetailsTitle>{include file="currency.tpl" value=$product.price}</font><font class=MarketPrice> {include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.price}</font>{if $config.General.use_vat eq "Y"}, {$lng.lbl_including_vat} {$product.vat}%{/if} {else} <input type=text size=7 name=price> {/if} </td> </tr> {/if} </table> {* funkydunk - start of show if this is an in house product *} {if $product.param00 eq ""} <table border=0 width=100% cellpadding=0 cellspacing=0> <tr><td colspan=2></td></tr> {if $active_modules.Product_Options ne ""} { include file="modules/Product_Options/customer_options.tpl"} {/if} <tr><td height=25 width=30%>{$lng.lbl_quantity}{if $product.min_amount gt 1} <FONT class=ProductDetailsTitle>{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</td> <td> {if $config.General.show_in_stock eq "Y" and ($product.avail le 0 or $product.avail lt $product.min_amount)} {$lng.txt_out_of_stock} {else} {if $config.General.show_in_stock ne "Y"} {assign var="mq" value=$config.General.max_select_quantity} {else} {math equation="min(maxquantity+minamount, productquantity)+1" assign="mq" maxquantity=$config.General.max_select_quantity minamount=$product.min_amount productquantity=$product.avail} {/if} {if $product.distribution eq ""} <select name=amount> {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/if} {section name=quantity loop=$mq start=$start_quantity} <option value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</option> {/section} </select> {else} <font class=ProductDetailsTitle>1</font><input type=hidden name=amount value=1> {$lng.txt_product_downloadable} {/if} {/if} </td></tr> <tr><td colspan=2> <input type=hidden name=mode value=add> {if $config.General.show_in_stock ne "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)} {include file="customer/main/product_prices.tpl"} {include file="buttons/add_to_cart.tpl"} {if $login ne "" and $active_modules.Wishlist ne ""} {include file="customer/add2wl.tpl"} {/if} {/if} </td> </tr></table> {* funkydunk - end of in house product *} {else} {* funkydunk - start of external product *} <table border=0 width=100% cellpadding=0 cellspacing=0> <tr><td colspan=2></td></tr> <tr><td colspan=2> {include file="buttons/order_now.tpl"} </td></tr> </table> {/if} {* end of external product *} </td> <input type=hidden name=productid value="{$product.productid}"> <input type=hidden name=cat value="{$smarty.get.cat}"> <input type=hidden name=page value="{$smarty.get.page}"> </form> </table> {/capture} {include file="dialog.tpl" title=$product.product content=$smarty.capture.dialog extra="width=100%"} {if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images.tpl" } {/if} {if $active_modules.Upselling_Products ne ""} {include file="modules/Upselling_Products/related_products.tpl" } {/if} {if $active_modules.Recommended_Products ne ""} {include file="modules/Recommended_Products/recommends.tpl" } {/if} {if $active_modules.Customer_Reviews ne ""} {include file="modules/Customer_Reviews/vote_reviews.tpl" } {/if}
__________________
ex x-cart guru
Reply With Quote