I want to display the minimal tier price on my product page and wherever I load my product model. I am using the basic function to get price data:
$this->getPriceHtml($product, true);
When this is called on the product collection (such as a category page) it works fine. When I call getPriceHtml on a product model instance (loaded with Mage::getModel('catalog/product')->load($id)
, if I dump the product data then getData('minimal_price')
does not exist.
I'm thinking that when loading the collection,
->addMinimalPrice()
is added to the collection, but this is missing from the single entity load. Therefore my question is, do I need to include some other method/helper/model when loading product in order for the minimal price to also be loaded?
Best Answer
I didn't find a simple method to load the index for a single product, the safest bet should be using a collection.
This helper method worked for me:
Don't worry about database load, this results in a single query with only one join on the price index table like this: