3

Which function is triggered when clicking on any filterable attributes for the products on category page Magento 2?

1 Answer 1

0

It depends on the filter type.
All filter models implement the interface \Magento\Catalog\Model\Layer\Filter\FilterInterface.
This interface contains (among others) a method called apply.

Depending on the attribute type, the method apply from different implementations of this interface is called.
For example, for price filter \Magento\Catalog\Model\Layer\Filter\Price::apply() is called.
For dropdown and multiselect attributes \Magento\Catalog\Model\Layer\Filter\Attribute::apply is called.
For category filter \Magento\Catalog\Model\Layer\Filter\Category::apply and for decimal attributes \Magento\Catalog\Model\Layer\Filter\Decimal::apply

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.