0

I have created an attribute that is used for sorting on the category pages. The sorting order is numeric. Expectation is that sorting order is:
1. 1
2. 2
3. 11

But the actual sort order is:
1. 1
2. 11
3. 2

Apparantly, Magento sorts on the first digit. Not on the complete integer.
How to effectuate the correct sort order?

  • Is this 2.2 or 2.3? – danronmoon Oct 30 at 20:31
  • I am sorry: 2.3.0. Is it a known 2.3 issue? – Els den Iep Oct 30 at 20:32
  • You can use natsort Function of php after take that values in array. – Oscprofessionals Oct 31 at 6:08
0

You can use natsort Function of php after take that values in array.

Or

You can do this by custom Query as:

First add an order by clause at the end:

ORDER BY category_id

Treat it like an integer. There are a few ways to do this but I usually add a zero.

ORDER BY category_id + 0

Hope This will help You!!

  • Oscprofessionals can you implement that for me. At what cost? – Els den Iep Oct 31 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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