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)
-   -   Display "Percent Saved" condition (https://forum.x-cart.com/showthread.php?t=13655)

golfguy 04-27-2005 08:42 AM

Display "Percent Saved" condition
 
Could someone point me to where it's determined whether or not to display "%n Saved"

I don't want to display % saved if the value is less than 10% (I think telling someone they saved 2% is silly)

I'm sure there is a check somewhere for "less than 1" because if Price = List Price the %n Saved does not display.

Bella Forma 04-27-2005 06:35 PM

Find this code in your skin1/customer/main/product.tpl file

Code:

{if $product.list_price gt 0 and $product.taxed_price lt $product.list_price}
<TABLE border="0" width="45">
<TR>
<TD width="45" height="45" class="SaveMoneyLabel" background="{$ImagesDir}/save_money.gif" align="center" valign="middle">


{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%d" assign=discount}
<SPAN id="save_percent">{ $discount }</SPAN>%
</TD></TR></TABLE>{/if}


And replace it with this:

Code:

{if $product.list_price gt 0 and $product.taxed_price lt $product.list_price}
  {math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%d" assign=discount}
  {if $discount >= 10}
    <TABLE border="0" width="45">
    <TR>
      <TD width="45" height="45" class="SaveMoneyLabel" background="{$ImagesDir}/save_money.gif" align="center" valign="middle">

      <SPAN id="save_percent">{ $discount }</SPAN>%</TD>
    </TR>
    </TABLE>
  {/if}
{/if}


This works for Version 4.0.12

golfguy 04-27-2005 07:03 PM

Hey thanks! It works like a charm!

Dorette 06-19-2005 11:56 PM

where in the admin can I ask it to calculate percentage savings or not.
i want to disable the percentage savings


All times are GMT -8. The time now is 05:27 PM.

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