Author Topic: Making review automatic  (Read 7538 times)

Offline macat

  • Full Member
  • ***
  • Posts: 127
  • Karma: +10/-3
    • View Profile
    • Sites Made With Love - Free Animal Rescue Websites
Making review automatic
« on: July 08, 2013, 02:54:07 AM »
Is there a way to make the reviews automatically approved?
happiness is being owned by cats ... pups Emma & angel Lolli(pop)
https://creativePaw.org - creativePaw Creations
https://makemycontest.com - Contest Platform

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Making review automatic
« Reply #1 on: July 13, 2013, 03:24:43 PM »
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
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline macat

  • Full Member
  • ***
  • Posts: 127
  • Karma: +10/-3
    • View Profile
    • Sites Made With Love - Free Animal Rescue Websites
Re: Making review automatic
« Reply #2 on: July 14, 2013, 01:48:59 AM »
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
« Last Edit: July 14, 2013, 02:02:04 AM by macat »
happiness is being owned by cats ... pups Emma & angel Lolli(pop)
https://creativePaw.org - creativePaw Creations
https://makemycontest.com - Contest Platform

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Making review automatic
« Reply #3 on: July 14, 2013, 08:53:47 PM »
You need to add status = 1 to SQL part:

Code: [Select]
$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()");
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline macat

  • Full Member
  • ***
  • Posts: 127
  • Karma: +10/-3
    • View Profile
    • Sites Made With Love - Free Animal Rescue Websites
Re: Making review automatic
« Reply #4 on: July 15, 2013, 01:12:35 AM »
Thank you that worked perfect!!

happiness is being owned by cats ... pups Emma & angel Lolli(pop)
https://creativePaw.org - creativePaw Creations
https://makemycontest.com - Contest Platform

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Making review automatic
« Reply #5 on: July 15, 2013, 08:22:47 AM »
Glad I can help. I am sorry for not making this clear first time.
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline macat

  • Full Member
  • ***
  • Posts: 127
  • Karma: +10/-3
    • View Profile
    • Sites Made With Love - Free Animal Rescue Websites
Re: Making review automatic
« Reply #6 on: July 15, 2013, 11:04:42 AM »
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!!
happiness is being owned by cats ... pups Emma & angel Lolli(pop)
https://creativePaw.org - creativePaw Creations
https://makemycontest.com - Contest Platform

 

Powered by SMFPacks Social Login Mod