Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Product.tpl: How to add list price?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-01-2004, 02:38 AM
  RichieRich's Avatar 
RichieRich RichieRich is offline
 

X-Adept
  
Join Date: Sep 2004
Location: London, England
Posts: 750
 

Default 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%)
__________________
Richard


Ultimate 5.4 testing
Reply With Quote
  #2  
Old 11-12-2004, 10:49 PM
 
zenpig zenpig is offline
 

Member
  
Join Date: Nov 2004
Posts: 19
 

Default

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}
__________________
Xcart 4.6.5 gold
Apache 2.2.29
PHP 5.4.34
MySQL 5.6.17
Reply With Quote
  #3  
Old 11-29-2004, 05:26 AM
  RichieRich's Avatar 
RichieRich RichieRich is offline
 

X-Adept
  
Join Date: Sep 2004
Location: London, England
Posts: 750
 

Default

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?
__________________
Richard


Ultimate 5.4 testing
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:12 AM.

   

 
X-Cart forums © 2001-2020