Hello there.
I think title says it all.
How to add discount price to virtuemart products module?
I tried several stuff, with no result
Virtuemart: 2.6.10, joomla 2.5.x
All prices can be displayed in the VM default products module. If you are using a third party module or commercial template/theme then you should compare the code with the default module template. Or ask the template developer.
Ok i added a custom code that first compares basePrice and SalesPrice and if not equal, then i calculate discount in a variable as percentage and echo. Here is this code:
$base = $product->prices['basePrice'];
$sale = $product->prices['salesPrice'];
$discount = abs($base - $sale);
$discountPercent = round((100*$discount)/$base,0);
if($discountPercent > 0){
?>
<div style="width:70px;">
<div class="PricediscountAmount">
<?php
echo '<span class="PricediscountAmount">'.$discountPercent.''.'</span>';
?>
</div>
</div>