News:

AbanteCart v1.4.2 is released.

Main Menu
support

Making review automatic

Started by macat, July 08, 2013, 02:54:07 AM

Previous topic - Next topic

macat

Is there a way to make the reviews automatically approved?

abantecart

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

macat

#2
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)





QuoteThere 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

abantecart

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()");

macat

Thank you that worked perfect!!


abantecart

Glad I can help. I am sorry for not making this clear first time.

macat

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!!

Forum Rules Code of conduct
AbanteCart.com 2010 -