How to Change Product Image in Magento 2 Checkout Cart

How to Change Product Image in Magento 2 Checkout Cart

Magento 2 checkout cart page is the intermediate point that proceeds to finalize the purchase. The product image displayed on the checkout cart page gives the customer a quick overview of the items they are about to purchase.

However, when the product has multiple colors and options the image might not match the desired custom selection of the customer.
Moreover, when a store owner wants to give a free product based on a condition, and that product belongs to the customer’s selected configured one.

In that case, what if a store owner needs to display an image of the main product in the free one?

Any solution? Here is the quick solution. Apply the below method to change product image in Magento 2 checkout cart!

Method to Change Product Image in Magento 2 Checkout Cart

  1. Use the below code in the di.xml file at app/code/Vendor/Extension/etc

  2. Create the NewImage.php file at Vendor/Extension/Plugin/CheckoutCart

That’s it!

If you have any doubts regarding this post, just mention them in the Comments section below.

I would be happy to help.

Feel free to share the solution with Magento Community via social media.

Thank You.

Related Post – How to Display Simple Product Image for Configurable Product Image in Magento 2 Mini Cart and Cart

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

5
(based on 11 Reviews)

Dipak is a Magento Developer at Meetanshi. Apart from work, he loves playing cricket with his friends. Traveling and exploring new places is something that he is passionate about.

Leave a reply:

Your email address will not be published.