Skip to main content
Home Shopify Shopify Knowledge How to Add Zoom on Hover in Product Page in Shopify: A Detailed Guide

How to Add Zoom on Hover in Product Page in Shopify: A Detailed Guide

Sam|
March 5, 2025|
7 min read

When you run a Shopify store, you may have to encounter with multiple challenging tasks. One of the tasks we are talking about is to find out how to Add product image zoom on hover on Shopify. It will be a piece of cake if you read our article with a step-by-step guide for you to follow easily.

Before going into details, we will reveal to you how product images affect customers so that you can have a better understanding of the importance of product image. Then, we will show you three main methods to add product image zoom on hover on Shopify. Now, let’s get started!

Related posts:

Benefits of Product Image Zoom on Hover

Adding a product image zoom on hover feature to your Shopify store brings multiple advantages: 

  • Enhances the customer’s visual experience: Zoom functionality lets customers view product details like stitching, texture, or intricate designs up close. It replicates the in-store shopping experience, enabling them to virtually “touch” and “feel” the product.
  • Builds trust and confidence: By letting customers thoroughly inspect products, zoom features show transparency and attention to quality. When shoppers see exactly what they’re buying, they feel more confident purchasing.
  • Boosts sales and conversions: Eliminating doubts about a product’s quality or details encourages customers to complete their purchase. Zoom functionality also makes your store appear more professional and credible, leading to higher sales and repeat business.
  • Reduces the need for additional product images: Instead of uploading multiple close-ups, a single high-resolution image with zoom provides a comprehensive view. This saves time and ensures customers can see every important detail effortlessly.

How to Add Image on Hover for your Product Images in Shopify: 4 Methods 

Adding a product image zoom on hover feature to your Shopify store can be done in several ways. Whether you prefer using Shopify’s built-in options, coding your solution, or leveraging apps, there’s a method to suit every need. 

Follow the steps below to implement this feature easily: 

Method 1: Using Shopify’s Built-in Zoom Feature

Shopify offers a native zoom functionality for certain themes. If your theme supports it, enabling zoom is straightforward:

  • Step 1: Log in to your Shopify admin dashboard.
  • Step 2: Go to “Online Store” > “Themes” and click “Customize” next to your active theme.
Go to “Online Store” > “Themes” and click “Customize”
  • Step 3: In the theme editor, go to the “Product Pages” section.
go to the “Product Pages” section
  • Step 4: Look for a setting labeled “Image Zoom” or similar (this may vary depending on your theme). This setting is ideal for providing a detailed view of your product images.
Look for a setting labeled “Image Zoom”
  • Step 5: After making adjustments, click “Save” to apply the changes.
click “Save” to apply the changes

This method is quick and requires no coding. However, it’s limited to themes that support built-in zoom functionality.

Method 2: Manually Adding Zoom with Code (for Advanced Users)

For those comfortable with coding, you can manually implement image zoom by editing your theme files:

  • Step 1: Go to “Online Store” > “Themes” and click “…” > “Edit Code”
Go to “Online Store” > “Themes”
  • Step 2: Locate the product.liquid or product-template.liquid file and find the section displaying the product images (look for <img> tags).
  • Step 3: Include a CSS rule to scale the image on hover:

.product-image:hover {
    transform: scale(1.5); /* Adjust scale value as needed */
    transition: transform 0.3s ease-in-out;
}

Ensure your images are high-resolution for a better zoom effect.

  • Step 4: Save and test to ensure the zoom works smoothly.

Method 3: Using Vanilla Javascript

For a more interactive zoom effect, you can use JavaScript:

  • Step 1: Go to Online Store > Themes > Actions > Edit Code.
  • Step 2: Open the theme.js or create a new file called zoom.js. Add this code:
const productImages = document.querySelectorAll('.product-image');  
productImages.forEach(image => {  
    image.addEventListener('mousemove', (e) => {  
        const rect = image.getBoundingClientRect();  
        const x = ((e.clientX - rect.left) / rect.width) * 100;  
        const y = ((e.clientY - rect.top) / rect.height) * 100;  
        image.style.transformOrigin = `${x}% ${y}%`;  
        image.style.transform = 'scale(2)';  
    });  
    image.addEventListener('mouseleave', () => {  
        image.style.transform = 'scale(1)';  
        image.style.transformOrigin = 'center center';  
    });  
});

Step 3: Add this line to your product.liquid or product-template.liquid file:
html

<script src="{{ 'zoom.js' | asset_url }}"></script>

Step 4: Save and test to ensure the zoom behaves as expected when hovering over product images.

Method 4: Installing a App from the Shopify App Store

Using an app is the easiest way to implement zoom functionality. Magic Zoom Plus is a highly rated app that lets you add zoom on hover with a professional, polished look. Steps to install and configure:

  • Step 1: Go to the Shopify App Store and search “Magic Zoom Plus.”
Go to the Shopify App Store
  • Step 2: Click “Install” and follow the installation prompts.
Click “Install”
  • Step 3: Once installed, go to the app’s settings in your Shopify admin and click “Install.”
go to the app’s settings
  • Step 4: Configure the zoom options, such as hover effect style, zoom level, and transition speed.
Configure the zoom options
  • Step 5: Save your settings and preview the results on your store.
Save your settings and preview the results on your store.

How to Test the Zoom Functionality and Solve the Common Issues 

Once you’ve added the product image zoom on hover feature to your Shopify store, it’s essential to ensure it works seamlessly across devices and browsers. Here’s a step-by-step guide to test its functionality and resolve common issues:

How to Test the Zoom Functionality

  1. Check on multiple devices: Open your store on various devices, such as desktops, tablets, and smartphones. Then, test the zoom effect on each device to ensure it responds as expected.
  2. Verify browser compatibility: Test the zoom feature on popular browsers like Google Chrome, Safari, Firefox, and Microsoft Edge. Ensure there are no layout shifts or broken features in any browser.
  3. Inspect image quality: Hover over the product images to ensure they zoom in with high resolution. Replace any low-quality images with higher-resolution versions if needed.
  4. Simulate customer interactions: Navigate to the product pages like a customer would and test the zoom effect. Check if the zoom is smooth and enhances the viewing experience.
  5. Review loading speed: Use tools like Google PageSpeed Insights to check your store’s loading speed. Ensure the zoom feature doesn’t slow down page performance.

Common Issues and Solutions

  1. Zoom effect not working: The feature might be disabled in your theme or app settings. Revisit the settings in your Shopify admin or app dashboard and ensure the feature is enabled.
  2. Images are blurry when zoomed: The uploaded images are low resolution. Use high-quality images with a resolution of at least 2000 x 2000 pixels for optimal zoom clarity.
  3. Zoom works inconsistently across devices: The zoom script or app isn’t fully responsive. Use a responsive theme or an app like Magic Zoom Plus that supports all screen sizes.
  4. Zoom causes layout issues or overlaps with other elements: CSS conflicts between the zoom feature and your theme. Add custom CSS to adjust the styling and ensure no overlap. For example:
.product-image:hover {
    z-index: 10;
    position: relative;
}
  1. Zoom slows down the page: Large image files or poorly optimized code. Compress your images using tools like TinyPNG and ensure any added scripts are optimized for performance.

Ending Words

Adding a product image zoom on hover feature to your Shopify store allows the customer to explore your products in detail, boosting their confidence in making a purchase. Whether you choose Shopify’s built-in tools, a custom coding approach, or an easy-to-use app, implementing this feature can increase customer satisfaction and conversions.

Add Product Image Zoom on Hover on Shopify: FAQs

Does every Shopify theme support the built-in image zoom feature?

No, not all Shopify themes have a built-in zoom feature. Check your theme’s documentation or settings under Online Store > Themes > Customize to see if the option is available. If your theme lacks support, you can use custom code or an app to implement the feature.

Can I add a zoom feature without using an app or coding?

Yes, if your theme has a built-in zoom feature, you can enable it without coding or installing an app. However, if your theme doesn’t have this option, you’ll need to use code or a third-party app to achieve the functionality.

How do I fix blurry images when using the zoom feature?

Blurry zoomed images are usually caused by low-resolution files. To fix this, you should use high-quality images with a minimum resolution of 2000 x 2000 pixels and ensure the original file size isn’t too much during upload.

Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.