Skip to content

Instantly share code, notes, and snippets.

@odessy
Created May 6, 2026 01:50
Show Gist options
  • Select an option

  • Save odessy/f56cb28bc065e85ef7a40b44a56b3a22 to your computer and use it in GitHub Desktop.

Select an option

Save odessy/f56cb28bc065e85ef7a40b44a56b3a22 to your computer and use it in GitHub Desktop.
Custom quick view product link
{%- assign button_text = 'products.product.add_to_cart' | t -%}
{%- if card_product.metafields.theme.preorder.value == true -%}
{% comment %} Add a line item property with 'Sale type: Pre-order' and make the button say 'Pre-order'{% endcomment %}
{%- assign button_text = 'products.product.pre_order' | t -%}
{%- endif -%}
{%- unless card_product.selected_or_first_available_variant.available -%}
{%- assign button_text = 'products.product.sold_out' | t -%}
{%- endunless -%}
<a href="{{ card_product.url }}" class="product-clip__btn btn--soft btn--small btn--primary">
<span>{{ button_text }} </span>
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment