Skip to main content
 首页 » 编程设计

attributes之Magento 2 :How get price configurable in product list

2026年05月17日91me-sa

如何获得价格产品
用简单的产品:$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$

请您参考如下方法:

可配置产品没有任何常规价格或特价。
在前端,他们的子产品的价格被视为正常价格。