我们有混合的产品,有些带有specialPrice,有些带有Catalog Rules.
我需要在我的前端显示所有产品的折扣%.
我们使用$ _product-> getSpecialPrice()来获得折扣价,但对于基于目录规则的价格的产品,这会失败.
是否可以根据目录规则或specialPrice获得折扣价?
小智 13
是的,你可以使用$_product->getFinalPrice().
以下是三种价格的差异:
$regularPrice = number_format($_product->getPrice(), 2);
$discountedPrice = number_format($_product->getFinalPrice(), 2);
$specialPrice = number_format($_product->getSpecialPrice(), 2);
Jev*_*nov 10
试试这个片段:这个将计算价格规则.
Mage::getModel('catalogrule/rule')->calcProductPriceRule($product,$product->getPrice());
Run Code Online (Sandbox Code Playgroud)
你正在寻找什么?
| 归档时间: |
|
| 查看次数: |
14875 次 |
| 最近记录: |