Discount Distribution Workflow For Creating And Managing Orders

TABLE OF CONTENTS

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 discount) for Orders.

Types Of Discounts

In Znode, discounts are categorized into the following:

  1. Line item discounts

    1. These discounts can be created and applied in the form of promotions or coupons over the line item Total (i.e. Unit Price * Quantity)

    2. The following types of promotions/coupons come under line item discounts:-

      1. Amount Off Product

      2. Amount Off X If Y Is Purchased

      3. Amount Off Brand

      4. Amount Off Category

      5. Amount Off Catalog

      6. Percent Off Product

      7. Percent Off Brand

      8. Percent Off Category

      9. Percent Off Catalog

      10. Percent Off X If Y Is Purchased

  2. Order discounts

    1. 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)

    2. The following types of promotions/coupons come under order discounts:-

      1. Amount Off Order

      2. Percent Off Order

  3. Shipping discounts

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

    2. The following types of promotions/coupons come under order discounts:-

      1. Amount Off Shipping

      2. Amount Off Shipping With Carrier

      3. Percent Off Shipping

      4. Percent Off Shipping With Carrier


General Considerations

  1. When any promotion/coupon based discount is applied,

    1. Promotions get applied automatically first based on the display order i.e. promotion with the lowest display order is applied first and so on

    2. Coupons can be applied manually after all promotions are automatically applied. The sequence in which coupons are applied is considered as the final sequence for calculating the discounts

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

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

  4. Before any discounts are applied, the application calculates and saves Maximum Applicable Discount (MAD) that 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, order, and shipping respectively.

  5. If while managing an order, admin user either changes the Shipping Type or Shipping Address-zipcode or line item Shipping amount then Shipping discount gets removed. In this scenario, Maximum Applicable Discount (MAD) for Shipping gets reset to its original value.

  6.  When an Order is being created the values of the following settings are taken into consideration for calculating the discount amounts:

    1. Allow Promotions & Coupons Together

    2. Promotions With Exceptions
      Note: The same are not considered when a discount is applied while managing an Order

Discount Distribution Workflow

Steps Followed To Calculate And Distribute Discount Amounts For Line Item Total Or Sub Total

Whenever a new eligible discount (Line Item/Order Promotion or Coupon, or CSR Discount) is applied while creating an Order from the admin application or web store, or while managing an Order from 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

  1. Application checks if any CSR discount was applied before the new discount was applied. If CSR discount was applied, then follows Step 1.2 and the following steps, otherwise follows Step 1.4

  2. Removes the complete CSR discount and the amounts distributed among the line items

  3. Considers the last MAD for the line item total and subtotal

  4. Moves towards either of the following steps:

    1. Step 2 if the applied discount is a Line Item discount

    2. Step 3 if the applied discount is a CSR Discount or Order Discount

Step 2 If the discount is a Line Item discount

  1. Checks if Discount Amount Calculated By Application > Line Item’s MAD. If the discount amount calculated by the application is greater, then follows Step 2.2  and the following steps, otherwise follows Step 2.4 and the following steps

  2. Sets Discount Amount Of Line Item For The Applied Discount = Line Item’s MAD

  3. Follows Step 5

  4. Sets Discount Amount Of Line Item For The Applied Discount = Discount Amount Calculated By Application

  5. Follows Step 5

Step 3 If the discount is a CSR Discount or Order Discount

  1. Checks if Discount Amount Calculated By Application > Subtotal’s MAD. If the discount amount calculated by the application is greater, then follows Step 3.2  and the following steps, otherwise follows Step 3.4 and the following steps

  2. Sets Discount Amount Of Subtotal For The Applied Discount = Subtotal’s MAD

  3. Follows Step 4

  4. Sets Discount Amount Of Subtotal For The Applied Discount = Discount Amount Calculated By Application

  5. Follows Step 4

Step 4 Distribute discount amounts

  1. Calculates Discount Multiplier (DM) using this formula- Discount Amount Of Subtotal For The Applied Discount / Subtotal’s MAD

  2. Calculates every line item’s distributed discount amount using this formula- DM * Line Item’s MAD

  3. Follows Step 5

Step 5 Calculate Maximum Applicable Discount (MAD)

  1. Calculates every line item’s new MAD using this formula- Line Item’s MAD - Calculated or Distributed Discount for the line item

  2. Calculates subtotal’s new MAD using this formula- Subtotal’s MAD - Calculated Discount for the subtotal

  3. Follows Step 6

Step 6 Apply CSR Discount again

  1. If during Step 1, previously applied CSR discount was not removed (for a scenario when CSR discount is applied), then follows Step 7, otherwise follows Step 3


Step 7 Calculate discount amounts for Order Summary

  1. Calculates the value of “Discount” displayed in order summary using this formula- Total Line Item Discount + Total Order Discount

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

  1. Checks if Discount Amount Calculated By Application > Total Shipping’s MAD. If the discount amount calculated by the application is greater, then follows Step 1.2  and the following steps, otherwise follows Step 1.4 and the following steps

  2. Sets Discount Amount Of Total Shipping For The Applied Discount = Total Shipping’s MAD

  3. Follows Step 2

  4. Sets Discount Amount Of Total Shipping For The Applied Discount = Shipping Discount Amount Calculated By Application

  5. Follows Step 2

Step 2 Distribute discount amounts

  1. Calculates Discount Multiplier (DM) using this formula- Discount Amount Of Total Shipping For The Applied Discount / Total Shipping’s MAD

  2. Calculates every line item’s distributed discount amount using this formula- DM * Line Item Shipping’s MAD

  3. Follows Step 3

Step 3 Calculate Maximum Applicable Discount (MAD)

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

  2. Calculates Total Shipping’s new MAD using this formula- Total Shipping’s MAD - Calculated Shipping Discount for the Total Shipping

  3. Follows Step 4

Step 4 Calculate discount amounts for Order Summary

  1. Calculates the value of “Shipping Discount” displayed in 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’s 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:


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

Discount

$139

Order Total

$19


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.