How to use cart attributes to apply discounts (custom discount)
This guide explains how to trigger a discount based on specific "cart attributes"—hidden data fields that are added to the cart by other apps or theme customizations (e.g., a gift message field, or an identifier from a specific app).
1. Identify the Cart Attribute Key and Value
Before creating the discount, you need to know the exact key
and value
of the attribute you want to target. This information typically comes from the app or customization that adds the attribute to the cart. For example, an attribute key
might be 'gift message'
or 'internal GL Pro app'
with a value
of true
.
2. Set Up the Discount Rule
- In the Kite app, start a new promotion using the Custom Discount Builder.
- Navigate to the Eligibility Rules section of the campaign setup.
- Under the "Cart rules" category, select the Cart Attributes option.
- You will see fields to define the attribute:
- In the first field, enter the attribute key (e.g.,
internal GL Pro app
). - Choose the operator (e.g., is).
- In the second field, enter the attribute value you want to match (e.g.,
true
).
- In the first field, enter the attribute key (e.g.,
3. Configure and Save the Discount
- Set up the rest of your promotion, defining which products the discount applies to and the discount amount or percentage.
- Click Save.
Now, the discount will only apply to carts that contain the exact attribute key and value you specified.
Excluding Carts with Specific Attributes
You can also use this rule to prevent a discount from applying. To do this, simply choose the "is not" operator when setting up the rule in Step 2. The discount will then be blocked for any cart containing that specific attribute.
Updated on: 14/08/2025
Thank you!