Try our conversational search powered by Generative AI!

Invalidated discount wrong when return order applies order discount before item discount

Found in

EPiServer.Commerce 11.2.6

Fixed in

EPiServer.Commerce 12.4.1

(Or a related package)

Created

Jun 22, 2018

Updated

Jul 23, 2018

Area

Core

State

Closed, Fixed and tested


Description

NOTE: The root cause of this bug is not related to processing of return orders. It happens when the saved amount of the promotion information entry is calculated incorrectly, because it also includes the saved amount of the order promotion that was applied before. But in summary, the calculator stills calculates correctly, only the promotion information is affected.

Steps to reproduce

  1. Go to the new Marketing UI.
  2. Create an order discount with type "Spend at least X amount and receive a discount off total order value.":
    Spend at least X = 5.00
    Get the following discount (Amount off) = 1.00
  3. Create an Item discount with type "Buy at least X items from catalog entries and get related catalog entries at a discount.":
    Buy item X, get item X at (Amount off) = 1.00
  4. Set the priority of the order discount higher than item discount.
  5. Add 3 item X (price = 11) to cart and place the order.
  6. Complete the above order then return all orders.

Expected:
Invalid discount = 4 (1 for order discount total + 3 for item discount)

Actual:
Invalid discount = 5 (1 for order discount total + 4 for item discount).