What's your biggest current challenge? Have your say in Community Polls along the right column.

DAWN THEME - add product size to collection page

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)

DitalTek
Shopify Partner
794 95 111

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 you want to hire developer Theme or App Shopify => Feel free to send me a DM or contact to us via Email | WhatApp: +84 398999359
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

 

DitalTek
Shopify Partner
794 95 111

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 you want to hire developer Theme or App Shopify => Feel free to send me a DM or contact to us via Email | WhatApp: +84 398999359