View Single Post
  #21  
Old 11-07-2003, 11:38 PM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default

OK, I got the list price to show but still not the discount. only shows -%

Heres the code I have

Code:
{* $Id: products.tpl,v 1.22 2002/11/13 07:17:54 alfiya Exp $ *} {section name=cat_num loop=$products} { if %cat_num.first% } <table border=0> <tr class=TableHead> <td>ID</td> <td>Product</td> {if $usertype eq "A" or $active_modules.Simple_Mode ne ""} <TD>Pos.</TD> {/if} <TD>Quantity</TD> <td colspan=2>List price</td> <td nowrap>Your price</td> </tr> {/if} <tr> {* START COLOR CODE MOD *} <td width=1% {include file="main/products_colors.tpl"}>#{$products[cat_num].productid}</td> <td width=99% {include file="main/products_colors.tpl"}> <input type=radio name=productid value="{ $products[cat_num].productid }" { if %cat_num.first% }checked{/if}> <a href="product_modify.php?productid={ $products[cat_num].productid }"> <font class=ItemsList>{ $products[cat_num].product|escape|truncate:35:"...":false}</font> </a> </td> {if $usertype eq "A" or $active_modules.Simple_Mode ne ""} <TD nowrap align=right {include file="main/products_colors.tpl"}><INPUT type=text size=4 maxlength=4 value="{$products[cat_num].orderby}" name="product_orderby[{$products[cat_num].productid}]"></TD> {/if} <TD nowrap align=right {include file="main/products_colors.tpl"}><INPUT type=text size=6 maxlength=6 value="{$products[cat_num].avail}" name="product_avail[{$products[cat_num].productid}]"></TD> <td nowrap align=right {include file="main/products_colors.tpl"}> {if $products[cat_num].list_price gt 0} {math equation="100-(price/lprice)*100" price=$products[cat_num].price lprice=$products[cat_num].list_price format="%d" assign=discount} <font class=ProductPriceConverting>{include file="currency.tpl" value=$products[cat_num].list_price}</font> {else} <font class=ProductPriceConverting>{include file="currency.tpl" value=$products[cat_num].price}</font> {/if} </td> <td nowrap align=right {include file="main/products_colors.tpl"}> <font class=AdvancedDiscount> -{$products[cat_num].discount}%</font> </td> <td nowrap align=right {include file="main/products_colors.tpl"}> {* END COLOR CODE MOD *} <input type="text" size="7" value="{$products[cat_num].price}" name="product_price[{$products[cat_num].productid}]"> </td> </tr> { if %cat_num.last% } </table> {/if} {/section}

This is what I actually changed (or added) in the code supplied for this mod:

Code:
{if $products[cat_num].list_price gt 0} {math equation="100-(price/lprice)*100" price=$products[cat_num].price lprice=$products[cat_num].list_price format="%d" assign=discount} <font class=ProductPriceConverting>{include file="currency.tpl" value=$products[cat_num].list_price}</font> {else} <font class=ProductPriceConverting>{include file="currency.tpl" value=$products[cat_num].price}</font> {/if}

Again, thanks in advance!
Reply With Quote