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

Conditonal statement for market price

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-02-2007, 05:17 PM
 
JediSam04 JediSam04 is offline
 

Advanced Member
  
Join Date: Sep 2004
Location: Columbia, SC
Posts: 43
 

Default Conditonal statement for market price

Hello, I recently upgraded to 4.1.7. On product.tpl if the market price is $0.00 it shows up, but I want it hidden. I don't want to completely get ride of the market price. I just want it conditional, if the price is 0 don't show market price. Can someone tell me know to do this?

Also, when I was using version 4.0.12 I used the conditional statement below (I think that's the one) for the discount percentage, but it no longer works. Any ideas on how it make the percentage only show up when the discount is greater than 24?

{if $discount gt 24}, {$lng.lbl_save_price} {$discount}%{/if}

If you guys need me to post the code for product.tpl I will.

Thank you for your help.
__________________
JediSam04
Version 4.1.11
X-AOM 4.1.10
PHP 5.2.6
MySQL 5.0.51a-community
Hosting by EWDHosting
DSEFU, Feed Manager, Custom mods
Reply With Quote
  #2  
Old 06-08-2007, 03:06 PM
 
JediSam04 JediSam04 is offline
 

Advanced Member
  
Join Date: Sep 2004
Location: Columbia, SC
Posts: 43
 

Default Re: Conditonal statement for market price

Well, I managed to solve my problem. For those of you interested, here's what I did.

On Product.tpl to make the "Market Price" disappear if it is less than "Our Price"

Find this:
Code:
<font class="MarketPrice">{$lng.lbl_market_price}: </font></td><td> <font class="MarketPrice"><s>{include file="currency.tpl" value=$product.list_price plain_text_message=true}</s></font></tr></td>

Change it to:
Code:
{if $product.list_price gt 0 and $product.taxed_price lt $product.list_price} <font class="MarketPrice">{$lng.lbl_market_price}: </font></td><td> <font class="MarketPrice"><s>{include file="currency.tpl" value=$product.list_price plain_text_message=true}</s></font></tr></td> {/if}{/if}

Now to make the discount disappear if the percentage is less than 10.

In products_t.tpl find:
Code:
<font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price} </font>{if $discount gt 0}{if $config.General.alter_currency_symbol ne ""},{/if} {$lng.lbl_save_price} {$discount}%{/if} {if $products[product].taxes}<br />

Change the 0 in {if $discount gt 0} to 10 or whatever percentage you want.

I hope some of you will find this useful.
__________________
JediSam04
Version 4.1.11
X-AOM 4.1.10
PHP 5.2.6
MySQL 5.0.51a-community
Hosting by EWDHosting
DSEFU, Feed Manager, Custom mods
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 10:55 AM.

   

 
X-Cart forums © 2001-2020