【问题标题】:Get "As low as" price for bundle product in Magento在 Magento 中获得捆绑产品的“低至”价格
【发布时间】:2011-02-25 08:26:21
【问题描述】:

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

$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"

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

【问题讨论】:

  • 抱歉延迟回复。我正在使用 1.3.2,但最终也想开始使用 1.4。同样在今天,我在我们的销售产品块中添加了一个捆绑产品(由其他人添加),我注意到了同样的问题。捆绑产品显示为 0.00 美元。
  • 我仍然坚持这一点。有没有人可以帮助我?
  • 好吧,我一直在研究捆绑产品的其他方面,并意识到捆绑产品的定价与简单和分组产品完全分开。
  • @dardub,您找到解决问题的方法了吗?
  • @Geoffrey - 我实际上已经离开了 Magento,那里有更好的解决方案,更容易定制和维护。当您仅查看功能列表时;没有什么能比得上 Magento,但就实际使用而言,它很糟糕。

标签: php magento


【解决方案1】:

你可以使用我的 magento 模块:

https://github.com/head82/KH_ExtendedBundlePrice

【讨论】:

    【解决方案2】:

    查看/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 开始,以获得你需要的所有功能;)祝你好运

    【讨论】:

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