Automated collections with metafields
Automated collectionsuse selection conditions to automatically include matching products. You can add up to 60 selection conditions in a single collection, and you can specify if products need to meet all conditions or any condition to be included in the collection.
Complete the following actions before you create an automated collection by metafields:
- add in your metafield definitions
- activate automated collections
- add the values to your products or variants
On this page
Benefits of automatic collections by metafields
Automated collections by metafields help you create more accurate collections for your products and variants compared to product tags. For example, you can set up a collection using the tags that includered
. However,red
is used for product color, andurgency-red
is used for fulfillment urgency. In this example, your collection would have products that are both the colorred
and have a fulfillment urgency ofurgency-red
, because they both includered
. In this example, tags aren't going to work for your colorred
collection.
Because metafields are part of your data model, you can integrate this same data across Shopify, such as your online store. You can use metafields to be more specific in your collections. You can create metafield definitions for color, and then create a collection that only pulls in products that have the color value you want for the collection. You can create a metafield definition that is for fulfillment urgency, and then create a collection that only pulls in products that are marked with an urgent fulfillment value. Metafields provide more flexibility and structure than tags.
Limitations
Automated collections by metafield conditions have the following limitations:
You can only use product or variant metafield definitions and values in your automated collections.
If you add a metafield to a variant and create an automated collection for that metafield, then your automated collection will pull in the whole product with the other variants.
Theactivate automated collectionssetting has a maximum of 128 definitions per product metafield definitions and variant metafield definitions.
You can't delete a metafield defintion until the collection is updated to remove the metafield definition as a condition.
Metafield defintions and supported condtions
Only certain metafield product and variant definitions are supported with specific conditions.
Metafield definition type | Supported conditions |
---|---|
True or false | equals |
Integer | equals greater than less than |
Decimal | equals greater than less than |
Rating | equals greater than less than |
Single line text (one value and list of values) | equals |
Activating the automated collections setting
To use a metafield definition for automated collections, you need to activate the setting in your metafield definitions.
Steps:
- From your Shopify admin, go toSettings>Custom data.
- Depending on the metafield definition you want to use for automated collections, select eitherProductsorVariants.
- Click the metafield definition that you want to use for your collection.
- SelectAutomated collections.
- ClickSave.
- From theShopify app, go to商店>Settings.
- Under商店settings中,选择Custom data.
- Depending on the metafield definition you want to use for automated collections, select eitherProductsorVariants.
- Tap the metafield definition you want to use for your collection.
- TapUse in automated collections.
- TapSave.
- From theShopify app, go to商店>Settings..
- Under商店settings中,选择Custom data.
- Depending on the metafield definition you want to use for automated collections, select eitherProductsorVariants.
- Tap the metafield definition you want to use for your collection.
- TapUse in automated collections.
- TapSave.
Learn more aboutcreating custom metafield definitions.
Create automated collections with metafield defintion conditions
You can add a condition to include products or variants with a particularmetafield.
The first column of the drop-down list for your automated collection conditions is the name of your metafield definition. The second column is your supported conditions, such asequals. The third column is for your metafield values and is a drop-down list or text box. Only metafield definitions with theautomated collections setting activateddisplay.
For example, to set up a condition that selects products with the metafield definitionColor
and the value#FF0000
:
Steps:
From your Shopify admin, go toProducts>Collections.
ClickCreate collection.
Enter a title and description for the collection.
In theCollection type部分中,点击Automatedand then do the following:
- Select whether products need to match all conditions or any condition to be included in the collection.
- Select
Color
from the first column drop-down. - Selectis equal tofrom the second column.
- Type
#FF0000
.
ClickSave. In theProductssection that's displayed, the products that match the conditions are automatically added to the collection.
- From theShopify app, go toProducts>Collections.
- Tap the
+
button. - Enter a title and description for the collection.
- ActivateAutomatically select products.
- TapAddnext toConditions.
- In theMetafieldssection, tap
Color
. - Tapis equal to.
- Type
#FF0000
. - TapSave.
- From theShopify app, go toProducts>Collections.
- Tap the
+
button. - Enter a title and description for the collection.
- ActivateAutomatically select products.
- TapAddnext toConditions.
- In theMetafieldssection, tap
Color
. - Tapis equal to.
- Type
#FF0000
. - TapSave.
Learn more aboutautomated collections.