Log in
Model

Layer

Magento\Catalog\Model\Layer

What it does

The Layer class manages the catalog navigation layer, handling product collections and filters for category pages.

Developers use this class when working with layered navigation (filtering by attributes like price, color, etc.) or when customizing how products are displayed and filtered in category listings.

It maintains the current category context, product collections, and filter states throughout the browsing session.

Public Methods

  • getStateKey()
  • getProductCollection()
  • prepareProductCollection()
  • apply()
  • getCurrentCategory()
  • setCurrentCategory()
  • getCurrentStore()
  • getState()
  • _resetState()