1

The price of my configurable product shows the price including tax like it's set in the backend. But next to it I want to display the price excluding tax. Is this possible? Because the block only holds Magento\ConfigurableProduct\Pricing\Price\FinalPrice.

Magento_Catalog/templates/product/price/amount/default.phtml

<?php /** @var \Magento\Framework\Pricing\Render\Amount $block */ ?>

<span class="price-container <?php /* @escapeNotVerified */ echo $block->getAdjustmentCssClasses() ?>"
        <?php echo $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
    <?php if ($block->getDisplayLabel()): ?>
        <span class="price-label"><?php /* @escapeNotVerified */ echo $block->getDisplayLabel(); ?></span>
    <?php endif; ?>
    <span <?php if ($block->getPriceId()): ?> id="<?php /* @escapeNotVerified */ echo $block->getPriceId() ?>"<?php endif;?>
        <?php echo($block->getPriceDisplayLabel()) ? 'data-label="' . $block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes() . '"' : '' ?>
        data-price-amount="<?php /* @escapeNotVerified */ echo $block->getDisplayValue(); ?>"
        data-price-type="<?php /* @escapeNotVerified */ echo $block->getPriceType(); ?>"
        class="price-wrapper <?php /* @escapeNotVerified */ echo $block->getPriceWrapperCss(); ?>"
        <?php echo $block->getSchema() ? ' itemprop="price"' : '' ?>>
        <?php /* @escapeNotVerified */ echo $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()) ?>
    </span>
    <?php if ($block->hasAdjustmentsHtml()): ?>
        <?php echo $block->getAdjustmentsHtml() ?>
    <?php endif; ?>
    <?php if ($block->getSchema()): ?>
        <meta itemprop="priceCurrency" content="<?php /* @escapeNotVerified */ echo $block->getDisplayCurrencyCode()?>" />
    <?php endif; ?>
</span>
0

Go to Stores -> Configuration -> Sales -> Tax -> Price Display Settings and change Display Product Prices In Catalog to Including and Excluding Tax. Your product prices should appear incl/exlc tax.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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