DAWN THEME - add product size to collection page

AnaELW
Excursionist
20 0 3

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:

 

AnaELW_0-1697118880800.png

 

Here is the link and password:

https://instantcrush.co/

 

pw: mewnaw

 

Thank you!

 

 

Replies 3 (3)
JosephK
Shopify Partner
605 74 87

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.

 

You can please Like and Accepted Solution if my suggestion helpful. And if you want to customize or develop new feature on Theme or App => Contact to us via Email or Skype.
- Contact Support : Gmail | Skype: live:.cid.309f2fbaceec513
AnaELW
Excursionist
20 0 3

Cool I will try this!

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

 

AnaELW_0-1697124132698.png

 

JosephK
Shopify Partner
605 74 87

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

 

JosephK_0-1697125113117.png

{%- 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 %}

 

You can please Like and Accepted Solution if my suggestion helpful. And if you want to customize or develop new feature on Theme or App => Contact to us via Email or Skype.
- Contact Support : Gmail | Skype: live:.cid.309f2fbaceec513