Page 1 of 1

All product reviews on a single page instead of being paginated

Posted: Tue Jun 27, 2017 5:47 pm
by sander23
Hey guys,

I would ask if there can be any way to make all reviews for a product appear on one single page, instead of being paginated to just 5 per page. I need this because an extension for seo is screwing things up and it just allows to see the first page.

Thanks so much for the help.

Blessings and much love
Sander

Re: All product reviews on a single page instead of being paginated

Posted: Tue Jun 27, 2017 6:38 pm
by IP_CAM
well, did you try to change this line: (OC v.1.5.6.x !)

Code: Select all

<div class="reviews"><?php for ($i = 1; $i <= 5; $i++) {
to this:

Code: Select all

<div class="reviews"><?php for ($i = 1; $i <= 500; $i++) {
in this file:
... theme/default/template/product/review.tpl (or, if you use a custom theme, in your theme...)
in order to just raise the pagination Value, instead of removing pagination.
Just an strange idea, I never played around with reviews. :D
Ernie

Re: All product reviews on a single page instead of being paginated

Posted: Tue Jun 27, 2017 6:41 pm
by DigitCart
Yes, it's possible.
Open this file:

Code: Select all

catalog/model/catalog/review.php
and remove limit from end of this query:

Code: Select all

$query = $this->db->query("SELECT r.review_id, r.author, r.rating, r.text, p.product_id, pd.name, p.price, p.image, r.date_added FROM " . DB_PREFIX . "review r LEFT JOIN " . DB_PREFIX . "product p ON (r.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND p.date_available <= NOW() AND p.status = '1' AND r.status = '1' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY r.date_added DESC LIMIT " . (int)$start . "," . (int)$limit);
It should be:

Code: Select all

$query = $this->db->query("SELECT r.review_id, r.author, r.rating, r.text, p.product_id, pd.name, p.price, p.image, r.date_added FROM " . DB_PREFIX . "review r LEFT JOIN " . DB_PREFIX . "product p ON (r.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND p.date_available <= NOW() AND p.status = '1' AND r.status = '1' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY r.date_added DESC ");
Then remove reviews pagination from your theme. you don't need them anymore.

Re: All product reviews on a single page instead of being paginated

Posted: Wed Jun 28, 2017 10:22 pm
by sander23
Thanks so much for your answers IP_CAM and Digitart.

@IP_CAM - My version of OC is 1.5.5.1 the file review.tpl I can only find in catalog/view/theme/default/template/ , but there is no such line as <div class="reviews"><?php for ($i = 1; $i <= 5; $i++) {
to be able to work on :)

@Digitcart thank you, I used your code modification and it works, it shows all the reviews on the first page...but it remains the need remove the pagination from the template, any suggestions? :)

Thanks so much for your time guys.
Much love

Sander

Re: All product reviews on a single page instead of being paginated

Posted: Wed Jun 28, 2017 10:33 pm
by DigitCart
You are welcome.
In default theme reviews pagination is in this file:

Code: Select all

catalog/view/theme/default/template/product/review.tpl
remove:

Code: Select all

<div class="pagination"><?php echo $pagination; ?></div>

Re: All product reviews on a single page instead of being paginated

Posted: Wed Jun 28, 2017 11:44 pm
by sander23
You are THE MAN, DigitCart! Thanks so much for your solution, problem solved, all works great.

I owe you brother.
Thanks again
Sending you blessings.

Sander

Re: All product reviews on a single page instead of being paginated

Posted: Thu Jun 29, 2017 12:10 am
by DigitCart
You are welcome Sander. Glad to hear your problem is solved.

Re: All product reviews on a single page instead of being paginated

Posted: Mon Jul 24, 2023 1:03 am
by North.Bear
DigitCart wrote:
Tue Jun 27, 2017 6:41 pm
Yes, it's possible.
Open this file:

Code: Select all

catalog/model/catalog/review.php
and remove limit from end of this query:

Code: Select all

$query = $this->db->query("SELECT r.review_id, r.author, r.rating, r.text, p.product_id, pd.name, p.price, p.image, r.date_added FROM " . DB_PREFIX . "review r LEFT JOIN " . DB_PREFIX . "product p ON (r.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND p.date_available <= NOW() AND p.status = '1' AND r.status = '1' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY r.date_added DESC LIMIT " . (int)$start . "," . (int)$limit);
It should be:

Code: Select all

$query = $this->db->query("SELECT r.review_id, r.author, r.rating, r.text, p.product_id, pd.name, p.price, p.image, r.date_added FROM " . DB_PREFIX . "review r LEFT JOIN " . DB_PREFIX . "product p ON (r.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND p.date_available <= NOW() AND p.status = '1' AND r.status = '1' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY r.date_added DESC ");
Then remove reviews pagination from your theme. you don't need them anymore.
Hello,
I need your help too, I installed OC 3.0.2.0 and custom theme.
I have removed from limit

Code: Select all

catalog/model/catalog/review.php
and then removed reviews pagination from default and custom themes.
Now product show all the reviews but error show on the header top.
Notice: Undefined variable: limit in /home/www/example.com/catalog/model/catalog/review.php on line 55

I really appreciate your help.
Thank you!