Page 1 of 2
reviews moderation
Posted: Fri Aug 14, 2009 12:38 am
by barells
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?
Re: reviews moderation
Posted: Tue Aug 18, 2009 10:36 am
by jules_nz
I think sending the admin an email alerting them of the new review to be accepted would be great
Re: reviews moderation
Posted: Mon Aug 24, 2009 4:58 am
by amplifywebdesign
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:

After:

Result:

Re: reviews moderation
Posted: Tue Aug 25, 2009 12:57 am
by barells
thank you for this.
Re: reviews moderation
Posted: Tue Aug 25, 2009 1:41 am
by amplifywebdesign
You're welcome

Re: reviews moderation
Posted: Thu Sep 17, 2009 11:34 pm
by littleredcar
worked great for me, too! is there a way to style the "from RE USER"? (using 1.2.9)
C A R
Re: reviews moderation
Posted: Fri Sep 18, 2009 6:46 pm
by amplifywebdesign
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");
Re: reviews moderation
Posted: Sat Sep 19, 2009 1:13 am
by wilmaogando
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??
Re: reviews moderation
Posted: Sat Oct 17, 2009 11:35 am
by Jan R
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>'
);
Re: reviews moderation
Posted: Sat Oct 17, 2009 12:08 pm
by digitalchaos
is there any way to make it look pretty this is what i get in Microsoft entourage for the mac
Thanks
Re: reviews moderation
Posted: Sat Oct 17, 2009 11:18 pm
by Jan R
Jan here.. hi digitalchaos
My bad. I posted the wrong code.
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();
Re: reviews moderation
Posted: Sun Oct 18, 2009 12:21 pm
by digitalchaos
Thanks will try it
Re: reviews moderation
Posted: Mon Oct 19, 2009 12:20 am
by Jan R
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 -=:@:=-
Re: reviews moderation
Posted: Mon Oct 19, 2009 4:49 am
by sgfx
cool jan
this will make my clients life easer.
thanks
Re: reviews moderation
Posted: Tue Oct 20, 2009 12:15 am
by littleredcar
hi jan.
this is great - thanks a lot!
Re: reviews moderation
Posted: Sat May 15, 2010 3:29 am
by Wade C
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.
Re: reviews moderation
Posted: Thu May 27, 2010 12:48 am
by pedma
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 -
Re: reviews moderation
Posted: Mon Jun 14, 2010 4:55 pm
by timkirtley
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.
Re: reviews moderation
Posted: Mon Sep 19, 2011 12:07 am
by benjamin
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
Re: reviews moderation
Posted: Fri Oct 14, 2011 9:32 am
by joy
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.
