Community Forums

reviews moderation

Community created contributions & mods for OpenCart 1.x

reviews moderation

Postby barells » Thu Aug 13, 2009 4:38 pm

Hi,

I notice when a review is added that it goes into moderation. This is ok, but is there a way to turn off the moderation option or at least have an email sent to notify the store admin that a new review has been sent?
barells
 
Posts: 72
Joined: Fri Jun 26, 2009 9:09 pm

Re: reviews moderation

Postby jules_nz » Tue Aug 18, 2009 2:36 am

I think sending the admin an email alerting them of the new review to be accepted would be great
jules_nz
 
Posts: 112
Joined: Tue Aug 11, 2009 4:58 am

Re: reviews moderation

Postby amplifywebdesign » Sun Aug 23, 2009 8:58 pm

Not perfect but will give you something in the way of a notification

First find (and backup)

/catalogue/model/catalogue/review.php
Before line 5 press enter and paste the code below, replacing with your email:

Code: Select all
return mail("EXAMPLE@EXAMPLEMAIL.COM","New product Review","You have a new product review waiting. Log in to review it.");



Screenshots:

Before:
Image



After:
Image



Result:
Image

User avatar
amplifywebdesign
 
Posts: 87
Joined: Fri Aug 21, 2009 5:56 pm
Location: Sheffield & North Wales

Re: reviews moderation

Postby barells » Mon Aug 24, 2009 4:57 pm

thank you for this.
barells
 
Posts: 72
Joined: Fri Jun 26, 2009 9:09 pm

Re: reviews moderation

Postby amplifywebdesign » Mon Aug 24, 2009 5:41 pm

You're welcome ;D
User avatar
amplifywebdesign
 
Posts: 87
Joined: Fri Aug 21, 2009 5:56 pm
Location: Sheffield & North Wales

Re: reviews moderation

Postby littleredcar » Thu Sep 17, 2009 3:34 pm

worked great for me, too! is there a way to style the "from RE USER"? (using 1.2.9)

C A R
C A R
littleredcar
 
Posts: 62
Joined: Thu Jul 30, 2009 8:21 am

Re: reviews moderation

Postby amplifywebdesign » Fri Sep 18, 2009 10:46 am

You mean the 'from' bit? You can specify where the email comes from yes. For example if you wanted to say the email from admin@mystore.com you can replace my code with this:

Code: Select all
return mail("EXAMPLE@EXAMPLEMAIL.COM","New product Review","You have a new product review waiting. Log in to review it.", "From:admin@mystore.com");
User avatar
amplifywebdesign
 
Posts: 87
Joined: Fri Aug 21, 2009 5:56 pm
Location: Sheffield & North Wales

Re: reviews moderation

Postby wilmaogando » Fri Sep 18, 2009 5:13 pm

Hi barells!!

Thanks very much it work great!!!

A question maybe you can help me with and similar to this:
In my sotre I only have the option of paying when receiving the products, so when a customer place an order, check the option Pay when receiving products and confirm order, the order is placed. But I don't receive an e-mail ntifying me about that new order, so I can broke the agreement of deliver in 24 hours because I don't know when a new order is placed.

Note: I have thisoption: Send a email to the store owner when a new order is created set to YES in:
Admin, Configuration, Settins, Option.

What can I do??
Wilma
(Don't speak english)
wilmaogando
 
Posts: 40
Joined: Thu Jul 23, 2009 4:15 pm
Location: Dominican Republic

Re: reviews moderation

Postby Jan R » Sat Oct 17, 2009 3:35 am

Jan here...

I have updated the above script to include the users review directly in the email. This way if the review is needless garbage, you can wait to deal with it later. :)

I also added a link to the admin page for convenience.
Don't forget to change the Email address and edit the path to the admin area. -=:@:=-

Code: Select all
return mail(
   "EXAMPLE@EXAMPLEMAIL.COM",
   "New product Review",
   "You have a new product review waiting.<br>".
   $this->db->escape(strip_tags($data['text']))."<br>".
   '<a href="http://YOURSITE.com/admin/index.php">Login to review</a>'
   );
»-(¯`·.·´¯)->"The most wasted day in that in which we have not laughed."<-(¯`·.·´¯)-«
User avatar
Jan R
 
Posts: 29
Joined: Thu Oct 15, 2009 6:20 pm

Re: reviews moderation

Postby digitalchaos » Sat Oct 17, 2009 4:08 am

is there any way to make it look pretty this is what i get in Microsoft entourage for the mac
You have a new product review waiting.<br>adaad adfgadhadfdhdahahahaaaah<br><a href="http://digitalchaosprints.biz/admin/index.php">Login to review</a>


Thanks
The most terrifying words in the English language are: I'm from the government and I'm here to help.
Ronald Reagan

Digital Chaos | Graphic Design Studio http://www.digitalchaos.biz
Digital Chaos Prints | Custom Art Prints http://www.digitalchaosprints.biz
User avatar
digitalchaos
 
Posts: 59
Joined: Mon Sep 28, 2009 1:22 pm
Location: Paterson NJ

Re: reviews moderation

Postby Jan R » Sat Oct 17, 2009 3:18 pm

Jan here.. hi digitalchaos

My bad. I posted the wrong code.[i gave you the one that did not work] :-\
Use this on the file catalog/model/catalog/review.php
Make a space on line 5 just before the closing '}' and place the code there.

This is using OpenCart's own Mail class, so it should work on most sites. [as seen in catalog/model/checkout/order.php] I replaced the 'setText' with 'setHtml'. and replaced some of the variables [setTo, setFrom, setSender, setSubject] with quoted strings.

Remember to change the LINK and EMAIL setting to fit your site. -=:@:=-

Code: Select all
   
    $message ="<strong>You have a new product review waiting.</strong><br><br>"
   .$this->db->escape(strip_tags($data['text']))."<br>"
   .'<a href="http://YOURSITE.com/admin/index.php">Login to review</a>';
   
     $mail = new Mail($this->config->get('config_mail_protocol'), $this->config->get('config_smtp_host'), $this->config->get('config_smtp_username'), html_entity_decode($this->config->get('config_smtp_password')), $this->config->get('config_smtp_port'), $this->config->get('config_smtp_timeout'));
            $mail->setTo("EXAMPLE@ EXAMPLE.com");
            $mail->setFrom("EXAMPLE@ EXAMPLE.com");
            $mail->setSender("admin");
            $mail->setSubject("Product Review");
            $mail->setHtml($message);
            $mail->send();
»-(¯`·.·´¯)->"The most wasted day in that in which we have not laughed."<-(¯`·.·´¯)-«
User avatar
Jan R
 
Posts: 29
Joined: Thu Oct 15, 2009 6:20 pm

Re: reviews moderation

Postby digitalchaos » Sun Oct 18, 2009 4:21 am

Thanks will try it
The most terrifying words in the English language are: I'm from the government and I'm here to help.
Ronald Reagan

Digital Chaos | Graphic Design Studio http://www.digitalchaos.biz
Digital Chaos Prints | Custom Art Prints http://www.digitalchaosprints.biz
User avatar
digitalchaos
 
Posts: 59
Joined: Mon Sep 28, 2009 1:22 pm
Location: Paterson NJ

Re: reviews moderation

Postby Jan R » Sun Oct 18, 2009 4:20 pm

Jan here...

What I would like to see is a way of excepting or rejecting a review right from the email.
But that is beyond my capability right now -=:@:=-
»-(¯`·.·´¯)->"The most wasted day in that in which we have not laughed."<-(¯`·.·´¯)-«
User avatar
Jan R
 
Posts: 29
Joined: Thu Oct 15, 2009 6:20 pm

Re: reviews moderation

Postby sgfx » Sun Oct 18, 2009 8:49 pm

cool jan
this will make my clients life easer.
thanks
User avatar
sgfx
 
Posts: 18
Joined: Thu Oct 08, 2009 1:56 am

Re: reviews moderation

Postby littleredcar » Mon Oct 19, 2009 4:15 pm

hi jan.

this is great - thanks a lot!
C A R
littleredcar
 
Posts: 62
Joined: Thu Jul 30, 2009 8:21 am

Re: reviews moderation

Postby Wade C » Fri May 14, 2010 7:29 pm

Just did Jan's mod in 1.4.7 and it works great.
Would be a good add in to the core at some point.
Oooppps, did I do that?
Wade C
 
Posts: 62
Joined: Fri Apr 10, 2009 5:12 pm

Re: reviews moderation

Postby pedma » Wed May 26, 2010 4:48 pm

Hi,

How to modify so that the customer (after login) that has bought the specified product can write the reviews ?
May be the Write Review form for this product will shown if he has bought that product, and he can only see the reviews WITHOUT form, if he has not bought this product.

Thanks in advance.
- pedma -
User avatar
pedma
 
Posts: 77
Joined: Tue Apr 27, 2010 7:06 am

Re: reviews moderation

Postby timkirtley » Mon Jun 14, 2010 8:55 am

Great little addition this, works a treat. Only thing I would like to be able to add to the email content is the name of the product being reviewed, could anyone advise me how to do this?

Thanks.
timkirtley
 
Posts: 65
Joined: Thu Jun 03, 2010 11:01 pm

Re: reviews moderation

Postby benjamin » Sun Sep 18, 2011 4:07 pm

I have further improved the code to use the shop configuration instead of hardcoding the email, shop name, etc.

So for those who would like to use it, just copy the following lines to the file catalog/model/catalog/review.php at the end of the method addReview()

Code: Select all

      $this->load->model('catalog/product');
      $product_info = $this->model_catalog_product->getProduct($product_id);

      $message ="<strong>You have a new product review waiting.</strong><br><br>";
      $message.='Product: '.$this->db->escape(strip_tags($product_info['name'])).'<br>';
      $message.='Reviewer: '.$this->db->escape(strip_tags($data['name'])).'<br>';
      $message.='Rating: '.$this->db->escape(strip_tags($data['rating'])).'<br><br>';
      $message.='Text: <br>';
      $message.=$this->db->escape(strip_tags($data['text']))."<br><br>";
      $message.='<a href="'.$this->config->get('config_url').'/admin/index.php">Login to review</a>';

      $mail = new Mail($this->config->get('config_mail_protocol'), $this->config->get('config_smtp_host'), $this->config->get('config_smtp_username'), html_entity_decode($this->config->get('config_smtp_password')), $this->config->get('config_smtp_port'), $this->config->get('config_smtp_timeout'));
        $mail->setTo(array($this->config->get('config_email')));
        $mail->setFrom($this->config->get('config_email'));
        $mail->setSender($this->config->get('config_name'));
        $mail->setSubject("Product Review");
        $mail->setHtml($message);
      $mail->send();


Cheers
Benjamin
--------------------------------------------------------
Bar54 | Toys in Capetown | Catering in Stuttgart
benjamin
 
Posts: 15
Joined: Tue May 11, 2010 10:12 pm
Location: Germany

Re: reviews moderation

Postby joy » Fri Oct 14, 2011 1:32 am

benjamin wrote:I have further improved the code to use the shop configuration instead of hardcoding the email, shop name, etc.

Thank you so much! Works perfectly. :)
joy
 
Posts: 23
Joined: Fri Oct 14, 2011 1:18 am

Next

Return to Free Contributions

Who is online

Users browsing this forum: No registered users and 10 guests

Hosted by Arvixe Web Hosting