Pagination using AJAX

I’ve been trying to make a pagination to work, but i can’t find any workaround to do it.

I have product reviews in the product page. I also added pagination using the pagination.tpl with id “discussion_block_comments_{$product.product_id}”.

I’ve checked that the next page arrow has the cm-ajax class in it, but when i click it it refreshes the page and not the container of the reviews.

When I don’t give an ID to the pagination, the default value is “pagination_contents”. If this is the ID, the pagination works with AJAX when i click on the next page arrow, but it doesn’t refresh the container.

So, i left it with the default id.
How am i supposed to make it work? What am i supposed to look after for? I can’t make the pagination work with Ajax for the reviews.

Can anyone provide me the theory behind it?

Pagination needs to be implemented on both template level (to provide the pagination interface) and on code level (so that functions pulling the information know what info they should pull).
It’s hard to tell what are you doing wrong without looking into code, but I recommend checking how it’s done in products, or in promotions.

Best regards,

1 Like