1

I want to change attribute position based on category page means want to change custom position

here I have list of attribute

size, color, amps, phase

for example in category1 I want show color second number and size forth number in layed navigation in category2 I want show color third number and size second number in navigation

I found code in vendor but no idea how to change it position based on above

vendor/magento/module-catalog/Model/Layer/FilterList.php

in this file have a function

public function getFilters(\Magento\Catalog\Model\Layer $layer)
{
    if (!count($this->filters)) {
        $this->filters = [
            $this->objectManager->create($this->filterTypes[self::CATEGORY_FILTER], ['layer' => $layer]),
        ];
        foreach ($this->filterableAttributes->getList() as $attribute) {
            $this->filters[] = $this->createAttributeFilter($attribute, $layer);
        }
    }
    return $this->filters;
}

Thanks in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.