Debut theme: Add a lightbox zoom to product page images (mobile & desktop)
The Debut theme ships with a zoom on-hover feature out of the box, that is available exclusively for desktop. On mobile, depending of one's device, there is still the possibility to “pinch-to-zoom” and, subsequently, have a better view of the product, but it's rather a limited poor alternative especially when in comparison to popular e-commerce websites.
Today I'll be teaching you how to quickly install a “lightbox zoom” feature for all of your Debut theme product page images, you just need to click (or tap) on the image to activate it.
It works out of the box on any Debut theme (including Debut themes using EZFY's Debut Swipe Slider) and just takes a couple of minutes to install.
Downloading the code files
You can download the code files clicking here. (live preview)
Complete details about it can be found here.
Making a backup of your theme
Before diving into the tutorial make sure you download the theme, so in case you face any issues you can easily revert back.
Step 1: opening the code editor
- In your Shopify admin, go to Online Store > Themes > Actions > Edit Code.
- Inside the .zip you downloaded you'll find two files:
- ezfy-zoom.txt
- settings_schema.txt
Step 2: Creating the lightbox zoom file
- Open the ezfy-zoom.txt file and copy all the code in there.
- Now go back to your Shopify code editor and below Snippets click on “Add a new snippet“. Name it exactly: ezfy-zoom
- Paste the code that you copied and click on save.
Step 3: Adding the code to the product pages
- Find the file named theme.liquid.
- Inside this file, press CTRL + F (or CMD + F on Mac) and search for:
</body> - Paste the following code before the </body> tag you found and save:
{% include 'ezfy-zoom' %}
4th and final step: updating the settings_schema.txt file
- Open the settings_schema.txt file and copy all the code in there.
- In your Shopify code editor find the settings_schema.json file in your theme.
- Scroll all the way down.
- Paste the code before the last line, after the } sign, as indicated the image below.
So, for example, in this case, the code should be pasted on the line 1638 (the quantity of lines may vary depending of your theme, so don't worry if it shows a different number on yours).
Paste the code to the right of the } character that the arrow is pointing to. - Save and you're ready to go!
Troubleshooting common issues
Question: It shows me an error after I edit the settings_schema.json file. What do I do?
Answer: You very likely pasted the code at the bottom of the file. Please make sure you paste the code at the penultimate (second last) line as indicated in the step 4.
Your file must end with this character: ]
If you're still facing any issues please reach out to us via ezfycode@gmail.com and we'll be more than happy to help you out!
Customizing the lightbox zoom
- In your Shopify admin, navigate to Online Store > Themes >Customize.
- Scroll all the way down and navigate to Theme settings > EZFY Product Image Zoom
- Inside the EZFY Product Image Zoom menu you'll find all available options for the Lightbox Zoom.
Was this article helpful?