[ad_1]
when I have a category with a custom order, the pre_get_posts that is done, disables the ability to sort by date.
I have solved it by including this in the plugin:
public function sort_products_by_category( $query ) {
if( isset( $_GET['orderby'] ) && $_GET['orderby'] == 'date' )
return;
if ( ( is_product_category() || is_product_tag() ) && $query->is_main_query() && ! is_admin() ) {
But of course, aside from not wanting to touch the plugin, I’m sure you have a much more elegant way to do it within your own plugin.
Thank you very much.