1

I would like to show product price in both base currency & display currency. I have already enable display currency in frontend - that is i can see "USD / EUR" in header dropdown.

If i want to show 2 price, one in base currency, one in display currency at the same time, what should be the correct way?

Basic currency in the store, USD. Frontend currency displayed in EUR, I just need to add to the current price, the original price (USD).

I tried to change final_price.html

/vendor/magento/module-catalog/view/base/templates/product/price/final_price.html

This part of the code

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

But I get only the displayed price (EUR) or empty space without any errors.

I can get the main price (USD) using this code,

<?php if ($priceAmount = $block->getProduct()->getFinalPrice()):?>
    <span> / $ <?= /* @escapeNotVerified */ $priceAmount ?> </span>
<?php endif;?>

But only in atribute.phtml

/vendor/magento/module-catalog/view/frontend/templates/product/view/atribute.html

Now: https://i.imgur.com/Fv3FIJA.png

I would like to display: https://i.imgur.com/2UgIdXI.png

Magento 2.2.4

Your Answer

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

Browse other questions tagged or ask your own question.