I have set custom conditions for my requirement and I have created plugin from \Magento\Catalog\Model\Layer with public function afterGetProductCollection(\Magento\Catalog\Model\Layer $subject,$result) { $getProductUniqueIds = array(1,2,3,4,5); $result->addAttributeToFilter('entity_id',array('in' => $getProductUniqueIds)); return $result; }
Using above conditions, I have display Product collection properly but Layered navigation is not display based on above conditions. Its display old layered navigation without considering filter conditions.
Would I need to set above product collection conditions to other files also? or What's the problem with my custom conditions in layer.php with plugins?
I have set custom conditions for my requirement and I have created plugin from \Magento\Catalog\Model\Layer with
public function afterGetProductCollection(\Magento\Catalog\Model\Layer $subject,$result) { $getProductUniqueIds = array(1,2,3,4,5); $result->addAttributeToFilter('entity_id',array('in' => $getProductUniqueIds)); return $result; }
Using above conditions, I have display Product collection properly but Layered navigation is not display based on above conditions. Its display old layered navigation without considering filter conditions.
Would I need to set above product collection conditions to other files also? or What's the problem with my custom conditions in layer.php with plugins?
Any help regarding above criteria @romainruaud
Thanks.