I want to change product image after a user added a product in to cart, Because user can change image text and font style. So, I have loaded Quote item using event sales_quote_add_item and I am able to change product price using it but I am not getting how to change product image.


2 Answers 2


The cart product image is provided by the getProductThumbnail method from the following renderers:

  • Mage_Checkout_Block_Cart_Item_Renderer_Configurable for configurable products
  • Mage_Checkout_Block_Cart_Item_Renderer_Grouped for grouped products
  • Mage_Checkout_Block_Cart_Item_Renderer for any other type of products

Thus, my advice would be to rewrite those renderer blocks in a module:




                <!-- Mage_Checkout_Block_Cart_Item_Renderer -->
                <!-- Mage_Checkout_Block_Cart_Item_Renderer_Configurable -->
                <!-- Mage_Checkout_Block_Cart_Item_Renderer_Grouped -->


NB: you change remove some rewrites from this file if you don't need them (i.e. if you don't use configurable products, remove the corresponding block rewrite, same for grouped products)

Then you can create your custom blocks extending the original blocks.

Here's a sample of how your code could look like for the DigitalPianism_CartImage_Block_Checkout_Cart_Item_Renderer block:


class DigitalPianism_CartImage_Block_Checkout_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_Item_Renderer

    public function getProductThumbnail()
        if () {
        } else {
            return parent::getProductThumbnail();

Please note that as I don't know exactly what will trigger the image change, you will have to update the if statement of the above code to match your needs

  • Thank you for your answer, I will implement this thing and let you know its working or not May 31, 2016 at 5:38

Unfortunately the quote item does not stores the product image as it does for the product price.

Although you can store the url info of the image using the setProductOption method of Mage_Sales_Model_Quote_Item.

Once the data is saved, for the cart page you can overwrite Mage_Checkout_Block_Cart_Item_Renderer classes getProductThumbnail method to fetch the item option data saved previously.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.