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.
There are different types of filters. The available filters appear sorted by these categories:
- Filter & sort
Filter & sort
|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 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|
|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 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.
At the top of the Rule Builder page, click Filter Cart Items.note
If you have already created filters, click Add Filters 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.note
This 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.note
Add 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
Open the Rule Builder for your campaign.
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 the trash bin symbol to the right of each step.note
You 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.
You see the filter in the Cart Item Filters section, over the Rule Builder.
Deleting a cart item filter
A cart item filter cannot be deleted while it's being used in a rule.
- Open the Rule Builder for your campaign.
- In the Cart Item Filters section, click the trash bin symbol to the right of the filter you want to remove.
The filter disappears from the Cart Item Filters section.