Magento get thumbnail image url to be displayed on cart

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

Will do the trick

Share:
18,400
Nirmal Ram
Author by

Nirmal Ram

Updated on June 05, 2022

Comments

  • Nirmal Ram
    Nirmal Ram almost 2 years

    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.

  • Klevis Miho
    Klevis Miho over 9 years
    This gets the image of the Configurable Product. Do you know how to get the image of the Associated Product?
  • prava
    prava over 9 years
    can you please answe @Klevis question, as I am too facing the same issue.