• Resolved craigs85

    (@craigs85)


    Hi there.
    I have been using Woocommerce for a long time now and I have currently got 40000 products amongst 7000 categories.

    The categories are hierarchical.

    On the store page (https://www.mgautos.uk.com/shop/) I have one top level category that doesn’t display in the correct order (Milltek Exhaust appears last, when it should be second.

    In the Powerplex category (https://www.mgautos.uk.com/product-category/powerflex/), I have a few here that are out of order.
    If you scroll down towards the bottom, Audi to Caterham are at the bottom, but should in fact be at the top.

    Can anyone please help? Its driving me insane!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Categories can be ordered in the backend by dragging / dropping: https://cld.wthms.co/OB8f8x. Are they not displaying in the order defined here?

    I’d recommend ruling out plugin / theme conflicts as well: https://docs.woocommerce.com/document/woocommerce-self-service-guide/#section-4

    Thread Starter craigs85

    (@craigs85)

    Hi there.
    Thanks for the reply.

    It is impossible to use the drag and drop because there are so many categories :(.

    I’ve switched to a default theme and the same issue occurs ??

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Ah, well if you haven’t dragged/dropped them – then they have never been told what order to be in. In screen options, you can increase the number of categories per page. That could help.

    Perhaps utilizing parent categories a bit more could also help, rather than having mass amounts all under the same parent.

    Thread Starter craigs85

    (@craigs85)

    Hi again,

    I am using Parent categories.
    All of my products have been imported using WP All Import Pro.

    Some of the categories are 4 level deep in the hierarchy.

    What is the default sort can I ask? Is it not by Category Name?

    I found this bit of code to add to functions.php which sorts it on the shop pages. Not the menu though.

    add_filter( 'woocommerce_product_subcategories_args', 'custom_woocommerce_get_subcategories_ordering_args' );
    
    function custom_woocommerce_get_subcategories_ordering_args( $args ) {
        $args['orderby'] = 'title';
        return $args;
    }
    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Default orderby is menu_order I believe. Meaning the order of drag n drop in the backend.

    > I found this bit of code to add to functions.php which sorts it on the shop pages. Not the menu though.

    Which menu are you referring too? Like a navigational menu you’ve put together, or maybe a widget?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Categories and Sub Categories not sorted correctly’ is closed to new replies.