• Resolved saens

    (@saens)


    Hi,
    I must be going crazy, cause something seems off.

    Say I have a product with 12 reviews. What I want is latest review at the top, and always show (the latest) 10 reviews per page (with older ones moving to 2nd page).
    With the latest review shown on top.

    With WP settings this doesn’t seem possible.
    If I set it to 10 per page and last page shown I see only the latest 2 reviews and 10 on the first page. What I’d want is see the last 10, with the other 2 moving to other page.

    I added an image: https://imgur.com/a/bpjomRf

    • This topic was modified 4 years, 5 months ago by saens.
    • This topic was modified 4 years, 5 months ago by saens.
    • This topic was modified 4 years, 5 months ago by saens.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @saens!

    It sounds like you would like to have the most recent reviews listed first. If that is the case, you can use some code, as outlined here:

    https://jeffgrundy.com/woocommerce-display-newest-product-reviews-first/

    This is how you can add custom code to your site the correct way:

    https://rynaldo.com/how-to-add-custom-code-to-your-woocommerce-wordpress-site-the-right-way/

    Cheers!

    Thread Starter saens

    (@saens)

    Hi, thanks. It does not do what I want. I want to always see the latest 10 reviews on the page. The splitting of the 10s (out of total) does not start with the latest 10, but with the oldest 10 working forwards in time.

    The way it’s working now:

    with 11 reviews, the latest review is on a page and the other 10 on the other page
    with 20 reviews, it’s 10 on the first and 10 on the 2nd (OK)
    with 21 reviews, it’s latest review on the first and 10 on the 2nd page and 1 on the third.

    It’s also explained here: https://bassjobsen.weblogs.fm/wordpress-reverse-comment-order-paged-comments/

    Neither code solutions in functions.php work for me, though.

    The comments are sorted in reverse order, but when adding the X per page option the undesired splitting over pages happens.

    • This reply was modified 4 years, 5 months ago by saens.
    • This reply was modified 4 years, 5 months ago by saens.
    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    The comments are sorted in reverse order, but when adding the X per page option the undesired splitting over pages happens.

    What happens when you try combinations of these settings:

    https://d.pr/i/u037kl
    and the custom code here: https://jeffgrundy.com/woocommerce-display-newest-product-reviews-first/

    Kind regards,

    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Kind regards,

    Hi There – I am having the same issue! I’ve tried adding the code snippet to functions.php but like @saens the pagination breaks up the re-ordering so page 1 still has the oldest posts (just re-ordered newest to oldest) and page 3 has the newest.

    Is there any other work arounds we can try?

    Thread Starter saens

    (@saens)

    Afaik there is not. Even though this is marked as resolved, the issue is not resolved.
    Marking stuff as “resolved” when the topic starter hits a brick wall is fun ??

    I worked around it by creating my own code which pulls the comments from the database and shows them.

    Any chance you want to share that code with me? ??

    @conschneider

    Thread Starter saens

    (@saens)

    The gist is:
    Fil array with the comments

    		$comments = get_comments( array( 
    			'post_id' => $product->get_id(),
    			'number' => $count_reviews,
    			'type' => 'review'
    			) );

    then run through the loop and output the comment how you wish.
    I put it together based off examples at stackexchange.com

    My code won’t help you since it’s tailored to my specific demands. The basic is the same as the examples that you can find.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Review ordering’ is closed to new replies.