Skip to content

Instantly share code, notes, and snippets.

View sweethoneycode's full-sized avatar

Jonah Brown sweethoneycode

View GitHub Profile
<p>Measurement <span>{{ product.metafields.my_fields.measurement.value }}</span><span>{{ product.metafields.my_fields.measurement.unit }}</span></p>
Is this available?
{% if product.metafields.my_fields.pre_order == true %}
YES
{% else %}
No
{% endif %}
{%- comment -%}
Not for Online store 2.0 Themes
{%- assign product_date = product.metafields.my_fields.datetime -%}
{%- comment -%}
Color Metafield and attributes
{%- endcomment -%}
{%- if product_date -%}
<p>Pre-order: {{ product_date.value | time_tag: format: 'date' }}</p>
@sweethoneycode
sweethoneycode / color-metafield.liquid
Last active November 14, 2021 15:22
Color Metafield
{%- comment -%}
variable to hold color
{%- endcomment -%}
{%- assign product_color = product.metafields.my_fields.color -%}
{%- comment -%}
Color Metafield and attributes
{%- endcomment -%}
@sweethoneycode
sweethoneycode / gist:e66a1849f3e11ec0580eac64478d3e5f
Created July 14, 2019 16:03
align images vertically and horizontally
.directory-img-container {
display: flex;
align-items: center;
justify-content: center;
}
<br>
<div class="custom-avail-field">
{% if current_variant.available %}
{{ 'products.product.remaining' | t }}: <span id="inventoryQuantity">{{ current_variant.inventory_quantity }}</span>
{% endif %}
</div>
<div class="custom-avail-field">
{% if current_variant.available %}
Weight: <span id="inventoryWeight">{{ current_variant.weight }} grams</span>