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)
-   -   Conditonal statement for market price (https://forum.x-cart.com/showthread.php?t=31604)

JediSam04 06-02-2007 05:17 PM

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 06-08-2007 03:06 PM

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. :-)


All times are GMT -8. The time now is 10:14 AM.

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