Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Elvis Morales

    (@elvismdev)

    Hi softsleepysounds,

    Glad you are still using this plugin, sorry for my late response I just wasn’t notified by email from www.ads-software.com about this new thread.

    So in short, this plugin and also WooCommerce doesn’t order the listing of products by the SKU field. WooCommerce out of the box by default lists the products by date (the published date). You can read more about this reading the WP_Query documentation exactly in the orderby section.

    If you are looking into output your products ordered by their SKU look at this thread which will help you to accomplish that.

    Thread Starter softsleepysounds

    (@softsleepysounds)

    Hi Elvis,

    Thanks so much for your reply! I really appreciate the time you took to give me some more information on this topic.

    Unfortunately, the code that you linked to only kinda works. It turned out that it was already in my functions file:

    add_filter('woocommerce_get_catalog_ordering_args', 'am_woocommerce_catalog_orderby');
    function am_woocommerce_catalog_orderby( $args ) {
        $args['meta_key'] = '_sku';
        $args['orderby'] = 'meta_value';
        $args['order'] = 'asc';
        return $args;
    }

    It groups products by their range on the shop page, but not in perfect sku order, and on the range pages, where I am using your plugin, it kind of works, but not completely. I tried ‘orderby’ ‘meta_value_num’ but that made a complete mess of it.

    It is really frustrating!!

    Thanks for your help all the same. It is kind of you ??

    I think I will post my question in the main WordPress forum, maybe someone else has come across this problem!

    Cheers,
    Sarah

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘errors in order by SKU’ is closed to new replies.