We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Re: Show size variant on collection page

Solved

How can I display size variants on collection pages in Impulse theme?

HeyBelle
Tourist
4 0 0

Help Please... We would like to show size variant on our collection pages not just on product page to make it easier for customers to see what's available instead of having to go into actual product. We are using impulse theme. Would like size to cross out if unavailable.  I have tried everything but am unable to make it happen. 

Accepted Solution (1)
tewe
Shopify Partner
245 46 102

This is an accepted solution.

Hi @HeyBelle ,

to achieve what you want you must edit and extend your theme code. Here is a description how to do that.

If you do not feel comfortable with HTML, JavaScript and LIQUID you can ask an someone for help, e.g @Hardik29418 or us :).

To add someone to your staff, in your admin for the shop go to settings->Plan and permissions->Add Staff. You can find more details here.

Regards
Thomas

 

• Was my reply helpful? Click Like to let me know!
• Was your question answered? Mark it as an Accepted Solution
• Check out our Price Updater App

View solution in original post

Replies 23 (23)

HeyBelle
Tourist
4 0 0

Not sure how I add staff member

tewe
Shopify Partner
245 46 102

This is an accepted solution.

Hi @HeyBelle ,

to achieve what you want you must edit and extend your theme code. Here is a description how to do that.

If you do not feel comfortable with HTML, JavaScript and LIQUID you can ask an someone for help, e.g @Hardik29418 or us :).

To add someone to your staff, in your admin for the shop go to settings->Plan and permissions->Add Staff. You can find more details here.

Regards
Thomas

 

• Was my reply helpful? Click Like to let me know!
• Was your question answered? Mark it as an Accepted Solution
• Check out our Price Updater App
HeyBelle
Tourist
4 0 0

Thomas I have tried adding codes that I found in discussion groups but haven't found one that works, or I'm not doing it correctly 

Hardik29418
Shopify Partner
2913 418 1083

If you still not find the solution, then you can add me as a  staff member.

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email
Hardik29418
Shopify Partner
2913 418 1083

@code_with_adam Yes. Sure. Please message me

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email

mhmedia
Shopify Partner
23 0 8

Hi,

 

Im also having this issue.

Any solutions?

 

Thank you

Hardik29418
Shopify Partner
2913 418 1083

@mhmedia Hello,

Welcome to the Shopify Community.

It needed some coding to be implemented.

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email
mhmedia
Shopify Partner
23 0 8

Thank you for your response.

I am familiar with coding.

can you share the code?

thank you in advance

mhmedia
Shopify Partner
23 0 8

@Hardik29418 

I can change it in the translation.

Can I do calc there?

Hardik29418
Shopify Partner
2913 418 1083

@mhmedia 
Please go to Snippets -> product-grid.liquid or similar name file, Find right place to place this code

{% for product_option in product.options_with_values %}
{% if product_option.name == 'Sizes' or product_option.name == 'sizes' or product_option.name == 'size' or product_option.name == 'Size' %}
        <ul>
          {% for value in product_option.values %}
          <li>{{ value }}</li>
          {% endfor %}
        </ul>
{% endif %}
{% endfor %}

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email
mhmedia
Shopify Partner
23 0 8

@Hardik29418 Thank you so much it looks great!

How do I only show the variants that are in stock?

Screen Shot 2021-05-30 at 6.19.21 PM.png

Hardik29418
Shopify Partner
2913 418 1083

Please update my code with this.

{% assign product_option_color2 = false %}
            {% for product_option in product.options_with_values %}
                {% if product_option.name == 'Sizes' or product_option.name == 'sizes' or product_option.name == 'size' or product_option.name == 'Size' %}
        			{% assign product_option_color2 = true %}         
            		{% assign product_option_key = 'option' | append: forloop.index %}                        
                    {% for value in product_option.values %}
                      {% for variant in product.variants %}          
                         {% if variant.available %}
                            <li>
                               {{ value }}
                            </li>
                           {% break %}
                         {% endif %}            
                      {% endfor %}
                    {% endfor %}
                {% endif %}            
            {% endfor %}

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email
mhmedia
Shopify Partner
23 0 8

Thank you for your response,

I updated it but I still see all the variants even though some are sold out.

SIMPLESOUL
Visitor
2 0 1

Has anyone figured out the code to make sure sold out size variants dont show? 

Mark118
Excursionist
55 0 4

Hi Mhmedia, did you manage to get this working? I also use the Impulse theme and am trying to display only the current sizes in stock. 

mhmedia
Shopify Partner
23 0 8

HI,

 

Unfortunately, I didn't.

Mark118
Excursionist
55 0 4

I had to use an app. Looks exactly how I wanted it but pretty steep at $10 a month. Called Size Swatch. 

mhmedia
Shopify Partner
23 0 8

Thanks, This is a very good app;)

asadmehmood
Shopify Partner
2 0 0

try this code....

{% for product_option in product.options_with_values %}
{% if product_option.name == 'Sizes' or product_option.name == 'sizes' or product_option.name == 'size' or product_option.name == 'Size' or product_option.name == 'Taglia' %}
{% assign product_option_color2 = true %}
{% assign product_option_key = 'option' | append: forloop.index %}
<ul class="SizeSwatchList HorizontalList HorizontalList--spacingTight" style="text-align:left;margin-top:10px;">
{% for value in product_option.values %}

<li class="{% if product.variants[forloop.index0].available == false %} hide{% endif %} bill-list" data-avaliable= "{{ variant.inventory_quantity }}">
{{ value }}
</li>

{% endfor %}
</ul>
{% endif %}
{% endfor %}

.hide{display:none!important}

mkoldun
Visitor
1 0 0

Hi @AlexEffron,

Can you advice where should I put the code if I don't have Snippets -> product-grid.liquid file in my theme ?

 

Thanks,

Michael.

zohairali
Visitor
2 0 0

I have the same question.

zohairali
Visitor
2 0 0

where did you post it? i am unable to find the similar file

ChaneAllison
Shopify Partner
3 0 0

Hi @Hardik29418 ,

 

Do you know where I can paste the code in for the Dawn theme? I only want it to show on the collection page products. Thanks!