I want to get base product image in Magento to resize it and display in cart sidebar.
Unfortunatelly this:
echo $this->helper('catalog/image')->init($_product, 'image')->resize(38, 38);
prints Magento placeholder image.
Base image is set for this product properly. Small image and thumbnail works great.
No idea what's going on.
EDIT: Solution: Get full product data this way:
$_product = Mage::getModel('catalog/product')->load($_item->getProduct()->getId());
and then use it as you wish:
echo $this->helper('catalog/image')->init($_product, 'image')->resize(38, 38);
I think you are looking for this:
echo Mage::getModel('catalog/product_media_config')
->getMediaUrl( $product->getImage() ); //getSmallImage(), getThumbnail()
Credit should be given to BenMarks who gave this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With