Page 1 of 1

How let customers submit their reviews without need of admin confirmation

Posted: Mon Jul 17, 2017 9:07 pm
by FlashPoint1985
Hellp there
I'm not sure if this is right place to ask it then move it if not dear moderator!

currently in default opencart 2.0.3.1 when users put their reviews on a product, it won't show up immediately and need admin to activate it.

is there any way to change it? thanks

Re: How let customers submit their reviews without need of admin confirmation

Posted: Mon Jul 17, 2017 10:00 pm
by DigitCart
Hi,
Open this file:

Code: Select all

catalog/model/catalog/review.php
find:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int)$this->customer->getId() . "', product_id = '" . (int)$product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int)$data['rating'] . "', date_added = NOW()");
change it to:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int)$this->customer->getId() . "', product_id = '" . (int)$product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int)$data['rating'] . "', status = '" . (int)1 . "', date_added = NOW()");

Re: How let customers submit their reviews without need of admin confirmation

Posted: Mon Jul 17, 2017 11:07 pm
by FlashPoint1985
DigitCart wrote:
Mon Jul 17, 2017 10:00 pm
Hi,
Open this file:

Code: Select all

catalog/model/catalog/review.php
find:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int)$this->customer->getId() . "', product_id = '" . (int)$product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int)$data['rating'] . "', date_added = NOW()");
change it to:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int)$this->customer->getId() . "', product_id = '" . (int)$product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int)$data['rating'] . "', status = '" . (int)1 . "', date_added = NOW()");
Thank you so much, worked well, only 1 thing to make it perfect now:

now after review a message tells customer " Thank you for your review. It has been submitted to the webmaster for approval" can you tell me where I can change its text?.

Re: How let customers submit their reviews without need of admin confirmation

Posted: Mon Jul 17, 2017 11:13 pm
by DigitCart
You are welcome.
this file:

Code: Select all

catalog/language/english/product/product.php
find and change the text:

Code: Select all

$_['text_success']             = 'Thank you for your review. It has been submitted to the webmaster for approval.';

Re: How let customers submit their reviews without need of admin confirmation

Posted: Mon Jul 17, 2017 11:32 pm
by FlashPoint1985
Thank so much again :D

Re: How let customers submit their reviews without need of admin confirmation

Posted: Tue Jul 18, 2017 12:31 am
by DigitCart
You're welcome.

Re: How let customers submit their reviews without need of admin confirmation

Posted: Fri Aug 11, 2017 4:42 pm
by chris399@orange.fr
I have a theme weeding, and I don't know how to delete this stars, I have 2.1.0.1