Magento 2 Get layered navigation filterable attributes list.

Magento 2 Get all the attribute list which are used in Layered Navigation in category page and search page.

You can get all the filterable attribute list by Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory class.

The result will be all those attributes that have,

  1. Use in Layered Navigation status are Filterable (with results)
  2. Filterable (no results)

You need to create __construct( ) function for define dependency of Class.

Now call a function in template file by iterating over a loop to fetch each attribute code,

You get all the filterable attributes used for your store.

The Result for Magento 2.4 Store with Sample data installed,

This is the list of product attribute which have filterable enable from the Admin panel.