View Single Post
  #6  
Old 07-13-2005, 07:01 PM
 
torola torola is offline
 

Advanced Member
  
Join Date: Feb 2005
Location: Toronto, Canada
Posts: 54
 

Default Re: Show list price with slash and then price below it

Quote:
Originally Posted by instinctual
Ok, so if you'd like to show the list price with a slash, and the price below that - you can use this code in the 3.5.x branch - doesn't work yet in the 4.0.x branch.

Code:
{if $product.price ne 0} {if $product.list_price gt 0 and $product.price lt $product.list_price} {math equation="100-(price/lprice)*100" price=$product.price lprice=$product.list_price format="%d" assign=discount} <font class=MarketPrice><s> {include file="currency.tpl" value=$product.list_price} </s></font> {/if} {if $product.list_price eq ""} {/if} <font class=ProductPrice>{if $product.list_price gt 0 and $product.price lt $product.list_price}<font color=#FF0000>{/if}{if $product.list_price gt 0 and $product.price lt $product.list_price}{else} {/if} {if $product.list_price gt 0 and $product.price lt $product.list_price}{$lng.lbl_our_price}: {/if}{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.Taxes.use_vat eq "Y" and $product.vat gt "0"}, {$lng.lbl_including_vat} {$product.vat}%{/if} {else} <font class=ProductPrice>{$lng.lbl_enter_your_price}</font> {/if}

You want to put this starting at the first {if} you see above, and ending with the last {/if} after the "enter your price" variable - this one is for product.tpl.

Similarly, for the products.tpl - thumbnail page, you can use this:
Code:
{if $products[product].price ne 0} {if $products[product].list_price gt 0 and $products[product].price lt $products[product].list_price} {math equation="100-(price/lprice)*100" price=$products[product].price lprice=$products[product].list_price format="%d" assign=discount} <font class=MarketPrice>{$lng.lbl_market_price}: <s> {include file="currency.tpl" value=$products[product].list_price} </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].list_price gt 0 and $products[product].price lt $products[product].list_price}, save {$discount}%{/if}{if $config.Taxes.use_vat eq "Y" and $products[product].vat gt "0"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if} {else} <font class=ProductPrice>{$lng.lbl_enter_your_price}</font> {/if}
Cheers

Instinctual
Colorado
X-Cart Versions 3.5.x - 4.0.x


Does this mode work in v4.0.12?
__________________
Unix X-Cart PRO 4.0.12
Add-on: X-Affiliate
Reply With Quote