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

标签 attributes magento2 configurable-product price

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

相关文章:

php - Magento 2 : I want to add ifconfig in override block xml

javascript - Magento 可配置产品下拉菜单 - 必须将 "Price Difference - +"更改为实际价格

c# - 使用泛型检索属性

javascript - 使用视频标签制作内部 html 的函数

javascript - 带有 HTML 的 jQuery html 属性?

magento2 - 如何在 Magento2 中的电子邮件模板中使用循环

magento - 非对象上的 getID()

javascript - 本地主机中 Magento 2.3.0 CE 上的空白管理页面

magento - 如何检查产品是否为简单产品

magento - key 'UNQ_CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRODUCT_ID_ATTRIBUTE_ID' 的完整性约束违规