Title: Category order
Last modified: August 30, 2016

---

# Category order

 *  [Michalooki](https://wordpress.org/support/users/michalooki/)
 * (@michalooki)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/category-order-17/)
 * Hi and thanks for this great plugin.
    Is it possible to choose the order of the
   list to be the same order as in the product category admin panel? This way it
   will be possible to sort the list not by id, name or slug but by the category
   order in the admin page which can be change by “drag & drop” Thanks Michal.
 * [https://wordpress.org/plugins/woocommerce-collapsing-categories/](https://wordpress.org/plugins/woocommerce-collapsing-categories/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Website Tutorials](https://wordpress.org/support/users/fakeartist/)
 * (@fakeartist)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/category-order-17/#post-6627618)
 * Try to remove line 207 from woocommerce-collapsing-categories.php
 * `'orderby' => $qp_orderby,`
 * That did the trick for me!
 *  [d2.roth](https://wordpress.org/support/users/d2roth/)
 * (@d2roth)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/category-order-17/#post-6627786)
 * For anyone who doesn’t want to modify the plugin source code, and just wants 
   to use built in functionality, if you change the Category orderby setting under
   [http://example.com/wp-admin/options-general.php?page=woocommerce-collapsing-categories](http://example.com/wp-admin/options-general.php?page=woocommerce-collapsing-categories)
   to simply be ‘name’ then it works properly.
 * The explanation from my research, and why fakeartist’s solution works:
 * In “/wp-content/plugins/woocommerce/includes/wc-term-functions.php” there is 
   a function called ‘wc_terms_clauses’ that sets up all of the parameters for sorting
   whenever terms are retrieved. It does that through the filter ‘terms_clauses’
   as seen below:
    `add_filter( 'terms_clauses', 'wc_terms_clauses', 10, 3 );` It
   is built such that it only will do any special sorting if you are retrieving 
   the terms in their default order which is ‘name’. Now WooCommerce Collapsing 
   Categories uses the function ‘wp_list_categories’ to grab the categories. In 
   the course of events this calls the ‘terms_clause’ filter and WooCommerce sorts
   the terms if the orderby clause is set to ‘name’. But line 208, as mentioned 
   by fakeartist overrules the default order of ‘name’ and uses whatever you have
   specified in the backend. So if in the settings panel you have set the value 
   of ‘orderby’ to anything other than ‘name’ WooCommerce’s sorting will not be 
   applied.
 * I hope that helps someone else out.
 * -Daniel
 *  [timhansn](https://wordpress.org/support/users/timhansn/)
 * (@timhansn)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/category-order-17/#post-6627790)
 * Cheers [@fakeartist](https://wordpress.org/support/users/fakeartist/) !
 * That also did the trick for me. Good stuff as the support on this plugin seems
   to be not-existing 🙁
 * /Tim
 *  [Website Tutorials](https://wordpress.org/support/users/fakeartist/)
 * (@fakeartist)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/category-order-17/#post-6627792)
 * Excellent [@d2](https://wordpress.org/support/users/d2/).roth! The ‘name’ entry
   works, without needing to modify the plugin source code!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Category order’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-collapsing-categories_ffffff.
   svg)
 * [WooCommerce Collapsing Categories](https://wordpress.org/plugins/woocommerce-collapsing-categories/)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-collapsing-categories/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-collapsing-categories/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-collapsing-categories/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-collapsing-categories/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [Website Tutorials](https://wordpress.org/support/users/fakeartist/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/category-order-17/#post-6627792)
 * Status: not resolved