@@ -196,23 +196,23 @@ public function get_query_args() {
196196 $ query_args ['graphql_cursor_compare_by_price_key ' ] = 'wc_product_meta_lookup.max_price ' ;
197197 $ query_args ['graphql_cursor_compare_by_price_value ' ] = $ price ;
198198 }
199- }
200-
201- if ( $ offset_product && 'popularity ' === $ query_args ['orderby ' ] ) {
199+ } elseif ( $ offset_product && 'popularity ' === $ query_args ['orderby ' ] ) {
202200 $ query_args ['graphql_cursor_compare_by_popularity_value ' ] = $ offset_product ->get_total_sales ();
203201 $ query_args ['graphql_cursor_compare_by_popularity_key ' ] = 'wc_product_meta_lookup.total_sales ' ;
204- }
205-
206- if ( $ offset_product && 'rating ' === $ query_args ['orderby ' ] ) {
202+ } elseif ( $ offset_product && 'rating ' === $ query_args ['orderby ' ] ) {
207203 $ query_args ['graphql_cursor_compare_by_rating_value ' ] = $ offset_product ->get_average_rating ();
208204 $ query_args ['graphql_cursor_compare_by_rating_key ' ] = 'wc_product_meta_lookup.average_rating ' ;
209- }
210-
211- if ( $ offset_product && 'comment_count ' === $ query_args ['orderby ' ] ) {
205+ } elseif ( $ offset_product && 'comment_count ' === $ query_args ['orderby ' ] ) {
212206 $ query_args ['graphql_cursor_compare_by_comment_count_value ' ] = $ offset_product ->get_rating_count ();
213207 $ query_args ['graphql_cursor_compare_by_comment_count_key ' ] = 'wc_product_meta_lookup.rating_count ' ;
214208 $ query_args ['graphql_cursor_compare_by_rating_value ' ] = $ offset_product ->get_average_rating ();
215209 $ query_args ['graphql_cursor_compare_by_rating_key ' ] = 'wc_product_meta_lookup.average_rating ' ;
210+ } elseif ( $ offset_product && 'menu_order title ' === $ query_args ['orderby ' ] ) {
211+ $ query_args ['orderby ' ] = [
212+ 'menu_order ' => $ query_args ['order ' ],
213+ 'post_title ' => isset ( $ this ->args ['last ' ] ) ? 'ASC ' : 'DESC ' ,
214+ ];
215+ unset( $ query_args ['order ' ] );
216216 }
217217
218218 /**
0 commit comments