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

Command icon 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

jsacksick created an issue. See original summary.

  • jsacksick committed ae82a626 on 4.x
    feat: #3641084 Add an "Order organization" condition
    
    By: jsacksick
    
jsacksick’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.