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?

  • Hi, Im also interested in this. Did you manage to find any solution? Commented May 8, 2018 at 23:06
  • @user1517598 No, what I ended up doing was to give all attribute options the same position (0) with SQL. This sorted the options alphabetically. Then I just moved the 1st option to the 2nd position via drag & drop, and all attributes got their position based on alphabet. This is just a "one time fix" but it might help...
    – Lez
    Commented May 9, 2018 at 6:25
  • Hi, Appreciate the response. We have attributes with 100's of values. Your solution is good. I think Ill see if I can get some javascript written to resolve this. For example. On an attribute view, when open, have a button that when selected, resorts the list either Asc or Desc Then you select save. Basically takes the array of values and re-orders list. Ill update this post when I have something to show. Cheers Commented May 10, 2018 at 23:17
  • @BrendanBell sounds like a reasonable solution. Would be great if you could share it when you're done. Cheers!
    – Lez
    Commented May 11, 2018 at 7:27
  • Lez, Did you ever find the answer for this? Is there code anywhere for this? Brendan Bell, where is your code?
    – Jonathan
    Commented Sep 30, 2020 at 18:59

2 Answers 2


you can download this module https://github.com/nhutnguyenvu/alphabet-option. It allows you can sort any attributes by alphabet (desc, asc) or position


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.


  • Glad you found a permanent solution for this, but I'm not really interested in paid solutions, thanks for the offer though.
    – Lez
    Commented Jun 5, 2018 at 8:26
  • Hi Sir, I Nee this code Commented Jun 28, 2019 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.