I try to insert striked sales price or discount amount shown only when exist. But i don't know how show this values only when discount is active. I was try:
if ($this->currency->createPriceDiv('discountAmount','',$product->prices)) {........................}
Why this condition always is TRUE? Although the value equals ""?
How to get value of discount without curency?
Did you get this answer? I have the same problem.
Thanks
Stephen
http://ideasoftmalta.com
No, but I found own solution. Not so clean, but working.
I put this:
$testowa = strlen( $this->currency->createPriceDiv('discountAmount','COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT',$product->prices));
//if ($this->currency->createPriceDiv('discountAmount','COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT',$product->prices)) {
if ($testowa > 107 ) {
echo '<s>',$this->currency->createPriceDiv('basePriceWithTax','',$product->prices),'</s>';
}
I don't have idea how to get pure value of "discountAmount", so I used a this "stupid" solution.
Value "107" could be different for your currency. You need to set this experimentally.
WHere i have to set the value 107?