当价格设置为动态(不含特价-何时设置)时,如何获取捆绑产品原价?
我试着这样做:
<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol().number_format($_product->getPrice(),2) ?>但它只适用于固定价格,如果价格是动态的,则显示0.00
最好是既适用于固定价格又适用于动态价格的方法
发布于 2013-12-11 21:59:35
请参阅app/design/frontend/base/default/template/bundle/catalog/product/price.phtml
$_product = $this->getProduct();
$_priceModel = $_product->getPriceModel();
list($_minimalPriceTax, $_maximalPriceTax) = $_priceModel->getTotalPrices($_product, null, null, false);
list($_minimalPriceInclTax, $_maximalPriceInclTax) = $_priceModel->getTotalPrices($_product, null, true, false);string ~128 -使用动态类型格式化捆绑价格。
<?php if ($_minimalPriceTax <> $_maximalPriceTax): ?>发布于 2013-12-12 18:23:24
这将为您提供捆绑产品的动态价格,包括tax Mage::getModel('bundle/product_price')->getTotalPrices($_product,'max',1);
这将为您提供捆绑产品不含税的动态价格Mage::getModel('bundle/product_price')->getTotalPrices($_product,'max',0);
只需正确传递产品对象即可。
https://stackoverflow.com/questions/20516595
复制相似问题