QUESTION:

I use Magento 2.3.2 EE and install the module M2 Layer Navigation on our site. However, the multiple choices functions just work in the same group, if it is not the same group, multiple choices doesn't work!! See images below:


We got an error: 


ANSWER:

The error that you have encountered with due to the default Function AddFieldToFiter doesn't work.

Please edit file Model/ResourceModel/Attribute.php as below:


Model/ResourceModel/Attribute.php MODIFIED

 
Side-by-side diff View file
 
Comment
 
More
                     if ($attribute->getAttributeCode() !== $key) {
                         $attributeValue = explode('_', $value);
                         if (isset($attributeValue[1])) {
-                            $productCollection->addFieldToFilter(
+                            $productCollection->addAttributeToFilter(
                                 $attribute->getAttributeCode(),
                                 ["in" => $attributeValue]
                             );
                         } else {
-                            $productCollection->addFieldToFilter($key, $attributeValue[0]);
+                            $productCollection->addAttributeToFilter($key, $attributeValue[0]);
                         }
                     }
                 }


If you need any further assistance, please feel free to contact us via https://bsscommerce.com/contact.