How can I display only the color variant number on my collection pages?

Hello,

I currently have my collection pages displaying the total number of variants available using the code below. It is inserted on my ‘card-product’ liquid file.


            {%- if card_product.variants.size > 1 -%}

            {{ card_product.variants | size }} options available

            {%- endif -%}

Now what I am trying to do is specifically pull the color variant number data, so it only shows the number of color variants. Any help? Or can somebody point me to the documentation on referencing product data.

I’m on Dawn 5.0.

Thank you

1 Like

Did you ever figure this out?

1 Like

I did, I wasn’t far off with the code I posted. Though we went a different direction and didn’t not use the feature. I will try and track down a snippet.

1 Like