0

I trying to do filter the product collection with my custom attribute(Type : Multi select).

It is not working.

Kindly help me

2 Answers 2

0

Try to use addAttributeToFilter with or condition

$collection->addAttributeToFilter('attribute_code',
    array(
        array('finset'=> array('237')),
        array('finset'=> array('238')),
        array('finset'=> array('239')),
    )
);
1
  • kindly update code for AND condition also Commented Feb 20, 2020 at 4:14
0

Try this code :-

$collection = $this->productFactory->create();
$collection->addAttributeToFilter('status', array('eq' => 1));
1
  • this is for dropdown Commented Mar 14, 2020 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.