VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Joseph111 on March 05, 2013, 08:45:27 AM

Title: Different discount for each product
Post by: Joseph111 on March 05, 2013, 08:45:27 AM
I want to set a different discount for each product;
in this regard in the product sheet, I used the resale price - no calculation rule

in the  Browse page page(Components\com_virtuemart\views\category\templ\default.php)  I have inserted the code:

if ($this->product->prices['discountAmount'] > 0){
      echo "<span class='PricebasePriceWithTax'>".$this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices)."</span>";
         echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
               }else
               
               {
                  echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
                  }


but it does not work the first part of the IF statement

the condition : if ($this->product->prices['discountAmount'] > 0)   does not work


virtuemart always shows two prices stroke one and the other normal even when there is no discount!!

Title: Re: Different discount for each product
Post by: Joseph111 on March 12, 2013, 17:10:10 PM
nobody can give me a hand ??
Title: Re: Different discount for each product
Post by: Milbo on March 12, 2013, 22:51:52 PM
Why do you not use teh override price option, which is exactly for that