Personalized checkout and custom promotions with Shopify Scripts
Hello,
I am new to Liquid, however, I have been searching the docs, and I am still having some trouble.
What would the syntax look like for sorting metafields by their unit of measurement? I have the metafields I want to display in the namespace `specs.`.
Here is the current liquid I have written:
{% if product_specs.size > 0 %}
<div id="specifications">
<ul>
{% for spec in product.metafields.specs -%}
<li><strong>{{ spec.first | capitalize }}</strong>: {{ spec.last.value }}</li>
{%- endfor %}
</ul>
</div>
{% endif %}
Here is the output:
Height: 55 mm
Weight: 2 oz
Width: 25 mm
So, I want Height and Width displayed next to each other, any thoughts or help on this would be greatly appreciated!
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025