X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Product.tpl: How to add list price? (https://forum.x-cart.com/showthread.php?t=10140)

RichieRich 11-01-2004 02:38 AM

Product.tpl: How to add list price?
 
I would like to display what the customer saves (ie. you save бёx.xx) on the product.tpl page, as well as the product thumbnail... I have tried to do this myself, however I must be missing something, if anyone can help this would be great.

What I would like to appear on the product.tpl page is something along the lines of;

our price: бёx.xx (Б┌╛ x.xx)
list price: бёx.xx You save: бёx.00 (x%)

zenpig 11-12-2004 10:49 PM

If your still working on this I did this to a store today I've been 'tweaking' a bit. Hoped to easily find the answer here but no go and had to think a bit..bummer :)

anyway, you can just about pull most of what you need out of products.tpl and then remove the array portion of the code and remember you are working with $product in product.tpl and not $products as it is in products.tpl. So, this $products[product].taxed_price would change to $product.taxed_price.

Here's what I've got so far which would probably work for you though I'm further customizing it.
Quote:

{if $product.taxed_price ne 0 || $variants ne ''}
{if $product.list_price gt 0 and $product.taxed_price lt $product.list_price}
<FONT class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$product.taxed_price}</FONT>


{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%d" assign=discount}
{math equation="(lprice-price)" price=$product.taxed_price lprice=$product.list_price format="%.2f" assign=rdiscount}
{if $discount gt 0}
<FONT class="MarketPrice">{$lng.lbl_market_price}:
{include file="currency.tpl" value=$product.list_price}
</FONT>

{/if}
{/if}
<FONT class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}{if $discount gt 0}{$lng.lbl_save_price} ${$rdiscount}({$discount}%)</FONT>{/if}
{/if}


RichieRich 11-29-2004 05:26 AM

thanks, this works well, however if there is no list price defined, a price wont display at all... only the alternate currency is displaying... is there a work-around to show the normal "our price: $xx" if no list price is defined?


All times are GMT -8. The time now is 06:12 PM.

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