Magento 2:How get price configurable in product list

Shadow picture Shadow · Apr 26, 2016 · Viewed 7.8k times · Source

How can get price product

With simple product: $oldPrice= $_product->getPrice(); $newPrice= $_product->getSpecialPrice(); it returns the right results With configuable product: $oldPrice= $_product->getPrice(); //return Null $newPrice= $_product->getSpecialPrice(); // return Null I have 1 configuable product and 2 simple products TestCon1 Simple1: Price 120$. Special price: 100$ simple2: Price 120$. Special price: 90$

I need get price of configuable return: TestCon1 Price 120$. Special price: 90$.

i use $oldpriceConf= $_product->getFinalPrice(); // retunr 100$

Answer

VIPIN A ROY picture VIPIN A ROY · Apr 26, 2016

Configurable products don't have any regular price or special price. On front end the price of their child product is taken as their regular price.