Conditions for smart collections
You can add one or more conditions for a smart collection to match products based on many details, including product title or type, tags, price, or even inventory stock. Collections can have at most 60 conditions.
On this page
- Set conditions based on product title, variant title, type, or vendor
- Set conditions based on product category
- Set conditions based on product tags
- Set metafield definition conditions based on metafield values
- Set conditions based on metaobject reference metafields
- Set conditions based on price, weight, or inventory stock
- Using multiple selection conditions
- Set multiple conditions to define a range
Set conditions based on product title, variant title, type, or vendor
You can add a condition to include a product in a collection based on the product's title, variant title, type, or vendor. You can select from the options in the second drop-down list to control how a product needs to match the condition value that you enter in the third field. The text that you enter in the third field is compared to your products according to the condition's settings, and matching products are included in the collection. The condition is not case-sensitive.
You can select from the following options to control how a product needs to match the condition value that you enter:
Term | Description |
---|---|
is equal to | A product needs to match exactly the whole value you enter. |
is not equal to | A product can't match the value you enter. |
starts with | The beginning of the product title, type, or vendor matches the value you enter. |
ends with | The end of the product title, type, or vendor matches the value you enter. |
contains | The product title, type, variant title, or vendor contains the value you enter. You need to specify a value that is at least 3 characters long, and the value can't start or end with spaces. |
does not contain | The product title, type, variant title, or vendor doesn't contain the value you enter. You need to specify a value that is at least 3 characters long, and the value can't start or end with spaces. |
Conditions for variants
If you set up a condition for a product that has variants, then that condition is true whether any variant matches the condition. This applies whether all conditions or any condition is selected.
For example, suppose you have a product that has five variants. Four of the variants have inventory, but one is out of stock. If you have a collection that has a condition of Inventory stock is greater than 0
, then the product is included in the collection because at least one of the variants matches the condition.
Set conditions based on product category
You can set a condition to include products with a particular product category. For a condition that uses product category, select the desired category from the drop down.
For example, to set up a condition that selects products with the product category Televisions
:
- Select Product category from the first drop-down list.
- Select is equal to from the second drop-down list.
- Select
Televisions
Set conditions based on product tags
You can set a condition to include products with a particular product tag. When a condition uses product tags, you need to enter the exact tag as a condition value.
For example, to set up a condition that selects products tagged with accessories
:
- Select Product tag from the first drop-down list.
- Select is equal to from the second drop-down list.
- Enter
accessories
.
Although you can create tags that use some special characters, they might not work as you expect in searches or as conditions in smart collections. Special characters in tags are either ignored or are treated as being the same.
Example: Suppose you have a condition for a smart collection of Product tag is equal to red-new. All products that have the following tags are also included in the collection: red_new
, red+new
, red&new
.
For more information about tags, see Tag formats.
Set metafield definition conditions based on metafield values
You can add a condition to include products or variant with a particular metafield value.
In order to have the metafields available to you when creating collections, you need to activate the smart collections setting for the metafield definition. You can have the smart collections setting activated on a maximum of 128 definitions per product metafield definitions and variant metafield definitions.
The first column of the drop-down list for your smart collection conditions is the name of your metafield definition. The second drop-down list or text box is your metafield values.
For example, to set up a condition that selects products with the metafield definition Color
and the value #FF0000
, do the following:
- Select
Color
from the first drop-down list. - Select is equal to from the second drop-down list.
- Enter
#FF0000
.
Learn more about smart collections by metafields.
Metafield types support the following conditions:
Metafield definition type | Conditions |
---|---|
True or false | The True or false metafield definition type supports the following conditions:
|
Integer | The Integer metafield definition type supports the following conditions:
|
Decimal | The Decimal metafield definition type supports the following conditions:
|
Rating | The Rating metafield definition type supports the following conditions:
|
Single line text | The Single line text metafield definition type can be a single value or a list of values and supports the following conditions:
|
Set conditions based on metaobject reference metafields
You can add a condition to include a product in a collection based on the value of a metaobject reference metafield. You can set conditions for both product and variant metaobject reference metafields.
For example, to set up a condition that selects products with the metaobject reference metafield Material
that has the value Cotton
, do the following:
- Select
Material
from the first drop-down list. - Select is equal to from the second drop-down list.
- Select
Cotton
.
This functionality enables you to create smart collections that are based on standard taxonomy attributes.
Set conditions based on price, weight, or inventory stock
You can add a condition to include a product in a collection based on its price, compare-at price, weight, or inventory. You can set the condition to include products that match its value exactly, or products that are greater or less than its value:
Term | Description |
---|---|
is equal to | A product needs to match the exact value. |
is not equal to | A product can't match the value. |
is greater than | The product is greater than the value. |
is less than | The product is less than the value. |
is empty |
Compare-at price only: The product doesn't have a Compare-at price value. |
is not empty |
Compare-at price only: The product does have a Compare-at price value. This value can be zero. If any of a product's variants has a Compare-at price value, then the product is considered to have a Compare-at price. |
For example, to set up a condition that includes products that are priced $100 or less:
- Select Product price from the first drop-down list.
- Select is less than from the second drop-down list.
- Enter
$100.01
.
Using multiple selection conditions
You can set more than one selection condition to control which products are included in a collection. You can choose whether products must match all the conditions to be included in the collection, or any of the conditions.
For example, suppose that you set the two following conditions for a collection:
- Product tag is equal to
shirt
. - Price is less than
$100.01
.
If you select all conditions, then products are included only if they are tagged with shirt
and are also priced at $100 or less. Products need to match both conditions to be included in the collection.
If you select any condition, then products are included if they are tagged with shirt
or if they are priced at $100 or less. Products need to match only one condition to be included in the collection.
Set multiple conditions to define a range
To include the products with a price, weight, or inventory value within a range, you need to set more than one condition. The low end of the range is defined in one condition, and the high end of the range in another. You need to select all conditions to include only the products that fall within the range.
For example, to set up a collection that includes products priced within a range of $50-$150, you would set up the two following conditions:
- Product price is greater than
$49.99
. - Product price is less than
$150.01
.