File location

<magento dir>\vendor\magento\module-directory\Model\Currency.php

In Magento we have "finalPrice" & "oldPrice"

Can anybody tell me how to check Price Type? Can we use

$priceCurrencyObject = $_objectManager->get('Magento\Framework\Pricing\PriceCurrencyInterface');

Not sure


My Solution is: In the \Magento_Catalog\templates\product\price\amount\default.phtml , use $block->getPrice()->getPriceCode() to get the price type string.

Or any function you can find which return object implements the \Magento\Framework\Pricing\Price\PriceInterface, you can call the getPriceCode() to get the price type.

Or if you have the product object, just call $product->getPriceInfo()->getPrice()->getPriceCode();

Hoping it's helpful to you.

| improve this answer | |

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.