Problem/Motivation
Promotions, shipping methods and payment gateways need to target or exclude organizations (allowed payment methods per organization). Commerce conditions have no built-in negation (the old negate option was removed, see commerce_promotion.post_update.php), so "every organization except ACME" needs it from the start. Parent: #3638816: [META] Commerce 4.x roadmap.
Proposed resolution
Add an "Order organization" condition in commerce_order, with an "is one of / is not one of" setting and an autocomplete targeting the site's organization entity type from OrganizationEntityTypeRepository. Offered only when there is one. Orders without an organization fail "is one of" and pass "is not one of". It needs nothing from commerce_b2b.
Remaining tasks
- Plugin, configuration form, kernel test.
Issue fork commerce-3641084
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
jsacksick commented