首页 文章

Magento捆绑产品原价

提问于
浏览
0

当价格设置为动态时,我如何获得捆绑产品原价(特价除外 - 何时设置)?

我这样想:

<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol().number_format($_product->getPrice(),2) ?>

但它只适用于固定价格,如果价格是动态的,它显示0.00

最好的方法是适用于两种价格:固定和动态

2 回答

  • 0

    请参阅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): ?>
    
  • 1

    这将为您提供捆绑产品动态价格,含税 Mage::getModel('bundle/product_price')->getTotalPrices($_product,'max',1);

    这将为您提供不含税的捆绑产品动态价格 Mage::getModel('bundle/product_price')->getTotalPrices($_product,'max',0);

    只需正确传递产品对象即可 .

相关问题