Add negate and and/or functionality to order product category condition

Created on 21 October 2020, almost 4 years ago
Updated 16 August 2024, about 1 month ago

With the inactivity in creating a general solution for negating conditions Create an option to negate conditions Active , patches are required to do so for any project that needs the functionality. After creating a patch for the product condition in #3039905: Add negate and and/or functionality to order product condition , I was asked to create one for the Order Product Category conditions. I will provide a patch that additionally adds a choice of operator (and/or) and combines the operator and negation into select options, for better UX/understanding of non-technical users, as in #3039905: Add negate and and/or functionality to order product condition .

Feature request
Status

Needs work

Version

2.0

Component

Product

Created by

🇬🇷Greece s.messaris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy gatiba

    Patch #10 seems to have no effect on Commerce 2.36. The new select field "condition" doesn't works.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 769s
    #256304
  • 🇺🇸United States rhovland

    Added tests for new functionality but they fail for a reason I don't understand.

    Drupal\Tests\commerce_product\Unit\Plugin\Commerce\Condition\OrderItemProductCategoryTest::testEvaluate
    TypeError: array_intersect(): Argument #1 ($array) must be of type array,
    null given

    I'm guessing it's taking issue with
    $configuration['terms'] = ['62e428e1-88a6-478c-a8c6-a554ca2332ae', 'a019d89b-c4d9-4ed4-b859-894e4e2e93cf'];
    as it says it's supposed to be an array but null was given instead?

Production build 0.71.5 2024