In this article, you'll learn how to use the Cart Item Filter feature.
In the Rule Builder, you can "Filter Cart Items" to create more selective rules for specific items in a customer's cart. You can then use the outcome of the filters in your conditions and effects to create different types of discounts, product bundles and selective rewards based on characteristics such as quantity, price, size or any other defining attributes you use in your business.
Creating A Cart Item Filter
Follow these steps to create a Cart Item Filter:
- Navigate to the Rule Builder and click +Add Rule
- Click on Filter Cart Items, located in the right corner of the Conditions panel
- Click +Add Filter Step and select a filter type for your cart items
- Add as many Filter Steps as you need for your specific requirements
- Name your filter something obvious (the name will appear as an available attribute in your conditions or effects)
- Important: Don't use spaces in the filter name:
- CartFilter or cart_filter ✅
- (NOT Cart Filter, cart-filter or cart.filter)
- Click Save Filter
Using Cart Filters
Depending on what data you send Talon.One, you can create Cart Item Filters to use in your Conditions and Effects to build rules. Choose from one or multiple Filter Steps in the drop-down menu to define how the information of a customer's cart can be used.
The available transformation steps include:
- Filter items (by condition): Select specific items in "Product Category", "Item Category", "Item SKU" or any custom attribute you have defined (e.g., item colour) using operators and variables
- Sort items by attribute: Used to sort items by ascending or descending order
- Sum up cart items' attributes: To calculate the total price or total quantity of items in the list
- Select an attribute: Extract the attribute from each cart item and make a list with these attributes
- Count number of items: To give a discount on a specific number of items.
- Check for empty lists: Check if the cart is empty
- Select the first No. of items: Pick the first amount of items in an ordered list
- Select one item from the list: Choose a single item from a list in a certain position
- Create a bundle: Create a bundle from items on the list with matching attribute descriptions
Some things to keep in mind:
- Filter Steps need to be added in the order they will happen, only filter steps that are possible will appear (e.g Select one item from the list can't be followed by any other filter step because it isn't possible to filter a single item any further)
- Editing the first step of a filter will make the following filter steps disappear (they must be added again)
- Filters are "locked" once they are used in condition or effect (this will break the rule)
- Multiple Cart Item Filters can be saved within a rule but these filters only apply to a single rule.
Example 1: Filter for Items in the Cart
- Click +Add Filter Step and select Filter items (by condition)
- The default attribute is "Item Category", but you can choose from any item attribute available in the palette like Name, SKU, Weight, Category, Quantity, etc. or from a custom attribute you have added like "Sale Item" or "Item Colour"
- Choose an operator (is equal to, contains, matches RegExp, ends with, does not contain, etc.)
- Enter in your required value like a specific SKU number, or a category name like "sweater"
- Type in a recognizable name with only letters, numbers or underscores (e.g. Sweater_123)
- And save your filter.
It should look something like this:
Now you can use this cart filter that you made in your campaign in a range of effects (Set an item discount for example).
Here's how to give a 20% discount for any sweaters in your customer's cart:
Click the blue + button to add variables or attributes to your discount formula. For example, add the variable "Shipping Cost" if you want to offer free shipping for buying a specific item.
This is just one of many ways you can create unique and personalized promotions.
Example 2: Filter Item Quantity
- Click +Add Filter Step and select Filter items (by condition)
- Select your attribute, operators and values (e.g., Item category equals "Jeans")
- Click +Add Filter Step and select Sum up cart items' attributes
- In the field choose the variable "Item Quantity" (delete the default Item Price)
- Type in a recognizable name with only letters, numbers or underscores (e.g. Jeans_Quantity)
- And save your filter
It should look like this:
*Important: "Item quantity" means the number of time 1 specific item is repeated (in this case, Jeans). You can also "count the number of items" in a cart. Which sounds similar, but is actually quite different.
Example:
- $10 Pizza (Quantity 3) = $30
- $12 Pizza (Quantity 2) = $24
- $3 Breadsticks (Quantity 5) = $15
Total Price = $69
Number of items in the order = 10
The filter to Count number of items looks like this when you select it from the +Add Filter Step list:
Once created, you can use this filter in a Condition like this:
And in this way, you can apply a discount to an order, only when it has 2 or more pairs of Jeans (or whatever you're selling)
Example 3: Filter for a Single Item in a List
- Click +Add Filter Step and select Filter items (by condition)
- Select your attribute, operators and values (e.g. "Sale Items" contains "Summer")
- Use your own Custom Attributes for more business-specific use case
- Add another condition with a unique attribute and set to is true
- Click +Add Filter Step and choose Select the first No. of items
- In the field select the 1st item
- Type in a recognizable name with only letters, numbers or underscores (e.g. Summer_Sale_Items)
- And save your filter
It should look something like this:
Now you can use this filter in your Effects and choose to give a discount on this item, make it free or whatever suits your requirements.
To make this item free, you can choose Set an item discount then select the cart filter from the drop-down and update the formula to "Item Quantity * Item.Price".
Example 4: Cart Filter with Attribute Suggestions
- Click +Add Filter Step and select Filter items (by condition)
- Select an attribute with predefined input suggestions
- Select the operator "is equal to" or "is not equal to"
- Select your preferred input from the drop-down list
- You can type free text or select "Add Variable" if your suggestion does not appear
- Add multiple attributes and filter steps as required.
- Give the filter a name and click save.
It will look like this:
If you are not familiar with using Attribute suggestions, read more here.
Conclusion
Cart Item Filters are a little confusing at first, but they are a very powerful feature for creating more granular and targeted campaigns. There are a variety of options for using filters to reach your campaign goals and create very complex promotions with very little effort.
To determine the best setup for your campaign, please get in touch and we'll happily provide the best recommendation for your specific use cases.
Next, you may want to read: