Shopify themes, liquid, logos, and UX
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:
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.
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 %}
User | RANK |
---|---|
186 | |
168 | |
78 | |
56 | |
45 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023