0

We want to load the product price excluding tax inside the invoice email. Therefore we copied the default file to: /app/design/frontend/theme/theme/Magento_Sales/templates/email/items/invoice/default.phtml

Our tax setting for "Catalog Prices" is set to "Including Tax".

And we tried a lot, but at the moment the price is display including tax with:

<?php echo $this->helper('Magento\Framework\Pricing\Helper\Data')->currency($_item->getPrice(), true, false);?>

How can we get the price excluding tax?

1 Answer 1

0

In \Magento\Sales\Api\Data\OrderItemInterface

You have getTaxAmount()

What if you instead try:

<?php echo $this->helper('Magento\Framework\Pricing\Helper\Data')->currency($_item->getPrice()-$_item->getTaxAmount(), true, false);?>
4
  • Thanks Kristoffer, but that does not work. We get a total wrong value in that case.
    – JGeer
    Oct 21, 2020 at 9:49
  • If you use only getTaxAmount, do u get the correct tax amount?
    – Kristoffer
    Oct 21, 2020 at 9:57
  • It can be that you have to divide getTaxAmount with the quantity in cart before you substract
    – Kristoffer
    Oct 21, 2020 at 10:23
  • Thanks! Will try that.
    – JGeer
    Oct 21, 2020 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.