0

I am looking for a way to filter orders for a grid based on one of 2 conditions:

  1. Order has a status of "processing_consultation" OR
  2. Order has an order source ID of 9

So I currently have the following in Dataprovider class:

protected function setFilter()
    {
       $this->addFilter(
            $this->filterBuilder
                ->setField('status')
                ->setValue(['processing_consultation'])
                ->setConditionType('in')
                ->create()
        );  
    }

but what I need is something like:

protected function setFilter()
    {
       $this->addFilter(
            $this->filterBuilder
                ->setField('status')
                ->setValue(['processing_consultation'])
                ->setConditionType('in')
                ->create()
        );
    
        // This condition
        $this->addFilter(
            $this->filterBuilder
                ->setField('status')
                ->setValue(['processing_consultation'])
                ->setConditionType('in')
                ->create()
        );
    }

The problem is that the code above currently works by saying "both of these conditions must be true" but that's not what I need. I need a "if (conditionA || conditionB) etc.

Cheers guys

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.