Repository navigation
[5.x] Added the Commerce 6 Ready utility - #4416
Draft
lukeholder wants to merge 2 commits into
Draft
lukeholder wants to merge 2 commits into
lukeholder wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: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)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
Run against a Craft 5 site (
craft5ddev) with this branch:With temporary rows in a rolled-back transaction (a discount related to a category, and a discount whose order condition relates to categories):
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