Skip to content

Instantly share code, notes, and snippets.

@carbone
Created June 10, 2018 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carbone/60484023c6876e4a7692c3b5e4848ed2 to your computer and use it in GitHub Desktop.
Save carbone/60484023c6876e4a7692c3b5e4848ed2 to your computer and use it in GitHub Desktop.
{% if product.metafields.custom_fields["availability"] != blank and
product.metafields.custom_fields["availability"] != 'Not applicable' %}
{% assign availability = product.metafields.custom_fields["availability"] %}
{% case availability %}
{% when '2 weeks' %}
{% assign message = 'This product usually ships in 2 weeks.' %}
{% when 'Immediately' %}
{% assign message = 'This product usually ships right away.' %}
{% endcase %}
<div class="custom-field custom-field__availability custom-field__type--text-list">
<strong class="custom-field--title">Availability</strong>
<div class="custom-field--value">
{{ message }}
</div>
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment