Discussion Forums

d
Topic
Fastone Shopify Partner www.motion-effect.no
Posts:
50
6 months ago

Display product Size/variants in each product This post is outdated

Hi, 

I've spent two hours now trying to search for how to display, for now, the product Size for each product, even when there's just one size. We would like to display that to the customer, though there will only be one size for the products. 

The latest post I read was this one: 

http://ecommerce.shopify.com/c/shopify-discussion/t/option-label-not-showing-up-on-product-page-when-there-s-only-one-option-65497

But Im not getting anywhere. 

Store:
www.nissefabrikken.no

Product example:
http://www.nissefabrikken.no/products/filtnisse-222

 

Help?...

Thanks, 

Johnny  Webdesigner www.motion-effect.no
i
Replies
Posts:
128
6 months ago

I'm not sure what you mean, but this may help:

http://wiki.shopify.com/Product_img_url#Image_sizes

http://www.tapwellbathrooms.co.uk/collections/bathroom-furniture
Fastone Shopify Partner www.motion-effect.no
Posts:
50
6 months ago

Hey, 

Thanks, nice tip. But it's not really what Im looking for. I need to show the product Size (hight actually) in singel product display. (product.liquid), even if there is just one variant of the hight. 

 

Johnny  Webdesigner www.motion-effect.no
Fastone Shopify Partner www.motion-effect.no
Posts:
50
5 months ago

I'm getting whippet about getting this done. And I know some people have been working on this issue before. 

Anyone able to lead me on to a solution?

<3

Johnny  Webdesigner www.motion-effect.no
Posts:
128
Last edited 5 months ago

I'm still not 100% on what you're after, but I'll offer some solutions to what I think you're attempting.  Is there a reason you can't just cycle through the product's variants and output all variants?  This will output a drop down even if there's only one height option.

{% for variant in product.variants %}
    ...
{% endfor %}

You could use Metafields to add extra attributes to your product and output that.  But I'd say that's overkill.

You could use the 'split' function and include the height for every product in their description.

 

http://www.tapwellbathrooms.co.uk/collections/bathroom-furniture
Fastone Shopify Partner www.motion-effect.no
Posts:
50
5 months ago

Hey Tapwell, 

Thanks for giving it a try with me :)

Well, I'm not that good into coding, but I can try. It would maybe be so that I can also loop that, specifically for one variant? Like this:

 

{% for variant in product.variants.size %}
    ...
{% endfor %}

 

I did also refer to a link when I added this post, to show more in detail what I mean. Did that help?

Thanks, 

 

Johnny  Webdesigner www.motion-effect.no
Fastone Shopify Partner www.motion-effect.no
Posts:
50
5 months ago

Bumbing this one,

Why doesnt Shopify show the size of a product, even if there is just one size on the current product?

Johnny  Webdesigner www.motion-effect.no
Fastone Shopify Partner www.motion-effect.no
Posts:
50
5 months ago

 

Damn, seems like I finally figured this one out. 

I changed not only this line in product.liquid:

 

{% if product.variants.size > 1 %}

To this:

 

{% if product.variants.size > 0 %}

 

But the same line further down, just before the Javascript opens. 

Close. 

Johnny  Webdesigner www.motion-effect.no
Posts:
18
5 months ago

Thanks, this helped me too :-)

 

Fastone Shopify Partner www.motion-effect.no
Posts:
50
5 months ago

That's good. Finally I could help someone :)

Happy newyear'n all that. 

Johnny  Webdesigner www.motion-effect.no

Log in or sign up for an account to reply.