AbanteCart Development > Customization help

Making review automatic

(1/2) > >>

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:
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)





--- Quote ---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
--- End quote ---

abantecart:
You need to add status = 1 to SQL part:


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

--- End code ---

macat:
Thank you that worked perfect!!

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Social Login Mod