• Resolved atburi

    (@aburi)


    I’ve added a custom filter to the product sorting select dropdown, and it works – but it only uses the first digit of the number when sorting the results.

    For example, lowest to highest would get listed like:

    1, 2, 22, 25, 3, 39, 4, 5, 56, 6….

    when it should be:

    1, 2, 3, 4, 5, 6, 22, 25, 39, 56…

    anyone know how to fix this?

    Thanks!

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Thread Starter atburi

    (@aburi)

    Problem solved:

    Use:

    $args['orderby'] = 'meta_value_num';

    instead of:

    $args['orderby'] = 'meta_value';

Viewing 1 replies (of 1 total)
  • The topic ‘Custom orderby in Product Sorting only uses first digit’ is closed to new replies.