Shopify themes, liquid, logos, and UX
Hey All,
I am using dawn 2.0 and I am having an issue with the default product picture. For all products the default picture is always the first variant instead of the actual picture we want to be displayed. I have read that this something that can be changed by modifying the code, but I can not seem to figure out how to modify the code to make this work. Could someone please give some advice on how to do this!
Hi @Revelty
Since each theme has its own different element, the theme provider is best equipped with the knowledge of how to customize it. I suggest you to contact your theme provider for the solution.
Shopify is DAWN theme provider. You can directly chat with a Shopify agent here.
If you feel like my answer is helpful, please mark it as SOLUTION. Let me know if you need more help!
Did you ever figure out how to do this? Searching for a solution to this same problem
You can try below solution:
1. Go to theme -> Edit code -> Snippets
2. Open product-media-gallery.liquid
3. Find below line of code:
{%- assign featured_media = product.selected_or_first_available_variant.featured_media -%}
Replace it with:
{%- assign featured_media = product.featured_media -%}
And then find below line:
{%- unless media.id == product.selected_or_first_available_variant.featured_media.id -%}
Replace it with:
{%- unless media.id == product.featured_media.id -%}
Hope this works for you.
this works wonderfully, thank you very much!
That's working for me, but now the featured image is duplicated in the variant selector. Check out this screenshot. Any idea on how to resolve this?
Did you get a resolution? I am having the same issue.
I got the exact same issue and couldn't find another solution.
This "fix" makes it worse if you ask me.
No solution yet. I've just reorganized my images such that the first variant image is my first image... It'll do for now
Yeah, I did the same by calling the API and do exactly that for me for all products.
It is beyond me, that this is not a standard option in one of the most used themes and so many people calling for it.
I'm not a coder but, looking at the code listed above...I think the highlighted code in the pic here is what needs changed.
I'm not sure what it would need changed "to" though. I'm guessing.
I'm having the same irritating issue!
A "featured image" button in each product page would easily solve the issue.
Select the image you want...hit the button. Ugh.
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024