Web Analytics

Fill the form & Get Installation Support





    By default, Magento adjusts the attribute position when we create product attributes. But, systematically, the same position will get apply for all categories.

    So if we wanted to display attributes position differently for categories wise, then this article is your solution.

    First, you have to create text type Category Attributes
    which you need to set differently category wise (Please verify product attribute code and category attribute code).

    In the text type attributes, you have to set the require position value as shown in below screenshot.

    After creating all the category attributes and setting value in all categories, you have to move forword in the next step:

    Override the Magento\Catalog\Model\Layer\Category\FilterableAttributeList file.

    For that, you need to use virtualType in di.xml in your module (You can create a new module or use any existing module. Create only di.xml in that module).

    After override FilterList, put below code in that file for change the Filter Position:

    After doing all the steps run below commands and check output on front end.

    You will see layered navigation filters are displayed differently in each category.

     

    Fill the below form if you have any Magento programming need.





      Recent Articles

      Author Info

      Hire B. Darji

      Get a Free Quote





        Let our Magento expert connect to discuss your requirement.


          We offer Magento
          certified developers.

          Our Magento clientele
          is 500+.

          We sign NDA for the
          security of your projects.

          We’ve performed 100+
          Magento migration projects.

          Free quotation
          on your project.

          Three months warranty on
          code developed by us.