DAWN THEME - add product size to collection page

Hi there!

I would like to add the product size on the collection page.

I would like the product size to be show on the collection page.

I would like to see it displayed after the title of the product.

There would be a comma after it, for example:

“Zara Women’s Black Boots, size 39”.

I only have one size per product, and it is stored under Variant.

Example below:

Here is the link and password:

https://instantcrush.co/

pw: mewnaw

Thank you!

Hi,

To do that you need knowledge of code to customize.

First, you need to go to snippets/card-product.liquid, then find line 118 and replace the code here with the code below:

{%- assing variant_name = "" -%}
{% for variant in product.variants %}
      {%- assing variant_name = variant.title -%}
{% endfor %}
{% if variant_name != "" %}
{{ card_product.title | escape }} - {{ variant_name }}
{% else %}
{{ card_product.title | escape }}
{% endif %}

If you don’t implement yourself, you can ask to developer help you do that.

1 Like

Cool I will try this!

Here is line 118. Could you let me know where exactly I should paste your code? Thanks Joseph!

ok i see, so you need to replace the code in red box with new code bellow.

{%- assing variant_name = "" -%}
{% for variant in card_product.variants %}
      {%- assing variant_name = variant.title -%}
{% endfor %}
{% if variant_name != "" %}
{{ card_product.title | escape }} - {{ variant_name }}
{% else %}
{{ card_product.title | escape }}
{% endif %}