【问题标题】:Magento display tier prices insteadMagento 显示等级价格
【发布时间】:2011-11-11 18:31:59
【问题描述】:

我浏览了 Magento 论坛和这里的 SO,但没有找到正确的答案。

我只需要将产品页面(以及类别页面)上显示的正常价格替换为最低等级价格。

曾想过替换 price.phtml ~ 第 59 行:

$_price = $_taxHelper->getPrice($_product, $_product->getPrice())

与:

$_price = $_tierPrices

(同时在上面声明 $_tierPrices = $this->getTierPrices)。

欢迎提出任何建议。


已解决: 在以下位置找到解决方案:

http://www.e-commercewebdesign.co.uk/blog/magento-tutorials/get-lowest-tier-price.php

【问题讨论】:

    标签: magento


    【解决方案1】:

    为此找到了另一种方法,基本上需要:

    $_tierPrices = $this->getTierPrices();
    

    ...拼接数组得到第一层。

    $_firstTier = array_slice($_tierPrices, 0, 1);
    

    然后你可以循环遍历 $_firstTier 并获取“价格”值:

    $c = count($_firstTier);
    for ($i = 0; $i < $c; $i++) {
        $_firstTierPrice = Mage::helper('core')->currency($_firstTier[$i]['price']);
    }
    echo $_firstTierPrice;
    

    【讨论】:

      猜你喜欢
      • 2012-05-17
      • 1970-01-01
      • 1970-01-01
      • 2015-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多