# Magento 2 How to check Price Type?

File location

<magento dir>vendormagentomodule-directoryModelCurrency.php


In Magento we have “finalPrice” & “oldPrice”

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

$priceCurrencyObject =$_objectManager->get('MagentoFrameworkPricingPriceCurrencyInterface');


Not sure

Magento Asked by Jackson on October 21, 2020

My Solution is: In the Magento_Catalogtemplatesproductpriceamountdefault.phtml , use $block->getPrice()->getPriceCode() to get the price type string. Or any function you can find which return object implements the MagentoFrameworkPricingPricePriceInterface, you can call the getPriceCode() to get the price type. Or if you have the product object, just call$product->getPriceInfo()->getPrice()->getPriceCode();

Answered by Yue Wang on October 21, 2020