Anyway to change the order or default ordering for products on a category page, i.e. instead of alphabetical have it go by price?
Order of products on category page?
2 posts from 2 voices-
Posted 2 months ago #
-
I didn't test the code but based on the code from: http://wcdocs.woothemes.com/snippets/custom-sorting-options-ascdesc/ I'd say you can change the order with:
/** * This code should be added to functions.php of your theme **/ add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args'); function custom_woocommerce_get_catalog_ordering_args( $args ) { $args['orderby'] = 'meta_value_num'; $args['order'] = 'desc'; $args['meta_key'] = '_price'; return $args; }add the code to the very bottom of functions.php. You can also replace desc with asc for an ascending order.
Posted 2 months ago #
Reply
You must log in to post.














