TABLE OF CONTENTS
- Introduction
- Types Of Discounts
- General Considerations
- Discount Distribution Workflow
- Steps To Calculate And Distribute Discount Amounts For Line Item Total Or Sub Total
- Step 1 Check if any CSR discount was applied before
- Step 2 If the discount is a Line Item Discount
- Step 3 If the discount is a CSR Discount or Order Discount
- Step 4 Distribute discount amounts
- Step 5 Calculate the Maximum Applicable Discount (MAD)
- Step 6 Apply CSR Discount again
- Step 7 Calculate discount amounts for Order Summary
- Steps Followed To Calculate And Distribute Discount Amounts For Shipping
- Steps To Calculate And Distribute Discount Amounts For Line Item Total Or Sub Total
- Example Of Discount Distribution Workflow
Introduction
This article provides information about how the different types of discounts are applied and distributed among the line items from the Znode 9.7 release.
Note: This article does not provide information about the eligibility criteria for different discounts (i.e. promotions, coupons, and CSR discounts) for Orders.
Types Of Discounts
In Znode, discounts are categorized into the following:
- Line item discounts
- These discounts can be created and applied in the form of promotions or coupons over the line item Total (i.e. Unit Price * Quantity)
- The following types of promotions/coupons come under line item discounts:-
- Amount Off Product
- Amount Off X If Y Is Purchased
- Amount Off Brand
- Amount Off Category
- Amount Off Catalog
- Percent Off Product
- Percent Off Brand
- Percent Off Category
- Percent Off Catalog
- Percent Off X If Y Is Purchased
- Order discounts
- These discounts can be created and applied in the form of promotions, or coupons, or CSR discounts over the Subtotal (i.e. sum of all line item Total)
- The following types of promotions/coupons come under order discounts:-
- Amount Off Order
- Percent Off Order
- Shipping discounts
- These discounts can be created and applied in the form of promotions, or coupons over the Total Shipping (i.e. sum of all line item Shipping)
Note: No discounts are applied over Handling Charges - The following types of promotions/coupons come under order discounts:-
- Amount Off Shipping
- Amount Off Shipping With Carrier
- Percent Off Shipping
- Percent Off Shipping With Carrier
- These discounts can be created and applied in the form of promotions, or coupons over the Total Shipping (i.e. sum of all line item Shipping)
General Considerations
- When any promotion/coupon-based discount is applied,
- Promotions get applied automatically first based on the display order i.e. promotion with the lowest display order is applied first and so on
- Coupons can be applied manually after all promotions are automatically applied. The sequence in which coupons are applied is considered the final sequence for calculating the discounts
- Since CSR discount can be edited during/after order creation, therefore it is given the last priority. Therefore always promotions will be applied first, then coupons, and then CSR discount
- All types of discounts can be applied during order creation/management, except only Shipping promotions can be applied automatically when a Shipping Method or Shipping Address is changed for an Order. Other promotions cannot be applied while managing the order
- Before any discounts are applied, the application calculates and saves Maximum Applicable Discount (MAD) which indicates the maximum amount from the calculated discount value that can be applied to the line items or order or shipping. The initial value of MAD is the original total associated with line items, orders, and shipping respectively.
- If while managing an order, the admin user either changes the Shipping Type or Shipping Address-zipcode or line item Shipping amount then the Shipping discount gets removed. In this scenario, Maximum Applicable Discount (MAD) for Shipping gets reset to its original value.
- When an Order is being created the values of the following settings are taken into consideration for calculating the discount amounts:
- Allow Promotions & Coupons Together
- Promotions With Exceptions
Note: The same are not considered when a discount is applied while managing an Order
Discount Distribution Workflow
Steps To Calculate And Distribute Discount Amounts For Line Item Total Or Sub Total
Whenever a new eligible discount (Line Item/Order Promotion Coupon, or CSR Discount) is applied while creating an Order from the admin application or web store, or while managing an Order from the admin application, the Znode application performs the below steps to decide the maximum discount amount that will be applied and distributed among the line items:
Step 1 Check if any CSR discount was applied before
- Application checks if any CSR discount was applied before the new discount was applied. If a CSR discount was applied, then follow Step 1.2 and the following steps, otherwise follow Step 1.4
- Removes the complete CSR discount and the amounts distributed among the line items
- Considers the last MAD for the line item total and subtotal
- Moves toward either of the following:
- if the applied discount is a Line Item Discount
- if the applied discount is a CSR Discount or Order Discount
Step 2 If the discount is a Line Item Discount
- Checks if Discount Amount Calculated By Application > Line Item’s MAD. If the discount amount calculated by the application is greater, then follow Step 2.2 and the following steps, otherwise follow Step 2.4 and the following steps
- Sets Discount Amount Of Line Item For The Applied Discount = Line Item’s MAD
- Follows Step 5
- Sets Discount Amount Of Line Item For The Applied Discount = Discount Amount Calculated By Application
- Follow Step 5
Step 3 If the discount is a CSR Discount or Order Discount
- Checks if Discount Amount Calculated By Application > Subtotal’s MAD. If the discount amount calculated by the application is greater, then follow Step 3.2 and the following steps, otherwise follow Step 3.4 and the following steps
- Sets Discount Amount Of Subtotal For The Applied Discount = Subtotal’s MAD
- Follows Step 4
- Sets Discount Amount Of Subtotal For The Applied Discount = Discount Amount Calculated By Application
- Follow Step 4
Step 4 Distribute discount amounts
- Calculates Discount Multiplier (DM) using this formula- Discount Amount Of Subtotal For The Applied Discount / Subtotal’s MAD
- Calculates every line item’s distributed discount amount using this formula- DM * Line Item’s MAD
- Follow Step 5
Step 5 Calculate the Maximum Applicable Discount (MAD)
- Calculates every line item’s new MAD using this formula- Line Item’s MAD - Calculated or Distributed Discount for the line item
- Calculates subtotal’s new MAD using this formula- Subtotal’s MAD - Calculated Discount for the subtotal
- Follow Step 6
Step 6 Apply CSR Discount again
- If during Step 1, the previously applied CSR discount was not removed (for a scenario when CSR discount is applied), then follow Step 7, otherwise follow Step 3
Step 7 Calculate discount amounts for Order Summary
- Calculates the value of “Discount” displayed in the order summary using this formula- Total Line Item Discount + Total Order Discount
- Calculates the value of “CSR Discount” displayed in the order summary
Steps Followed To Calculate And Distribute Discount Amounts For Shipping
Whenever a new eligible shipping discount (Promotion or Coupon) is applied while creating an Order from the admin application or web store, or while managing an Order from the admin application, the Znode application performs the below steps to decide the maximum discount amount that will be applied and distributed among the line items:
Step 1 If the discount is a Shipping Discount
- Checks if the Discount Amount Calculated By Application > Total Shipping’s MAD. If the discount amount calculated by the application is greater, then follow Step 1.2 and the following steps, otherwise follow Step 1.4 and the following steps
- Sets Discount Amount Of Total Shipping For The Applied Discount = Total Shipping’s MAD
- Follow Step 2
- Sets Discount Amount Of Total Shipping For The Applied Discount = Shipping Discount Amount Calculated By Application
- Follow Step 2
Step 2 Distribute discount amounts
- Calculates Discount Multiplier (DM) using this formula- Discount Amount Of Total Shipping For The Applied Discount / Total Shipping’s MAD
- Calculates every line item’s distributed discount amount using this formula- DM * Line Item Shipping’s MAD
- Follow Step 3
Step 3 Calculate the Maximum Applicable Discount (MAD)
- Calculates every line item shipping’s new MAD using this formula- Line Item Shipping’s MAD - Calculated or Distributed Shipping Discount for the line item Shipping
- Calculates Total Shipping’s new MAD using this formula- Total Shipping’s MAD - Calculated Shipping Discount for the Total Shipping
- Follow Step 4
Step 4 Calculate discount amounts for Order Summary
- Calculates the value of “Shipping Discount” displayed in the order summary using this formula- Sum of Line Item Shipping Discounts
Example Of Discount Distribution Workflow
Discount Details:
Sequence of application | Discount | Discount Amount/Percentage | Criteria |
1 | Amount Off Order promotion | $150 | Minimum order amount = $150 |
2 | Percent Off Category “Power Tools” | 10% | Minimum order amount = $0 Applicable on “DeWalt 1/4 Impact Driver” |
Cart Details:
Product | SKU | Unit Price | Quantity | Total (Unit Price * Quantity) |
Demolition Gloves | z-2100010 | $50 | 1 | $50 |
DeWalt 1/4 Impact Driver | z-2100015 | $89 | 1 | $89 |
Subtotal | $139 | |||
Tax | $14 | |||
Shipping | $5 | |||
Order Total | $158 |
Maximum Applicable Discount (MAD) amounts:
Demolition Gloves’ MAD is $50
DeWalt 1/4 Impact Drive’s MAD is $89
Subtotal’s MAD is $139
Discount Distribution:
Discount 1: $150 Off Order
Step 1: No CSR Discount was applied previously
Step 2: Not a line item discount
Step 3: Since the calculated order discount is greater than Subtotal’s MAD, therefore Order Discount = Subtotal’s MAD = $139
Step 4: Discount Multiplier (DM) = $139/$139 = 1
Line item order discount for Demolition Gloves = 1 * $50 = $50
Line item order discount for DeWalt 1/4 Impact Driver = 1 * $89 = $89
Step 5: New Line item’s MAD for Demolition Gloves = $50 - $50 = $0
New Line item’s MAD for DeWalt 1/4 Impact Driver = $89 - $89 = $0
New Subtotal’s MAD = $139 - $139 = $0
Step 6: Since no CSR Discount was applied previously, therefore, it should not be applied again
Step 7: Discount =$139
Discount 2: 10% Percent Off Category “Power Tools”
No further discounts are applicable since MAD for DeWalt 1/4 Impact Driver is $0. Therefore the final Cart Details are: