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)

2 Replies to “Magento 2 Get layered navigation filterable attributes list.”

  1. Hello.
    Thank you for your code.
    I’m getting error:
    Exception #0 (MagentoFrameworkExceptionRuntimeException): Type Error occurred when creating object: OcThemeBlockCatalogProductListProductInterceptor
    Where do i need to set the type?
    Also, will the attributes change after i filter? can i keep the array after i filter also?
    Thaknk you

  2. I am required to fetch values of layered navigation color values could you help me in this regard.
    Thank you

Leave a Reply