New Landing How can we help? Themeforest Theme Support Neighborhood Order Product Categories and sub NOT alphabetically

Viewing 9 posts - 1 through 9 (of 9 total)
  • #76067
    numidia
    Member
    Post count: 18

    Hi,

    I’ve noticed that the theme inserts automatically product cat & relatives subs after the product image, and this is fine for me.
    The problem is that the sequence is ordered by alphabet ASC and doesn’t consider the hierarchy between cat and his sub(s).

    In the screen attached, you can find a typical situation. It displays “Microalbuminuria, Nefrologia” (ordered alphabetically). The correct sequence should be: “Nefrologia, Microalbuminuria” because Nefrologia is the main category and Microalbuminuria one of their sub.

    How can manage it in order to display category first and then sub?

    Thanks,
    Francesco

    #76188
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide always specific page URL so i can check and resolve the issue easily .
    Thanks ๐Ÿ™‚
    With Best Regards
    Swift Ideas

    #76203
    numidia
    Member
    Post count: 18

    Absolutely,

    this is the address:

    Thx,
    Francesco

    I think the problem is the method $product->get_categories(); in woocommerce that returns by default cat & sub only in alphabetic order.

    #76204
    numidia
    Member
    Post count: 18
    #76208
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try to put this code at functions.php under theme directory

    function wptt_cat_order( $args ){
     
        $args['orderby'] = 'slug';
        $args['order'] = 'ASC';
        return $args;
     
    } // wptt_cat_order
    add_filter( 'woocommerce_product_subcategories_args', 'wptt_cat_order' );

    Thanks ๐Ÿ™‚
    With Best Regards
    Swift Ideas

    #76230
    numidia
    Member
    Post count: 18

    Unfortunately doesn’t work.

    I’ve putted it in functions.php in my child theme but nothing changes. I’ve also emptied the cache.
    I’m assuming I’ve made a wrong description of my problem.
    With this method you probably order alphabetically only the subs. The main problem for me is that the theme displays all the terms in alphabetic ASC mode (cat & sub). I’d love to order with this hierarchy:

    C (MAIN CATEGORY), A (FIRST SUB OF C), B (SECOND SUB OF C)

    Thanks in advance

    #76483
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try also this code and let me know your feedback

    add_filter('woocommerce_get_catalog_ordering_args', 'woocommerce_catalog_orderby');
    function woocommerce_catalog_orderby( $args ) {
    	
    	$args['order'] = 'asc';
    	
        return $args;
    }

    Thanks ๐Ÿ™‚
    With Best Regards
    Swift Ideas

    #76485
    numidia
    Member
    Post count: 18

    Hi,

    unfortunately nothing changed. The situation in the same.
    Any ideas?

    #76490
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi there,
    Unfortunately that is not part of the current theme functionality, and it’s not within the scope of our support to be able to provide that functionality as it is more work than a small customisation. While we’d love to be able to support every customisation request, we simply don’t have the time. We recommend that you seek a freelance developer if you need that functionality, potentially from one of the below resources:

    https://codeable.io

    Home


    http://www.microlancer.com

    Thanks

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register