If order item is not available prevent checkout completion rather than deleting it from cart

Created on 30 August 2024, 3 months ago

Describe your bug or feature request.

AvailabilityManager is only used once across the Commerce codebase - in AvailabilityOrderProcessor to delete unavailable order items from the cart. We currently do not implement any default AvailabilityCheckerInterface so this functionality, by on standard Commerce install, is never used.

I find the behavior sub-optimal from the UX point of view. It doesn't help that Order Items are deleted without any message whatsoever so the Customer may not even notice that one item they care about a lot out of 1000 other items also in the cart was deleted from it only because the quantity was set to 1001 and only 1000 items are left in stock.

The proposal is to rather than deleting order items directly via the mentioned processor, flag them as "unavailable" with a reason and allow the customer to manually fix their cart. As part of this issue, we must also prevent checkout from completing with a meaningful message as to why did that happen.

To maintain backward compatibility the old and the new behavior must be implemented simultaneously with a setting exposed to Site Builder where the expected strategy can be selected. The new behavior should be default on the newly installed Drupal Commerce instance.

Feature request
Status

Active

Version

3.0

Component

Order

Created by

🇳🇴Norway zaporylie

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024