Rule: Metafield Trigger
You can easily show blocks based on a pre-defined metafield that Checkout Blocks supports using the following metafield configuration as a metafield definition:
Namespace
checkoutblocks
Key
trigger
Type
Single line text
Supported resources
Company, Customer, Product
It's important that these metafields get created as a definition. Also, make sure to expose the metafield definition to the storefront:
Then simply select the associated metafield rule on a particular block:
Product metafield trigger
How to trigger a block based on product metafield
You can easily trigger a checkout block based on a product metafield. The one caveat is that at this time, the metafield must be using the namespace: checkoutblocks and the key: trigger.
- First, navigate to a product within your Shopify admin. At the bottom of the page you will see a metafield section with the "Checkout Blocks Rule Trigger" pinned.
- Add a value:
- Add the "Product metafield" rule to a checkout block with the same value: