Post by barells » Fri Aug 14, 2009 12:38 am

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?

New member

Posts

Joined
Sat Jun 27, 2009 5:09 am

Post by jules_nz » Tue Aug 18, 2009 10:36 am

I think sending the admin an email alerting them of the new review to be accepted would be great

Active Member

Posts

Joined
Tue Aug 11, 2009 12:58 pm

Post by amplifywebdesign » Mon Aug 24, 2009 4:58 am

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
New member

Posts

Joined
Sat Aug 22, 2009 1:56 am
Location - Sheffield & North Wales

Post by barells » Tue Aug 25, 2009 12:57 am

thank you for this.

New member

Posts

Joined
Sat Jun 27, 2009 5:09 am

Post by amplifywebdesign » Tue Aug 25, 2009 1:41 am

You're welcome ;D

User avatar
New member

Posts

Joined
Sat Aug 22, 2009 1:56 am
Location - Sheffield & North Wales

Post by littleredcar » Thu Sep 17, 2009 11:34 pm

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

C A R

---
Environment
php: 7.4.33
Browser: Chrome latest

---
OpenCart
2.3.0.2 singlestore (bugfree edition by xxvirusxx: https://github.com/condor2/Opencart_2302)
DE language by OSWorX (https://www.opencart.com/index.php?rout ... n_id=31048)
Template: Sellmore by 321cart
quite a few Extensions :-)


Active Member

Posts

Joined
Thu Jul 30, 2009 4:21 pm

Post by amplifywebdesign » Fri Sep 18, 2009 6:46 pm

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
New member

Posts

Joined
Sat Aug 22, 2009 1:56 am
Location - Sheffield & North Wales

Post by wilmaogando » Sat Sep 19, 2009 1:13 am

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)


New member

Posts

Joined
Fri Jul 24, 2009 12:15 am
Location - Dominican Republic

Post by Jan R » Sat Oct 17, 2009 11: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
New member

Posts

Joined
Fri Oct 16, 2009 2:20 am

Post by digitalchaos » Sat Oct 17, 2009 12:08 pm

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
New member

Posts

Joined
Mon Sep 28, 2009 9:22 pm
Location - Paterson NJ

Post by Jan R » Sat Oct 17, 2009 11:18 pm

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

»-(¯`·.·´¯)->"The most wasted day in that in which we have not laughed."<-(¯`·.·´¯)-«


User avatar
New member

Posts

Joined
Fri Oct 16, 2009 2:20 am

Post by digitalchaos » Sun Oct 18, 2009 12:21 pm

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
New member

Posts

Joined
Mon Sep 28, 2009 9:22 pm
Location - Paterson NJ

Post by Jan R » Mon Oct 19, 2009 12:20 am

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
New member

Posts

Joined
Fri Oct 16, 2009 2:20 am

Post by sgfx » Mon Oct 19, 2009 4:49 am

cool jan
this will make my clients life easer.
thanks

User avatar
Newbie

Posts

Joined
Thu Oct 08, 2009 9:56 am

Post by littleredcar » Tue Oct 20, 2009 12:15 am

hi jan.

this is great - thanks a lot!

---
Environment
php: 7.4.33
Browser: Chrome latest

---
OpenCart
2.3.0.2 singlestore (bugfree edition by xxvirusxx: https://github.com/condor2/Opencart_2302)
DE language by OSWorX (https://www.opencart.com/index.php?rout ... n_id=31048)
Template: Sellmore by 321cart
quite a few Extensions :-)


Active Member

Posts

Joined
Thu Jul 30, 2009 4:21 pm

Post by Wade C » Sat May 15, 2010 3:29 am

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.

New member

Posts

Joined
Sat Apr 11, 2009 1:12 am

Post by pedma » Thu May 27, 2010 12:48 am

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
New member

Posts

Joined
Tue Apr 27, 2010 3:06 pm

Post by timkirtley » Mon Jun 14, 2010 4:55 pm

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.

New member

Posts

Joined
Fri Jun 04, 2010 7:01 am

Post by benjamin » Mon Sep 19, 2011 12:07 am

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


Newbie

Posts

Joined
Wed May 12, 2010 6:12 am
Location - Germany

Post by joy » Fri Oct 14, 2011 9: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
New member

Posts

Joined
Fri Oct 14, 2011 9:18 am
Who is online

Users browsing this forum: No registered users and 8 guests