Describe your bug or feature request.

The promotion usage is currently incorrectly registered as we're registering usage for each promotion adjustment found.

Considering promotions are split across order items, the same promotion is registered for each order item. (i.e if the order has 20 items, the promotion usage is going to be registered 20 times).

The DB itself should probably have a unique constraint on a composite key (promotion_id, order_id).

But in the meantime, we should at the very least fix the logic that's registering the usage from the event subscriber reacting to the order place event.

CommentFileSizeAuthor
#2 3256456-2.patch1.51 KBjsacksick

Comments

jsacksick created an issue. See original summary.

jsacksick’s picture

Status: Active » Needs review
StatusFileSize
new1.51 KB

  • jsacksick committed eaf9a7c on 8.x-2.x
    Issue #3256456 by jsacksick: Promotion usage is incorrectly registered.
    

  • jsacksick committed 1520f62 on 3.0.x
    Issue #3256456 by jsacksick: Promotion usage is incorrectly registered.
    
jsacksick’s picture

Status: Needs review » Fixed

Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.