Creating and managing cart item filters
Cart item filters allow you to use the items in your customers' carts in different ways to create more selective rules. For example, counting the cart items, selecting specific ones or sorting them by size, quantity, price or any other characteristics relevant to your business.
A filter generates either:
- A new list.
- A boolean value.
- A number calculated from the expression of your choice.
- A reference to a cart item.
You can use this result in your conditions or effects to create more advanced rules.
You need cart item filters to create promotion rules in item campaigns and to create strikethrough rules.
There are different types of filters. The available filters appear sorted by these categories:
- Filter & sort
- Select
- Calculate
- Check
Filter & sort
Filter name | Description | Result |
---|---|---|
Filter items by condition | It filters items by the value of a certain attribute, such as price or name. | List |
Sort items by attribute | It sorts items in descending or ascending order. | List |
Select
Filter name | Description | Result |
---|---|---|
Select the first No. of items | It selects the first items from a list. You can choose how many items are selected. | List |
Select one item | It selects one item at the position of your choice in a list. | Cart item |
Select by attribute value | It creates a list by selecting those items matching a certain attribute. | List |
Select the biggest number | It selects the biggest number out of a list of numbers. | Number |
Select the smallest number | It selects the smallest number out of a list of numbers. | Number |
Calculate
Filter name | Description | Result |
---|---|---|
Sum up cart items' attributes | It defines a mathematical operation to be performed on each cart item and gets the sum of each result. | Number |
Counts the number of items in the list | It counts the number of items in a list. | Number |
Sum up these numbers | It sums up the numbers returned by a previous filter step. | Number |
Check
Filter name | Description | Result |
---|---|---|
Check for empty lists | It indicates whether a list is empty. | Boolean |
Creating a cart item filter
For performance reasons, we recommend creating a maximum of 4 cart item filters per campaign.
-
On the left-side menu of your campaign, click Rule Builder.
-
In the top-right corner of the page, click Filter Cart Items.
noteIf you have already created filters, click Add Filter in the Cart Item Filters section.
-
(Optional) If you have created a filter resolving in a list of cart items, use Start with this list of cart items to select a saved filter as the list you apply new filter steps to.
noteThis feature improves the performance of the campaign rules evaluation and reduces the risk of making mistakes when creating new filters from cart item lists.
-
Click Add Filter Step.
-
Select a type of filter and define the required values.
-
(Optional) Click Add Filter Step to sort the items selected on the first step. You can add as many steps as you wish.
noteAdd filter steps in the order that you want to apply them. Only the filters that can be applied to the previous step are available to you.
-
In Save As, type a name for your filter. This is how it will appear in the Rule Builder.
-
Click Save Filter.
The filter is created and you can use the following attributes for it:
- <Filter name> item count
- <Filter name> total price
Editing a cart item filter
-
On the left-side menu of your campaign, click Rule Builder.
-
In the Cart Item Filters section, click the filter you want to modify.
-
Edit the required information. You can also add filter steps or remove them by clicking to the right of each step.
noteYou cannot rename a cart item filter if you are using it in a rule or in another filter. A lock symbol appears by the filter.
-
Click Save Filter.
Deleting a cart item filter
A cart item filter cannot be deleted while it's being used in a rule.
- On the left-side menu of your campaign, click Rule Builder.
- In the Cart Item Filters section, click to the right of the filter you want to remove.