Showing option names on collection page : Dawn Theme

Hi everyone.

I want to show quantity options on collection page, like 1, 5, 10 (-piece set), above the price.

Someone told me to use options_by_name on card-product.liquid below, so I tried but it didn’t work… it only shows empty span element.

{{ 'onboarding.product_title' | t }}

{% for value in product.options_by_name[‘quantity’].values %} {{ value }} {% endfor %}
{%- if show_vendor -%}
{{ ‘accessibility.vendor’ | t }}

{{ 'products.product.vendor' | t }}
{%- endif -%} {% render 'price' %}

It’s a bit tricky but when I put a plain test instead of liquid code to look into the problem, it didn’t show anything either. Precisely, I can see it it the source code, but not on the front page.

I have know idea why this happens…

Does anyone know how to fix this? Thank you in advance.

Hi @nayao

Please use this code

{{ collection.products_count }} {{ 'collections.general.items_with_count' | t: count: collections.general.items_with_count }}

Please like and accept the solution

Thank you

Thanks.

I think your code is to show the total number of the variation of the collection, is that right?

What I want to do is to show names (value) of options of the products so that customers can see the product has 3 options such as 1 piece, 5 piece set or 10 piece set, for example.

sorry if my question wasn’t clear.