I need to get a product collection to filter multiple attributes.
Forexample:
First: color multi select filter(attribute) values: 23, 25, 26.
Second: system multi-select filter(attribute) values: 27, 28.
I am getting filter values in one array and need to filter in the collection.
There are comma separated $list = 23, 25, 26,27, 28
In the controller file:
$list = $this->getRequest()->getParam('list', false);
$filter_ids = explode(",",$list);
$productcollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
$categoryProducts = $productcollection->create()->addAttributeToSelect('*')->addAttributeToFilter('color', array('in',$filter_ids))->addAttributeToFilter('system', array('in',$filter_ids))->load();
I am not getting a result in this way. where I am wrong. Please suggest to me.
Thanks