Number Calculation Conditions
This article explains how to use number calculation conditions to create powerful, flexible discounts. Calculations let you define a number dynamically and store it in a variable for future comparisons.
đ˝ď¸ Click the thumbnail above to watch a video demonstration.
Example Use Cases
- âApply a discount if quantity of Product A is 3Ă the quantity of Product Bâ
- âCalculate total quantity of products in Collection X and store it for laterâ
- âCreate tiered discounts based on the sum of specific quantitiesâ
What Are Calculations?
Calculations are a type of condition that compute a number and assign it to a variable. You can then:
- Reference that variable later in your logic
- Use arithmetic (+, â, Ă, á)
- Work with dynamic values like product quantities, cart totals, or other calculations
How to Use It
1. Add a Calculation
- In the Logic Builder, click Add Criteria
- Select Calculate a Number
2. Configure the Expression
- Use math operators to combine terms
- Example:
â Quantity of Product A
Ă 3
= quantity_times_three
- This assigns a variable called
quantity_times_three
3. Use the Result
- Add a Compare Numbers condition
- Left side:
Quantity of Product B
- Right side: the variable
quantity_times_three
- Now the logic says: âOnly apply the discount if quantity of B equals 3Ă Aâ
Notes
- You can combine constants, quantities, and even other calculated values
- Calculations donât do anything on their ownâthey must be used later in a condition
- Use clear variable names so the logic is easy to follow
Your Feedback Matters
Your review helps keep this small business running. Please leave one on the Shopify App Store.
Updated on: 07/07/2025
Thank you!