如何获得价格产品
用简单的产品:$oldPrice= $_product->getPrice();
$newPrice= $_product->getSpecialPrice();
它返回正确的结果
使用可配置产品:$oldPrice= $_product->getPrice(); //return Null
$newPrice= $_product->getSpecialPrice(); // return Null
我有 1 个可配置产品和 2 个简单产品
TestCon1
简单 1:价格 120 美元。特价:100$
simple2:价格 120 美元。特价:90$
我需要获得可配置返回的价格:TestCon1 价格 120 美元。特价:90 美元。
我用 $oldpriceConf= $_product->getFinalPrice(); // retunr 100$
最佳答案
可配置产品没有任何常规价格或特价。
在前端,他们的子产品的价格被视为正常价格。
关于attributes - Magento 2 :How get price configurable in product list,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36855060/