• I want to order my products in category page by average rating (DESC) and then by price (ASC).

    | id  |  avgrating   |   price   |
    |  1  |      4       |     10    |
    |  2  |      4       |      5    |
    |  3  |      5       |      7    |

    Order: 3, 2, 1.

    So I tried with:

    $args['meta_key'] = '_wc_average_rating';
    $args['orderby']  = array(
        'meta_value_num' => 'DESC',
        'price' => 'ASC',
    );

    But they aren’t ordered (also) by price. I also replaced price with _price, same result.

    I’m using latest version of WordPress (4.8) and WooCommerce (3.0.8).

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple order by in WooCommerce Ask Question’ is closed to new replies.