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, creating product bundles, 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
Create a bundleIt groups several items sharing a common attribute but set to different values.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

  1. Open the Rule Builder for your Campaign.

  2. Click Add Rules if there are no rules or cart item filters yet.

  3. Click Filter Cart Items at the top-right of the page.

    note

    If you have already created filters, click Add Filters in the Cart Item Filters section.

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

  5. Click Add Filter Step.

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

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

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

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

Product bundles

You can use product bundles to group several items sharing a common attribute but set to different values.

Product bundles are typically used to up-sell or cross-sell, offering a discount for customers if they combine items or services of the same kind or buy an entire set of products. You can decide how many items of each type make up the bundle. For example, you can set a discount on a bundle containing 1 pizza and 2 drinks, or on a bundle containing 1 pair of pants, 1 hat and 1 jacket.

You can also apply an additional filter step to your bundle to, for example, set a discount on only one of the items in it.

Examples

Let's create some campaigns with product bundles.

Issuing a discount on a bundle

Let's imagine that our business is a pizzeria and we want to issue a 10% discount whenever a customer orders 1 pizza and 2 drinks.

note

In this example, every item has a Category attribute, and pizza and drinks are possible values for the Category attribute.

  1. In the Rule Builder, click Filter Cart Items > Add Filter Step.
  2. Click Create a bundle.
  3. Set Bundle by attribute as Category. You pick it from the palette.
  4. For the bundle values, select 1 pizza and 2 drinks.
  5. Save it as pizza_and_drinks.
  6. In your Conditions, select Always Trigger Effects.
  7. In your Effects, select Discount individual items.
  8. Select pizza_and_drinks as the list of items the discount is applied to.
  9. Set a value for your discount. In our case, 10% off.

Issuing a discount on a bundle of matching items

Let's imagine that our business is an online clothing marketplace and we want to issue a 15% discount whenever a customer buys a pair of pants and a shirt from the same brand.

note

In this example, every item has a Category attribute and a Brand attribute, and pants and shirt are possible values for the Category attribute.

To do this, we use an Attribute matcher, a cart item custom attribute that allows us to select and group the items that are eligible for a given bundle. In this example, we select and group the items in the customer's cart by brand.

  1. In the Rule Builder, click Filter Cart Items > Add Filter Step.
  2. Click Create a bundle.
  3. Set Bundle by attribute as Category. You pick it from the palette.
  4. For the bundle values, select 1 pants and 1 shirt.
  5. In Attribute Matchers, select the attribute brand.
  6. Save it as matching_pants_and_shirt.
  7. In your Conditions, select Always Trigger Effects.
  8. In your Effects, select Discount individual items.
  9. Select matching_pants_and_shirt as the list of items the discount is applied to.
  10. Set a value for your discount. In our case, 15% off.

Issuing a discount on a single item from a bundle

Let's imagine that our business is a pizzeria and we want to issue a 30% discount on our pizzas whenever a customer orders 1 pizza and 2 drinks.

note

In this example, every item has a Category attribute, and pizza and drinks are possible values for the Category attribute.

  1. In the Rule Builder, click Filter Cart Items > Add Filter Step.
  2. Click Create a bundle.
  3. Set Bundle by attribute as Category. You pick it from the palette.
  4. For the bundle values, select 1 pizza and 2 drinks.
  5. Click Add Filter Step and select Filter items by condition.
  6. Choose Condition: Item category and set it as equal to pizza.
  7. Save it as pizza_and_drinks.
  8. In your Conditions, select Always Trigger Effects.
  9. In your Effects, select Discount individual items.
  10. Select pizza_and_drinks as the list of items the discount is applied to.
  11. Set a value for your discount. In our case, 30% off.

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

You cannot delete a cart item filter if you are using it in a rule, as this would break the 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.

You see the filter disappear from the Cart Item Filters section.