All things Shopify and commerce
Hi, how can i show only the selected variant images in the dawn theme. please help. Thanks in advance.
Hi @suryagoswami7 ,
You can check following steps:
1.Add following code below <head> in “Theme.liquid” file
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
2. Add thumbnail-color=”{{ media.alt }}” as shown in the screenshot below in main-product.liquid:
3. Dashboard -> Products -> Edit Product
On the Edit Product screen you will see the Media section just like the screenshot below:
Click on all the media images and add Alt Text as per the screenshot below:
4. Now edit “global.js” file and add this.filterMedia(); on line number 769. After adding this code add following JS function in “global.js” file on line number 774:
filterMedia() {
$('[thumbnail-color]').hide();
var selected_variant = this.currentVariant.featured_media.alt;
var selected_attribute = '[thumbnail-color="' + selected_variant + '"]';
if (selected_variant == selected_variant) {
$(selected_attribute).show();
} }
Once done you should be able to see only selected variant images.
I hope this helps.
Hey @AvadaCommerce , Thanks for your reply. I already saw this in a video. Its not working for me. Is there a alternate way for it? i found another blog too but it is also not working.
Hi @suryagoswami7 ,
Sorry if it is not working. That is the least I could do.
I think you can contact support themes from Shopify , then they can help you check it much more.
Have a nice day!
Thanks for your response. I figured it out, Used another method.
Can you share the method that worked for you?
Why don't you share the method that worked for you for the community?
Tried and tested up to Dawn 11.0.0
Let me know if it does not work. Happy to help
Well this works almost. Tried it right now - on the phone it becomes right. All the colors are split. But on desktop, i dosent work if you use the thumbnail carousel. Does anyone have the fix for this?
I did the same steps in Dawn 11 but it didn't work for me😶
Hi, you can try the Rubik Variant Images app to solve this problem. After using it, only the selected variant images will be displayed.
You can give it a try: https://apps.shopify.com/rubik-variant-images/
Here is the solution I tried and it worked for me.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024