0

I am trying to display the product prices including and excluding the tax. I have added the below snippet of code in /Magento_Catalog/templates/product/price/final_price.phtml:

<?php /* @escapeNotVerified */ echo $block->renderAmount($finalPriceModel->getBaseAmount(), [
    'price_id'          => $block->getPriceId('price-excluding-tax-' . $idSuffix),
    'price_type'        => 'basePrice',
    'include_container' => true,
    'schema' => $schema
]); ?>

This adds the excluded price to a configurable product when (for example) the size is chosen. Before that, when nothing is chosen, the excluding tax price is shown including the tax. It is the same issue for the simple products, they are all displayed with both prices including tax. What I want is for the price excluding tax to always be displayed without tax.

Any help with this would be very much appreciated!

Ellinor
  • 323
  • 3
  • 14

1 Answers1

0

I used this code in the price templates (in my case final_price.phtml):

<div class="price-exc">
<?php
echo $priceHelper->currency($finalPriceModel->getAmount()->getValue(\Magento\Tax\Pricing\Adjustment::ADJUSTMENT_CODE), true, false);
?>
<?php /* @escapeNotVerified */ echo __('exc. VAT') ?>