Skip to content

[5.x] Added the Commerce 6 Ready utility - #4416

Draft
lukeholder wants to merge 2 commits into
5.xfrom
feature/commerce-6-ready-utility
Draft

lukeholder wants to merge 2 commits into
5.xfrom
feature/commerce-6-ready-utility

Conversation

@lukeholder

@lukeholder lukeholder commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Description

Prepares Commerce 5 sites for the Commerce 6 upgrade.

“Commerce 6 Ready” utility (Utilities → Commerce 6 Ready, craft\commerce\utilities\Commerce6Ready) lists what to fix before upgrading:

Check Flags
PHP 8.5.0 or later the server's PHP version
Convert categories to entries each category group (with its php craft entrify/categories <handle> command); discounts and sales related to categories; catalog pricing rules, discounts, gateways, shipping methods/rules and store markets whose conditions use categories (the “Purchasable Categories” rule with categories selected, or a “Related To” rule targeting categories)
Stop using subscriptions existing plans and subscriptions
Update gateway plugins every gateway other than Dummy/Manual

Plus an “Also review” note for things that can't be detected (custom code using Commerce events, guest carts not carrying over).

Catalog pricing rule “Purchasable Categories” condition now selects entries, unless categories are already selected (those keep the category picker, so existing selections aren't lost). Matching is by element ID and relation direction, so it works the same for either type. Entrify reuses category element IDs as entry IDs, so converted rules keep matching.

Commerce 6 drops category support; discounts and sales already accept entries in 5.x.

Evidence

Uploading screenshot-1793629206475-6.png…

Run against a Craft 5 site (craft5 ddev) with this branch:

[TODO] PHP 8.5.0 or later (0 items)          ← server runs 8.2
[ok] Convert categories to entries (0 items)
[ok] Stop using subscriptions (0 items)
[ok] Update gateway plugins (0 items)
html bytes: 2113, has table: yes / registered: yes

With temporary rows in a rolled-back transaction (a discount related to a category, and a discount whose order condition relates to categories):

[TODO] Convert categories to entries (2 items)
    - Discount “Uses category relation” | …/commerce/store-management/primary/discounts/7
    - Discount “Uses category condition” conditions | …/commerce/store-management/primary/discounts/8

Condition rule: empty → Entry / “Purchasable Entries”; a category selected → Category / “Purchasable Categories” (and the utility flags it); selection cleared → Entry.

ECS and PHPStan pass on the changed files. No Codeception tests added (not set up locally).

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant