How do I change my product label to say what i have assigned in the custom metafield
I have a custom single line text metafield set up as ‘custom.product_badge’ which includes ‘coming soon’ ‘staff pick’ etc.
How do I make this come up instead of sold out on collection pages?
<product-item class=“product-item {% unless product.available %}product-item–sold-out{% endunless %}” {% if reveal %}reveal{% endif %}>
{%- capture product_labels -%}
{%- if product.metafields.custom_badges != blank -%}
{%- for custom_badge in product.metafields.custom_badges.value -%}
{{ product.metalfields.custom_badge }}
{%- endfor -%}
{%- else -%}
{%- for tag in product.tags -%}
{%- if tag contains ‘__label’ -%}
{{ tag | split: ‘:’ | last }}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- unless product.available -%}
{{ ‘collection.product.sold_out’ | t }}
{%- endunless -%}