I need to sort my custom attribute values in alphabetical order.

Magento ver. 2.1.2

Now my options are sorted by eav_attribute_option.sort_order and i need to sort them by eav_attribute_option_value.value.

I need this when I will create a new product and set 'series' of this product (166 different 'series' in random order now) from dropdown input.

I tried this: Configurable product attribute sort order in Dropdown 2.12 but it seems not working for me.

If I comment whole method public function getAttributeOptions($superAttribute, $productId). it seems not affect on website at all (so it's not in use I assume?) But I was looking for replace this class in di.xml but with no success.

How to manage with that?

1 Answer 1


This one should work. Include this after getting your collection.

setOrder('your_custom_attribute', 'asc')

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.