Home Forums WoodMart support forum Order by Rating not working

Order by Rating not working

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #641825

    stevan-8778
    Participant

    Hi,

    On the category pages we are unable to order by average rating. Ordering by price is working fine, but as soon as we order by rating a seemingly random sort order is displayed.

    The product rating of each product is imported from another site using the WooCommerce API and is in the wp_postmeta table with the meta_key ‘_wc_average_rating’. The rating is displayed correctly on each product page.

    I tried disableing most plugins but WooCommerce and Woodmart core, but this does not change anything.

    Is there anything else I can try?

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #642279

    Luke Nielsen
    Keymaster

    Hello,

    Could you please check how it works with some default WordPress themes like WooCommerce Storefront to understand if it is our theme issue or not?

    Kind Regards

    #642452

    stevan-8778
    Participant

    Hi Luke,

    When switching to one of the default themes the same problem occurs. So it seems to be a problem not related to Woodmart.
    In the meantime I found the problem: apparently WooCommerce is not ordering by the _wc_average_rating in the wp_postmeta table. Instead it is using the wp_wc_product_meta_lookup. By adding product ratings to that table everything was in the correct order.

    Thanks for your help.

Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)