Skip to main content

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.

There are different types of filters. The available filters appear sorted by these categories:

  • Filter & sort
  • Select
  • Calculate
  • Check

Filter & sort

Filter nameDescriptionResult
Filter items by conditionIt filters items by the value of a certain attribute, such as price or name.List
Sort items by attributeIt sorts items in descending or ascending order.List

Select

Filter nameDescriptionResult
Select the first No. of itemsIt selects the first items from a list. You can choose how many items are selected.List
Select one itemIt selects one item at the position of your choice in a list.Cart item
Select by attribute valueIt creates a list by selecting those items matching a certain attribute.List
Select the biggest numberIt selects the biggest number out of a list of numbers.Number
Select the smallest numberIt selects the smallest number out of a list of numbers.Number

Calculate

Filter nameDescriptionResult
Sum up cart items' attributesIt 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 listIt counts the number of items in a list.Number
Sum up these numbersIt sums up the numbers returned by a previous filter step.Number

Check

Filter nameDescriptionResult
Check for empty listsIt indicates whether a list is empty.Boolean

Creating cart item filters

note

For performance reasons, we recommend creating a maximum of 4 cart item filters per campaign.

  1. 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.

  2. (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.

  3. Click Add Filter Step.

  4. Select a type of filter and define the required values.

  5. (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.

  6. In Save as, type a name for your filter. This is how it will appear in the Rule Builder.

  7. Click Save Filter.

You see the filter in the Cart Item Filters section, over the Rules one.

Using filter shortcuts

You can create filters that calculate the total number of items and the total price of all the items directly from any cart item filter resulting in a list of cart items.

Once you have created at least one cart item filter whose result is a list:

  1. Open the Rule Builder for your campaign.
  2. In the Cart Item Filters section, click Filter shortcuts to the right of the required filter.
  3. Select an option from the drop-down:
    • Add item count filter
    • Add total price filter

You see the new filter at the bottom of the Cart Item Filters section.

Editing cart item filters

  1. Open the Rule Builder for your campaign.

  2. In the Cart Item Filters section, click the filter you want to modify.

  3. 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.

  4. Click Save Filter.

You see the filter in the Cart Item Filters section, over the Rule Builder.

Deleting cart item filters

A cart item filter cannot be deleted while it's being used in a rule.

  1. Open the Rule Builder for your campaign.
  2. 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.