Hi everyone,
I was wondering if we can insert a thumbnail image into a product image or collections as this one:
Appreciated your feedback on this matter,
Best regards,
A user wants to add a thumbnail overlay image to product cards in their Dawn theme collection pages, similar to a reference image they provided.
Proposed Solution:
A Shopify expert provided step-by-step instructions:
card-product.liquid to display a second product image as a thumbnail overlaybase.css to position the thumbnail in the bottom-right corner with hover effectsCurrent Status:
The original poster is having difficulty locating the first code snippet mentioned in the instructions. The implementation remains incomplete and requires further clarification on finding the correct code section in the theme files.
Hi everyone,
I was wondering if we can insert a thumbnail image into a product image or collections as this one:
Appreciated your feedback on this matter,
Best regards,
Hi @Alliance
I am from Mageplaza - Shopify solution expert.
Follow these steps to add a thumbnail image to each product in the collection.
Go to Online Store → Themes → Dawn → Edit Code.
Open the card-product.liquid File
{{ product.featured_image | image_url: width: 500 | image_tag: class: 'card__img' }}
{{ product.featured_image | image_url: width: 500 | image_tag: class: 'card__img' }}
{% if product.images.size > 1 %}
{{ product.images[1] | image_url: width: 80 | image_tag: class: 'thumbnail-overlay' }}
{% endif %}
.custom-thumbnail {
position: absolute;
bottom: 10px;
right: 10px;
width: 50px; /* Adjust size */
height: auto;
border: 2px solid #fff;
background: rgba(255, 255, 255, 0.8);
padding: 3px;
border-radius: 5px;
transition: transform 0.2s ease-in-out;
}
.custom-thumbnail:hover {
transform: scale(1.1);
}
.card__media {
position: relative;
}
Please let me know if it works as expected!
Best regards
Hi,
Can’t find the first code.
Best regards,