What is the equivalent in magento2 of

$query = Mage::getModel('catalogsearch/layer');

$filterableAttributes = $query->getFilterableAttributes();

You can use below code to achieve it.

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();

$filterableAttributes = $objectManager->get(\Magento\Catalog\Model\Layer\Category\FilterableAttributeList::class);

Note: I will not recommend to use $objectManager

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.