cancel
Showing results for 
Search instead for 
Did you mean: 

Catalog & Add Product page (categories order not same)

Catalog & Add Product page (categories order not same)

Hello

in the Catalog , the categories order like -> https://ibb.co/ZK6trTf

but in product page, the categories order like -> https://ibb.co/fC5sH2Y

 

they are not same -> https://ibb.co/mJPk176

in product page, the "Order of categories"

is follow the Category ID number, 

is it possible to make it follow Catalog Order?

 

Regards

Gabriel

 

1 REPLY 1

Re: Catalog & Add Product page (categories order not same)

Hi @gabriel_helle 

 

It seems like on product edit page, categories are shown in the way they are created (sorting by category ids)

 

There is no sort order specified at line 456 in method

Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories::retrieveCategoriesTree

 

After adding this line

$collection->addAttributeToSort('position');

right before

foreach ($collection as $category) {

and clear the cache then the categories seem to appear in the order they are set in Manage category page.

 

Kindly "Accept as a Solution" if this works for you and give Kudos Smiley Happy