Problem/Motivation
Commerce 3.x supports Drupal ^10.3 || ^11. A new major, 4.x, is needed to support Drupal 12, drop Drupal 10, and remove code deprecated for removal in 4.0.0.
3.x remains supported for Drupal 10/11 sites. 4.x supports Drupal ^11.5 || ^12, so sites can upgrade Commerce on Drupal 11 first and move to Drupal 12 afterwards.
The minimum was raised from 11.1 to 11.5 in #3638820, since fixing Drupal 12 deprecations requires APIs introduced in 11.5.
Proposed resolution
Do the work in small, independently committable child issues listed below. This issue only tracks them.
Annotations vs attributes
- Every Commerce plugin type already provides an attribute class (since 3.x). This satisfies the Drupal 12 requirement that plugin types support attributes (change record).
- Annotated plugins (payment gateways, checkout panes, promotion offers, conditions, etc.) remain supported in 4.x, since Drupal core keeps annotation discovery until Drupal 13. Contrib modules should convert their plugins to attributes; this works on Commerce 3.x and 4.x alike.
- The Commerce plugin annotation classes will be deprecated in 4.x, and support for annotated Commerce plugins will be removed in 5.x.
- Commerce's own entity types will be converted to attributes. Entity type attributes require Drupal 11.1, which the 4.x minimum covers.
Remaining tasks
Must have
- #3638817: Require Drupal ^11.1 and PHP ^8.3 on 4.x, test against Drupal 12 in CI
- #3638818: Convert entity types to attributes
- #3638819: Remove code deprecated for removal in commerce:4.0.0
- #3638820: Fix Drupal 12 deprecations
- #3638856: Use text_long for the product body field on new installs
- #3639233: Drop the Inline Entity Form dependency
- #3639232: Add context services to build the pricing Context
- #3639234: Add checkout and update_cart order operations
- #3639235: Pass an optional Context to the address book
- #3639236: Add OrganizationInterface and an optional organization on the Context
- #3639243: Return a ConditionResult from conditions so failures can be explained (needs refinement; decide the BC strategy before 4.0.0)
- #3586548: Drupal 12 compatibility (lands last)
Nice to have
4.x minor: B2B organization
Additive organization plumbing for B2B modules (commerce_b2b) to build on, using the 4.0 seams and organization API above. Child issues to be created; details are not final.
- Organization on orders and carts:
organization_idorder field (present once an organization entity type exists), one cart per user per organization, organization set on order assignment - Order ownership by uid only for orders without an organization
Open question: does the default organization entity type (commerce_organization) ship as a Commerce submodule, as currently planned, or with commerce_b2b?
No release containing the organization plumbing is tagged until commerce_b2b exercises it (memberships, resolver, access grants).
User interface changes
None expected.
API changes
Removal of deprecated code; see child issues. Annotated plugins keep working.
Code checking $cart->access('update') for customers moves to the new update_cart operation. Classes that built a Context with new Context() get the context services injected. AddressBookInterface implementations take the optional Context argument. Sites relying on Commerce to pull in Inline Entity Form must require it themselves. Context gains an optional organization, with OrganizationInterface and resolver interfaces for B2B modules to implement.
Data model changes
None expected in 4.0. The organization plumbing (4.x minor) adds an organization_id order field, present once an organization entity type exists.
Comments
Comment #2
jsacksick commentedComment #3
jsacksick commentedComment #4
jsacksick commentedComment #5
jsacksick commentedComment #6
jsacksick commentedUpdated the summary: 4.x requires Drupal ^11.5 since #3638820 was merged.
Comment #7
jsacksick commentedActually... Realized now might be the time to drop the Inline entity form dependency since Commerce no longer depends on IEF anymore... And we couldn't really remove the dependency on Commerce 3.
Comment #8
jsacksick commentedComment #9
jsacksick commentedComment #10
jsacksick commentedComment #11
jsacksick commented