I have to move category filter after my custom attribute filter but I am not able to how to move it please help me how to change position. I want to move category filter in the last position.
Magento 2 – How to Change Category Filter Position in Layered Navigation
filterlayered-navigationmagento2position;
Best Answer
The filters in the layered navigation are being build in this file:
vendor/magento/module-catalog/Model/Layer/FilterList.php
The result of
$this->filters
will look likeWith a custom plugin
afterGetFilters
you should be able to check if the first item in the array is instanceofMagento\CatalogSearch\Model\Layer\Filter\Category
. If so, place it at the end of the array before returning the result.