Magento 2 Product Form Categories Sort Alphabetically From the Backend
-
14-02-2021 - |
Solution
Check vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php
Following method is responsible for creating category tree.
protected function getCategoriesTree($filter = null)
{
You need to modify collection:
$collection->addAttributeToFilter('entity_id', ['in' => array_keys($shownCategoriesIds)])
->addAttributeToSelect(['name', 'is_active', 'parent_id'])
->setStoreId($storeId)->setOrder('name');
NB: don't modify core file
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange