Size availability

Highlighted
New Member
14 0 0

Could someone teach me how can i get my Size availability from product ( S,M,L,XL, etc) to be shown outside my product like in the example image ? I use the Brooklyn theme. Thanks you!how to.png

0 Likes
Highlighted

Hello @Andrianno,

You can take reference from below website

https://help.groupthought.com/article/660-collections-add-product-sizes-to-collection-pages

Want to modify or incorporate custom changes on store, Hire us.
If helpful then please Like and Accept Solution .
Email: pallavi@oscprofessionals.com
Skype : oscprofessionals-87
Free Review and advice for sale on store | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | SEO & Digital Marketing | Site Speed Optimization | Performance Site Audit
0 Likes
New Member
14 0 0

The solution you have send me on my E-mail doesn not work. I use the Brooklyn theme and there is no such code under wich i need to add the new one.

0 Likes
Highlighted
Shopify Partner
1197 162 320

You'd have to find your product loop in your collection, and then use another loop to loop through your product options. As a simplified example it would be:

 

{% for product in collection.products %}
  <div>{{ product.title }}</div>
  <div>{{ product.price | money }}</div>
  {% for option in product.options_with_values %}
    {% if option.name == "Size" %}
      <div>{{ option.name }}:</div>
     <div>
      {% for value in option.values %}
      {{ value }}{% unless forloop.last %},{% endunless %}
      {% endfor %}
     </div>
    {% endif %}
  {% endfor %}
{% endfor %}

//Output:

//Blue T-Shirt
//$10.00
//Size:
// S,M,L,XL

I dont think there are any typos in there, you can also reference here:

 

https://help.shopify.com/en/themes/liquid/objects/product#product-options_with_values

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted
New Member
14 0 0

Do i copy this or i have to edit it in some way! Where is this so called "loop"located?

0 Likes