获得Magento捆绑产品的“低至”价格

时间:2010-05-28 22:38:52

标签: php magento

我正在尝试使用自定义模板显示捆绑产品列表。我无法显示捆绑产品的动态价格。以前我使用过的简单产品:

$product->getPrice(); 

哪个有效,但它只显示捆绑商品的0.00美元。

看着../catalog/products/list.phtml我试过

$this->$getPriceHtml($product, true);

将我的块扩展到Mage_Catalog_Block_Product_Abstract后,我再次使用简单的产品,但捆绑产品仍显示$ 0.00

是否有另一种方法可以显示动态捆绑价格的最低价格?

我清除了缓存并重新编制索引以及所有好东西。价格在默认类别列表下正确显示,而不是在我的自定义页面下。

更新

我无法找到替代方案。当我进行产品集合的转储时,对于包含价格的捆绑产品字段,如下所示:

["price_type"] => string(1) "0"

["price_view"] => string(1) "0"
  ["_price_index"] => bool(true)
    ["_price_index_min_price"] => string(8) "475.0000"
    ["_price_index_max_price"] => string(8) "475.0000"
    ["tax_percent"] => float(9)
    ["final_price"] => int(0)

对于简单的产品我只能得到:

["price"] => string(8) "248.0000"
 ["final_price"] => string(8) "248.0000"

所以我想我可以根据产品类型编写自己的功能来获取价格,但我猜测有更好的方法......

2 个答案:

答案 0 :(得分:1)

查看/app/design/frontend/base/deafault/layout/bundle.xml

<catalog_category_default>
    <reference name="product_list">
        <action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
    </reference>
</catalog_category_default>

你应该添加自定义的phtml(xml不需要控制)。从您的bundle / catalog / product / price.phtml开始,以获得您需要的所有功能;)祝您好运

答案 1 :(得分:0)

你可以使用我的magento模块:

https://github.com/head82/KH_ExtendedBundlePrice