Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: How To Show Only Selected Variant Images in Dawn Theme

How To Show Only Selected Variant Images in Dawn Theme

suryagoswami7
Explorer
110 0 20

Hi, how can i show only the selected variant images in the dawn theme. please help. Thanks in advance.

Replies 12 (12)

AvadaCommerce
Shopify Partner
3879 839 990

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:

 

AvadaCommerce_0-1663554486848.png

 

3. Dashboard -> Products -> Edit Product
On the Edit Product screen you will see the Media section just like the screenshot below:

AvadaCommerce_0-1663554789846.png

 

 

Click on all the media images and add Alt Text as per the screenshot below:

AvadaCommerce_2-1663554579011.png

 

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.

 

 

banned
suryagoswami7
Explorer
110 0 20

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.

AvadaCommerce
Shopify Partner
3879 839 990

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!

banned
suryagoswami7
Explorer
110 0 20

Thanks for your response. I figured it out, Used another method.

ececiper
Visitor
1 0 1

Hi @Suryagoswami7,

 

Can you share the method that worked for you?

jehan70
Excursionist
38 0 5

Can you share the method that worked for you?

Inspirebylina
Visitor
1 0 2

Why don't you share the method that worked for you for the community?

websensepro
Shopify Partner
1288 145 166

 

Tried and tested up to Dawn 11.0.0

 

Let me know if it does not work. Happy to help

Need a Shopify developer?
Hire us at WebSensePro
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel or buy us a Cofee here

Free Shopify Beginner Tutorial
BrucesWaynee
Tourist
7 0 2

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? 

munilu
Visitor
1 0 0

I did the same steps in Dawn 11 but it didn't work for me😶

umidaydemir
Shopify Partner
25 0 0

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/

 

MRamzan
Shopify Partner
392 3 36

Here is the solution I tried and it worked for me.

 

Hire Me:

WhatsApp: +91-9145985880
Email: mohdramzaan112@gmail.com
Skype: mohdramzaan112