I want to "naturally" sort skus in admin panel ("grid"?) and I found this code: https://magento.stackexchange.com/a/124324/51693 which would be exactly what I need, but I don't know where to call this class or how to implement it. If someone could, at least, point me in the right direction, that would me much appreciated.

1 Answer 1


To add any default sorting for the Magento admin Grid. We just need to add below line in the prepareCollection method of that Grid.php

$this->setDefaultSort('sku'); /*whatever column you need as default sort you can use*/

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.