Goal: Make entire product images clickable (and ideally collections) in Shopify’s Dawn theme.
What works in Dawn:
Edit Sections > featured-product.liquid. Wrap the product image container <div class=“product__media-item” …> with an … so clicking the image goes to the product page. Back up the file before editing.
Earlier advice to edit product-template.liquid applies to other themes; in Dawn the correct file is featured-product.liquid.
Styling/behavior notes:
To remove the blue underline on linked titles, add inline CSS like style=“text-decoration:none” on the tag (or use theme CSS).
The easy way to do this is to put the image and title inside the a tag so that you can click on the image and title to jump to the product details page.
If you don’t know much about the code, you can contact me to help you out.
Select the theme you’re using and click on the “Editor” option.
In the “Sections” folder, locate and open the “product-template.liquid” file.
Look for the code that displays the product image and wrap it in an HTML link tag, like this:
{{ product.images | first | img_url: '1024x1024' }}
This code will make the entire product image clickable, taking the customer to the product’s details page when they click on it. You can adjust the image size in the img_url filter to suit your needs.
Hey @EcomGraduates , thanks for moving me in the right direction! But I’m not able to find “product-template.liquid” - it must be listed under something else for the Dawn theme.
Would you happen to know under what section/snippet this needs to be pasted in?
1 - Is it possible to get rid of the blue link underline under the product name ? it kinda makes it ugly.
2 - How can I apply this method to the other featured products, I have 2 on my landing page and only the first seems to work.
so do i delete the top portion or am i just adding this onto a different section of the theme? i just tried both and am still unable to click on the picture for it to take me to the product
thank you! this also worked for me on Origin Theme. I had a few entries like this and wrapped them with the tags above, and now they all click and lead to the product page. thanks so much!
So I have been trying to get this to work but I cant seem to find a solution. All of my products images are not clickable, only the link below the image is. How do I make it so the image of the product is clickable and takes you to the product details page. I want this for all products.