VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: jack19 on October 09, 2012, 18:16:54 PM

Title: Hide discount if = 0
Post by: jack19 on October 09, 2012, 18:16:54 PM
Hello,
how can I hide the discount if it is zero?
----------------------

I found this solution
I had to take the opposite approach: show the discount if greater than zero.
if ($product->prices['discountAmount'] > 0.001) { echo $this->currency->createPriceDiv('discountAmount','COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT',$product->prices); }
In category tmpl (default.php)  and default_products.php
Title: Re: Hide discount if = 0
Post by: huegel-huepfer on October 19, 2012, 21:14:59 PM
very helpful - thanks a lot!
Title: Re: Hide discount if = 0
Post by: bytelord on October 19, 2012, 21:19:27 PM
Hello,

Take a look on that post also: http://forum.virtuemart.net/index.php?topic=108865.msg364872#msg364872
Title: Re: Hide discount if = 0
Post by: jack19 on October 22, 2012, 17:15:09 PM
Quote from: bytelord on October 19, 2012, 21:19:27 PM
Hello,

Take a look on that post also: http://forum.virtuemart.net/index.php?topic=108865.msg364872#msg364872
Hi,
yes. They work all three solutions.
:P