Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento get thumbnail image url to be displayed on cart

I having problem in getting the thumbnail image url for the items on the Magento Cart

Here is my code:

$quote = Mage::getSingleton('checkout/session')->getQuote();
$cartItems = $quote->getAllVisibleItems();
foreach ($cartItems as $item) {
echo $item->getThumbnail();
}

Does anyone know that why does it returns always blank.

like image 819
Nirmal Ram Avatar asked Feb 27 '13 07:02

Nirmal Ram


1 Answers

Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail');

Will do the trick

like image 167
dagfr Avatar answered Nov 06 '22 18:11

dagfr