When Order reprice is typically called?
The Order is typically repriced after the following actions:
- Item is added to the cart
- Item is removed from the cart
- Quantity is changed on items in the cart
- User specifies a shipping address or shipping method and pushes "Checkout" button
Use /atg/commerce/order/purchase/RepriceOrderDroplet to invoke repricing on order:
How it works behind the scenes?
Each time the code reprices the order, the ATG Promotions associated with the user's Profile are considered.
- Fetch all of the Promotions/Discounts that the user is eligible for:
- (Global + Individual Promotions) minus Promotions they don't qualify for
- Calculate the price of each individual item on the order
- Apply Item Level Discounts
- Calculate the order total price(discounted item prices + shipping price)
- Apply Order Level discounts
- Calculate the shipping price
- Apply Shipping Discounts
- Generate a total price
If you don't see your order getting repriced as you expected (the discount isn't being related), these are some things to check on:
- Was the repricing code called yet?
- Was the Promotion successfully added to the Profile?
- Was the Promotion represented correctly in the repository?