Update the availability checker to add up all the quantities present in the order

Created on 22 February 2021, over 4 years ago
Updated 21 August 2025, 2 days ago

Problem/Motivation

Currently, the availability checker is relying on the order item matcher to match any existing quantities in cart.

Instead, our logic should be much simpler, we should loop over the order lines items, and add-up any quantities for order items referring the same purchased entity.

Doing that will ensure we also support the use-case when order items are not combined, since we do not want to allow less than the minimum quantity configured or more than the max quantity, regardless of the combining behavior.

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇱Israel jsacksick

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024