Magento – How to sort attribute options in Magento 2 alphabetically

adminmagento2product-attribute

For example, if you have thousands of colors (options) in the color attribute, it becomes a pain to use the drag & drop sorting functionality.

I'd like to override the default sorting (based on option position) to sort by attribute label alphabetically for all attributes.

I did some digging around in core files, but couldn't locate the class or function which does this.

Any ideas where this functionality is inside Magento's core?

Best Answer

So I have had a development done to make the usability of product attributes with "many" options a lot simpler.

Essentially I have added Sort button, see below. It takes the list of items and resorts in Alphabetical order.

Before Change

Before Change After Selecting Button

After Selecting Button

After the list is resorted, just hit the save button.

If your interested in code, just message me to work something out.

Regards

Related Topic