【问题标题】:Magento bundle product original priceMagento捆绑产品原价
【发布时间】:2013-12-11 10:26:57
【问题描述】:

当价格设置为动态时,我如何获得捆绑产品的原始价格(价格不包括特价 - 何时设置)?

我正在尝试这样:

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

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

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

【问题讨论】:

    标签: php magento


    【解决方案1】:

    查看 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): ?>
    

    【讨论】:

      【解决方案2】:

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

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

      只需正确传递您的产品对象。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-02-03
        • 2013-06-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-02-25
        相关资源
        最近更新 更多