Virtuemart discount amount WITH tax

frederic11
132 Posts
frederic11 posted this 4 weeks ago

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.

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.
Vote to pay developers attention to this features or issue.
2 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 2 weeks ago

Hello,

Unfortunately there is no ready code for this. As a possible trick we can recommend to play with calculation rules and make the needed amount appear - if possible. Also there can be some codes on Virtuemart forums or some ideas to create a code by analogy.

Sincerely,
Nettie

Hello, Unfortunately there is no ready code for this. As a possible trick we can recommend to play with calculation rules and make the needed amount appear - if possible. Also there can be some codes on Virtuemart forums or some ideas to create a code by analogy. Sincerely, Nettie
frederic11
132 Posts
frederic11 posted this 1 weeks ago

Hello,
ok, i saw with Virtuemart forum, and have a solution, this is the code i have to put :

<?php
if(!(isset($currency))){
$currency = CurrencyDisplay::getInstance ();
}
$dis = $product->prices['discountAmount'] *1.077;
echo '<span class="price-crossed">'.$currency->getFormattedCurrency ($dis, 2).'</span>';
?>

In my case, the tax is 7.7%, so have to change the calcul x1.077 depending of the tax you have.

Regards

Hello, ok, i saw with Virtuemart forum, and have a solution, this is the code i have to put : <?php if(!(isset($currency))){ $currency = CurrencyDisplay::getInstance (); } $dis = $product->prices['discountAmount'] *1.077; echo '<span class="price-crossed">'.$currency->getFormattedCurrency ($dis, 2).'</span>'; ?> In my case, the tax is 7.7%, so have to change the calcul x1.077 depending of the tax you have. Regards
You must log in or register to leave comments