Shopify themes, liquid, logos, and UX
My site uses the standard Dawn theme. Currently my product cards are set to show the second image when my cursor hovers over them. I was hoping to change it to show a different specific image (changes based on product). Currently I have my product stills in order and then two photos of a model wearing my product. I was hoping to keep this same order whilehave one of the modeling photos show up when you hover over the product listing. I believe there needs to be a custom code implemented and was hoping I could get some guidance on how to go about this. Should be a pretty simple integration just not sure where to start. I have attached a photo of an example product listing and how the order of my photos usually goes. Please not there is a different number of photos for each product.
Solved! Go to the solution
This is an accepted solution.
@creativebp8 Please follow below steps to display last image on product cards instead of second image. Let me know whether it is helpful for you.
{% assign last_image = card_product.media | last %}
Hi @creativebp8,
It will display the second image in the list of images, or another image. You can use Metafield to add customization to each product and display it.
Do you have experience with code?
Hi @creativebp8,
Will it always show the last image of all products, or will some products show the image in a different position?
If always show the last image, can you send me the code of card-product.liquid file, I will help you check it
Hi @creativebp8,
You can post it directly here, or send it via private message. I will check it
Hi @namphan what if some images are shown in a different position? How should it be coded?
Hi @levents-2025,
You want each product to display image in different positions? like product A will display image in position 2, product B will be 3.
This will need to be setup by Metafield, if you want I can add it and guide you
Yes but to be specific, I want variant A to show a different image from variant B when hovered.
Hi @levents-2025,
The product card will show product image, with variant image, I still don't understand it clearly, can you explain more or send me store link in private message? I will check it
Hi @levents-2025,
I got it, this is possible. You can create Metafield for each variant and customize it.
Please send me store link and collaborator code in private message, I will help you add it
Thank you. I have sent an email.
This is an accepted solution.
@creativebp8 Please follow below steps to display last image on product cards instead of second image. Let me know whether it is helpful for you.
{% assign last_image = card_product.media | last %}
Thank you so much!
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025