Post by FlashPoint1985 » Mon Jul 17, 2017 9:07 pm

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


Posts

Joined
Mon Jul 17, 2017 9:01 pm

Post by DigitCart » 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()");

My Extensions / DigitCart


User avatar
Active Member
Online

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by FlashPoint1985 » Mon Jul 17, 2017 11:07 pm

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?.


Posts

Joined
Mon Jul 17, 2017 9:01 pm

Post by DigitCart » Mon Jul 17, 2017 11:13 pm

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.';

My Extensions / DigitCart


User avatar
Active Member
Online

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by FlashPoint1985 » Mon Jul 17, 2017 11:32 pm

Thank so much again :D


Posts

Joined
Mon Jul 17, 2017 9:01 pm

Post by DigitCart » Tue Jul 18, 2017 12:31 am

You're welcome.

My Extensions / DigitCart


User avatar
Active Member
Online

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by chris399@orange.fr » Fri Aug 11, 2017 4:42 pm

I have a theme weeding, and I don't know how to delete this stars, I have 2.1.0.1

New member

Posts

Joined
Fri May 13, 2016 9:15 pm
Who is online

Users browsing this forum: No registered users and 12 guests