• Hi, we are using latest version of WordPress with Woocommerce plugin, in admin panel we try to sort products by SKU but sorting is wrong, it sort all as SKU is string, not number, is there a way to override this?

    Sorting looks like this
    186
    188848903
    189
    190
    190552839
    198
    200
    200461836
    201
    202
    205
    206659847
    207

Viewing 1 replies (of 1 total)
  • Anyone had any success with this problem? I found a lot of references to the issue across the internet, but in all cases there hasn’t been any response.

    Trying to find a way to hook into column sorting in WooCommerce as I think we need to switch the SKU column to orderby:

    ‘meta_value_num’ – Order by numeric meta value (available since Version 2.8). Also note that a ‘meta_key=keyname’ must also be present in the query. This value allows for numerical sorting as noted above in ‘meta_value’.

    Possibly I’ll just create a custom column for sorting SKUs numerically, following this helpful article:

    https://scribu.net/wordpress/custom-sortable-columns.html

    Will post back with what I find.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WooCommerce] Sorting by SKU in admin not working correctly’ is closed to new replies.