News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Sales Price or discount amount shown only if exist.

Started by Enter_PL, January 24, 2012, 10:36:27 AM

Previous topic - Next topic

Enter_PL


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?
Pozdrowienia dla wszystkich :)

www.reklama.studiodomanscy.pl

stephensaid


Enter_PL

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.
Pozdrowienia dla wszystkich :)

www.reklama.studiodomanscy.pl

Stamos