How To

How to set Base Image Instead of Thumbnail Image in Minicart of Magento 2

Most of the Ecommerce customers make a buying decision by viewing the product image, and that’s how image plays a vital role in boosting store sales. Because they can’t have hands-on experience until they received their order delivery. That’s why the store owners add multiple product images and videos from different perspectives so the customer can make a more precise decision and reduce product returns. In default Magento 2, there are several image type options using which you can set base Image, small Image, thumb, and open graph/twitter card images for the product.
But things are quite easy when you have a single product image, but when there are multiple images, you have to select image options each time you upload product image and also have to remember their sequence and everything. To make it easy, you can use your base image as product thumb, so you can save your time by using the same image everywhere in Magento 2. By using the base image as a thumb, the same image will be displayed in a mini cart every time your customer adds a product to the shopping cart. Here is code to do the same.
To do the same first, we need to add a small piece of code in frontend “view.xml” file inside your theme folder. But first of all search for the below code in the file.
app\design\frontend\Themes\Yourtheme\etc\view.xml

<image id="mini_cart_product_thumbnail" type="thumbnail">
    <width>75</width>
    <height>75</height>
</image>

Now replace that code with below code.

<image id="mini_cart_product_thumbnail" type="small_image">
    <width>75</width>
    <height>75</height>
</image>

Simply clear the cache and that’s it.
Lastly, if you found this blog helpful, don’t forget to share it with your colleagues and Magento Friends and Let us know if you are facing any issue while implementing this code.
Happy Coding!

Click to rate this post!
[Total: 10 Average: 5]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate 🎖️ Certified Magento Developer👨‍💻. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.🏏

View Comments

Recent Posts

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

2 days ago

How Upcoming Cookie Changes Will Affect Your E-commerce Website?

The e-commerce world is constantly in flux. New tech and strategies emerge daily to help…

2 days ago

Magento 2: How to Add Header and Footer in Checkout

Hello Magento Friends, In today’s blog, we will discuss adding a header and footer to…

3 days ago

Understanding Flexbox Layout in React Native

Hello React Native Friends, Building a visually appealing and responsive mobile app is crucial in…

5 days ago

HYVĂ„ Themes Releases: 1.3.6 & 1.3.7 – What’s New

We're thrilled to announce the release of Hyvä Themes 1.3.6 and 1.3.7! These latest updates…

5 days ago

How Modern E-Commerce Platforms Leverage Docker & Kubernetes for Scalability

Your e-commerce platform is surging - orders are rolling in, traffic spikes are becoming the…

6 days ago