I'm assuming you want to display the tiered pricing for each cart item on the cart view page, it might be worth clarifying this in your question.
It looks like you are trying to call the method
getTierPrice() from the
Mage_Catalog_Model_Product class instead of the
You could create your own custom block that extends
Mage_Catalog_Block_Product_Abstract but the easiest way to achieve what you want is to create a new instance of
Mage_Catalog_Block_Product_View for each item.
Add this after
$_item = $this->getItem(); inside checkout/cart/item/default.phtml:
$_tierPricing = $this->getLayout()->createBlock(
'product_id' => $_item->getProductId()
And then where you want to put your pricing info:
<?php echo $_tierPricing->getTierPriceHtml();?>
- On the first line we create a new product view block and pass in the products' ID. It is important this is done now during the creation phase rather after the block is instantiated to avoid errors in the _prepareLayout method.
- Then we set the tiered pricing template, you should probably make a new template used just for the cart. Perhaps
- Now we can use the getTierPriceHtml() method successfully.