Shopify themes, liquid, logos, and UX
Hello,
I'm using Dawn theme version 12, I'd like to show, on the catalog page, the list of the options (not variant) for every products (es: size S, M, L, XL; color red, green, blue). Is it possibile adding code on card-product.liquid?
I can get the list of variant with this code
{% for variant in card_product.variants %} {{ variant.title }} {% endfor %}
But can I get the list of options?
Solved! Go to the solution
This is an accepted solution.
Hello @Delio
Please use the following liquid code in order to get the list of options:
{% if card_product.options.size > 0 %}
{% for product_option in card_product.options_with_values %}
- {{ product_option.name }} :
{% for product_option_val in product_option.values %}
{{ product_option_val }},
{% endfor %}
{% endfor %}
{% endif %}
Please hit Like and Mark it as a Solution if you find our reply helpful.
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Shopify Partner | Shopify Development Agency | Call: 877.536.3789
Canada: 150 King St W. STE 200, Toronto, ON M5H 1J9
| USA: 98 Cutter Mill Rd. STE 466, Great Neck, NY 11021
Hi, @Delio have you tried to visit the documentation from Shopify?
There are view properties you can access in the variant, you can refer to this documentation: https://shopify.dev/docs/api/liquid/objects/variant
This is an accepted solution.
Hello @Delio
Please use the following liquid code in order to get the list of options:
{% if card_product.options.size > 0 %}
{% for product_option in card_product.options_with_values %}
- {{ product_option.name }} :
{% for product_option_val in product_option.values %}
{{ product_option_val }},
{% endfor %}
{% endfor %}
{% endif %}
Please hit Like and Mark it as a Solution if you find our reply helpful.
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Shopify Partner | Shopify Development Agency | Call: 877.536.3789
Canada: 150 King St W. STE 200, Toronto, ON M5H 1J9
| USA: 98 Cutter Mill Rd. STE 466, Great Neck, NY 11021
Thank you, it works
Find Global Growth Opportunities For Your Business with Shopify AcademyLearn how to exp...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025