Add Pagination to WooCommerce Reviews
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

Hi again guys,

I would need someone to help me to paginate the reviews tab in woocommerce, so it stops breaking and allow me to set a maximum amount of reviews per page that I can adjust later down the line if needed. I tried using the built-in wordpress pagination for comments but it seems woocommerce doesn't like that very much, as it breaks the reviews page and doesn't allow me to paginate it properly.

In this regard, I would also need to set a maximum limit on characters per review comment, so my layout doesn't break in the future by too many or too long comments :)

However, if there is an alternative to all of this and make the tabs dynamically refresh/reload on a click, so the automatic adjustment of my border and background height happens automatically, that would be even better and would of course solve all previous problems in an instant, so if that's possible, I would obviously be very happy with that, even if it would require an extra tip :)

Thanks guys and rock on!

awarded to Nuno Freitas

Crowdsource coding tasks.

1 Solution

Winning solution

If you want to solve the problem that the height doesn't change when you click on one of the tabs you can try this solution:

jQuery(document).ready(function () {
    jQuery('.et-tabs nav li a').click(function () {
        jQuery(window).trigger('resize');
    });
});

This will trigger a resize and cause the scripts that set the height dynamically to run.

Edit:

You should add this after the other scripts.

Not sure how your theme is structured. You probably have a function in functions.php that includes the scripts. Search for wp_enqueue_script.

Create a tabs-autoresize.js file with the content above and add this at the end of the function that is including the scripts:

wp_enqueue_script( 'tabs-autoresize', get_template_directory_uri() . '/assets/js/tabs-autoresize.js', array( 'jquery' ), null, true );

Notice the path to the script and adjust accordingly. Let me know if you have any additional questions

I think I get the idea here, but since I am a noob with Javascript and since the script that's already there that equalizes the columns comes from a plugin, where exactly would I need to add that code and would I need to call it in the functions.php file somehow? I'll gladly try it and report back if it solved my issue :) Thanks a lot!
Vyazhan 3 years ago
Check my edit and let me know if it works. Thanks.
Nuno Freitas 3 years ago
EDIT: Nevermind, I got the DUH moment and it works, you are a star my friend, I will come back here again and recommend this site for sure, awesome guidance and very cool from you wonderful helpers!
Vyazhan 3 years ago
Thank you! Your welcome.
Nuno Freitas 3 years ago