Post by sander23 » Tue Jun 27, 2017 5:47 pm

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

Active Member

Posts

Joined
Fri Apr 27, 2012 9:16 am

Post by IP_CAM » Tue Jun 27, 2017 6:38 pm

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
Last edited by IP_CAM on Tue Jun 27, 2017 6:43 pm, edited 2 times in total.

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by DigitCart » 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.

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by sander23 » Wed Jun 28, 2017 10:22 pm

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

Active Member

Posts

Joined
Fri Apr 27, 2012 9:16 am

Post by DigitCart » Wed Jun 28, 2017 10:33 pm

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>

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by sander23 » Wed Jun 28, 2017 11:44 pm

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

Active Member

Posts

Joined
Fri Apr 27, 2012 9:16 am

Post by DigitCart » Thu Jun 29, 2017 12:10 am

You are welcome Sander. Glad to hear your problem is solved.

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by North.Bear » Mon Jul 24, 2023 1:03 am

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!

Newbie

Posts

Joined
Mon Jul 24, 2023 12:44 am
Who is online

Users browsing this forum: No registered users and 103 guests