View Categories

Shopify Pre-order metafield

< 1 min read

PreProduct has a Shopify pre-order metafield that can be used to target products when they are on pre-order.

The Shopify Product Metafield #

PreProduct automatically manages a Shopify metafield <boolean> on your products that lets you identify when they’re on pre-order. You can reference it from any Shopify liquid theme file where a product resource is available.

The metafield is:
– Added when a pre-order listing is created
– Removed when the listing is finished

Reference #
product.metafields.preproduct.preorder

Show Content only for Products on Pre-order #

Use this code to display elements only when a product is on pre-order:

{% if product.metafields.preproduct.preorder %} 
     This sentence only loads when the product is on pre-order.
 {% endif %}
Show Content for Products not on Pre-order #

Use this code to display elements only when a product is not on pre-order:

{% unless product.metafields.preproduct.preorder %} 
     This sentence only loads when the product is not on pre-order.
 {% endunless %}

Powered by BetterDocs

Pre-sell With PreProduct

7 day free trial with all plans