Woocommerce Status - Sorting bug

Hi,
I’m trying the MainWP Woocommerce Status Extension, and just noticed a small bug with column sorting :

The order is wrong for numeric values :

Sales This Month => If the currency is before the number, it’s placed before sites who have currency after price, even if the value is larger (order by desc) :

€0,00
£0.00
900€
40€
300€
0€…

Look like it’s ordered alphabetically, not with natsort or something like that.

Same problems with all last columns showing X Products and X Orders.

Should be an easy fix !

Thank you

Hi @FeIix

I couldn’t replicate the issue. The position of the currency symbol appears to be purely visual, and the list is sorted by the amount.
woocommerce-status-extension

The sorting for the last columns also seems to be fine. Not sure how the last three columns might be affected, considering they all have the same order of data, a value, and then a descriptor: e.g., “2 Products”.

I guess in your example, the alphabetical order and numeric order are the same.
If it’s not the currency, maybe it’s the decimal ?

If you could add a row, for example 30 (€/$), it will be between 300€ and 200$, instead of after 200 :

300 => 30 => 200
Instead of 300 => 200 => 30,

because they both start with 3.

if you had a site with only 9$ sales this month, it would be placed first in descending order, because 9 > 300 alphabetically

Another example with orders, we can see that 5 > 43, etc…

I’ve tried with your examples and “Sales this month” is sorting properly.
Screenshot 2022-04-06 160324
Screenshot 2022-04-06 153358

I did, however, replicate the sorting issue with the last columns. They appear to be sorted alphabetically.
I have passed the issue to the Dev team.
Screenshot 2022-04-06 154650

Do you have it also with products ?
image

For the sales, I was thinking it could be a locale problem ? The first 0,00€ has a comma decimal separator
For the second one, maybe it’s the £ symbol ?

1 Like

Yeah, it’s the same alphabetical sorting with products.
Screenshot 2022-04-06 171146

Indeed, the “Sales this month” does have an issue when there are mixed decimal points.
Screenshot 2022-04-06 165414
When all the decimal points are the same, sorting is fine.

I’ve passed this to the dev team as well.
Thank you for reporting it to us.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Resolved in the MainWP WooCommerce Status Extension version 4.0.7

3 Likes