I'm trying to display a list of bundled products using my custom template. I'm not able to display the dynamic price of the bundle product. Previously for simple products I used:
$product->getPrice();
which worked, but it just displays $0.00 for bundle items.
looking at ../catalog/products/list.phtml I tried
$this->$getPriceHtml($product, true);
after extending my block to Mage_Catalog_Block_Product_Abstract I got simple products working again, but bundle products still show $0.00
Is there another way to display the as low as price for dynamic bundle prices?
I cleared cache and reindexed and all that good stuff. The price shows up correctly under the default category list, just not under my custom page.
Update
I haven't been able to figure out an alternative. When I did a dump of the product collection, for the bundle product fields containing prices are as follows:
["price_type"] => string(1) "0"
["pr开发者_如何学Goice_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)
For simple products I only get:
["price"] => string(8) "248.0000"
["final_price"] => string(8) "248.0000"
so I suppose I could write my own function to grab the price depending on product type, but I'm guessing there's a better way...
look at /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>
you should add your custom phtml (no control needed xml does that). Start from your bundle/catalog/product/price.phtml to get all function you need ;) good luck
you can use my magento module:
https://github.com/head82/KH_ExtendedBundlePrice
精彩评论