2011-11-11 127 views
0

我已经通过Magento论坛和SO在这里看过,但没有遇到正确的答案。Magento显示层级价格而不是

我只需要用最低的价格替换产品页面(和类别页面)上显示的正常价格。

假如更换price.phtml〜第59行的思想:

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

随着:

$_price = $_tierPrices 

(而宣告高于$ _tierPrices = $这个 - > getTierPrices)。

欢迎任何建议。


解决: 发现溶液在:

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

回答

2

找到该另一方法,该方法基本上需要:

$_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; 
相关问题