AbanteCart Community
AbanteCart Development => Customization help => Topic started by: macat on July 08, 2013, 02:54:07 AM
-
Is there a way to make the reviews automatically approved?
-
There is no setting currently to auto approve reviews.
You can change code in the model (file below) to save status of 1
storefront/model/catalog/review.php
Look for:
public function addReview(
and add:
status = 1
-
So my file looks like this:
public function addReview(status = 1$product_id, $data)
It doesn't seem to be working, left a comment and it is not there, it seems to be stuck trying to post it, when I reloaded the page I got this error:
Parse error: syntax error, unexpected '=', expecting '&' or T_VARIABLE in /home/chimom/public_html/storefront/model/catalog/review.php on line 24
tried this public function addReview($status = 1, $product_id, $data) site didn't go down but it didn't work either.
I removed it because the whole site was down.
http://www.chihuahuamommas.com/index.php?rt=product/product&path=4&product_id=3
Still shows reviews (0)
There is no setting currently to auto approve reviews.
You can change code in the model (file below) to save status of 1
storefront/model/catalog/review.php
Look for:
public function addReview(
and add:
status = 1
-
You need to add status = 1 to SQL part:
$this->db->query("INSERT INTO " . DB_PREFIX . "reviews
SET author = '" . $this->db->escape($data['name']) . "',
customer_id = '" . (int)$this->customer->getId() . "',
product_id = '" . (int)$product_id . "',
text = '" . $this->db->escape(strip_tags($data['text'])) . "',
rating = '" . (int)$data['rating'] . "',
status = 1,
date_added = NOW()");
-
Thank you that worked perfect!!
-
Glad I can help. I am sorry for not making this clear first time.
-
I can modify php files if you tell me exactly what to do, php is not my first language, someday I hope to learn it better!!