0

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

It is not working.

Kindly help me

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')),
    )
);
| improve this answer | |
  • kindly update code for AND condition also – SUBBULAKSHMI G Feb 20 at 4:14
0

Try this code :-

$collection = $this->productFactory->create();
$collection->addAttributeToFilter('status', array('eq' => 1));
| improve this answer | |

Your Answer

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

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