AnswerBun.com

Magento 2 How to check Price Type?

Magento Asked by Jackson on October 21, 2020

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

One Answer

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();

Hoping it's helpful to you.

Answered by Yue Wang on October 21, 2020

Add your own answers!

Related Questions

Magento 2: Requested store is not found in product

2  Asked on January 3, 2021 by cesarchris710

   

Slow Admin Orders Grid – Magento 2.3.3 Community

0  Asked on January 2, 2021 by alex-heaton

     

Sorting a custom column – Customer Grid

2  Asked on December 31, 2020 by kiwistastegood

       

Mobile-friendly test: Couldn’t load 36 page resources?

1  Asked on December 31, 2020 by vinod-kumar

   

Magento 2 get Admin session in frontend

1  Asked on December 29, 2020 by ramesh

     

Whitespace before SOAP declaration

3  Asked on December 29, 2020 by boruch

     

display magento2 menu based on the customer login

0  Asked on December 29, 2020 by venkata-prasad

       

Override a controller in magento 1.9

0  Asked on December 29, 2020 by mahesh1343

 

Move block after price using layout xml in M1.9

0  Asked on December 27, 2020 by sam-provides

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir