Sorting in different Categories
-
Hello
I installed your plugin and it works great actually. I was pondering manually reordering a lot of produts in several categories when I found it, so it saved me a lot of hand work.
However, I do have 2 very unique categories that need a manual sort. Each category only has 3 items and they need to be displayed from the cheapest to the more expensive one.
Every other category will use from A to Z type of sorting. I have read that your plugin doesn’t support this, so I found a guide for setting up this exception. The issue is, I need to know the PHP variable needed to sort by name (from A to Z). The variable for the price is already in the guide.
//custom function to override default sort by category function custom_default_catalog_orderby() { //choose categories where default sorting will be changed if (is_product_category( array( 'category1', 'category2', 'category3' ))) { return 'date'; // sort by latest }else{ return 'popularity'; // sort by popularity as the default } // end if statement } //end function add_filter( 'woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby' ); //add the filter
I just need to know that variable name, change the parameters in this code and I’m all set.
Thank you!
The page I need help with: [log in to see the link]
- The topic ‘Sorting in different Categories’ is closed to new replies.