Hello,
i have a little problem. I want to show the discount amount of a product, but WITH tax.
As you can see here, the discount amount is 10%, but actually, it is without tax. I want to show the amount WITH tax.
https://lampedesign.ch/index.php/manufacturer/baltensweiler
The code i have is only without tax and i cant figure out how make it work with tax.
Any idea ?
VM 3.6.10 10211
Joomla 3.9.18
it will be the same %age
QuoteThe code i have is only without tax and i cant figure out how make it work with tax.
My crystal ball is broken !
It depends on what you have set for discount rules and what you show on a product to the customer
Hello,
the code i use is :
<?php
if(!(isset($currency))){
$currency = CurrencyDisplay::getInstance ();
}
echo $currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);
?>
I use discount rules : price modification before tax by product, 10%.
Perhaps it is possible to add in the code a calculate code that make the discount amount + 7.7% ?
And here is a screenshot with the prices used.
1'572.40 - 10% = 1'415.20
10% = 157.24
Here, it is 146.-
My tax is 7.7% so you make 146 + 7.7% = 157.24
<?php
if(!(isset($currency))){
$currency = CurrencyDisplay::getInstance ();
}
$dis = $product->prices['discountAmount'] *1.077;
echo '<span class="price-crossed">'.$currency->getFormattedCurrency ($dis, 2).'</span>';
?>
or get the tax rate programatically
Hello, thank you it work like this :)
Sorry for late response, but i did not receive the email alerte anytime with this forum... I dont know why.
Thanks again !