Search code examples
phpmagentoconfigurable-product

$_product doesn't contain all needed data (minmal_price)


EDIT: Basically, my problem is that I need to get the minimal_price of an configurable product in category view. Previously, this worked by using

$_product = $this->getProduct();

$_product->getMinimalPrice();

However, it doesn't work anymore. I noticed, that when it still worked dumping $_product would contain 'minimal_price'. Now, this is not the case anymore. Does anyone know what the reason could be?

OLD: I am currently struggling with a really weird error. I updated to magento 1.9 but not everything was working as expected. The category pages became really slow. So I downgraded again to 1.8 which was working fine on our test development server, but now the price of the configurable products, wouldn't display any more on the category sites. Even on a clean magento install 1.7 (with the same database!) it doesn't work.

What I found out is, that first, the price.phtml got changed im Magento 1.9 and two more calls were added, which lead to the increased loading time:

$_convertedFinalPrice = $_store->roundPrice($_store->convertPrice($_product->getFinalPrice()));
$_specialPriceStoreLabel = $this->getProductAttribute('special_price')->getStoreLabel();

The main problem for me is that prices aren't displayed anymore. I noticed the following:

When I dump $_product->debug(); it doesn't contain minimal_price anymore. That is most likely the reason why getMinimalPrice() is not working anymore.

The weird part is, that like I said on a different test development site it is still working and $_product->debug(); still contains minimal_price.

Does someone have an explanation why on one page minimal_price is still included, but on a different site it's not?

Thanks


Solution

  • Remember to enable flat catalog and flat category ;)