Jump to content

[SOLVED] Receive email notifications about new comments made on product reviews


Recommended Posts

Hi there,

 

I would like to receive an email notification when a client has made a review/posted a comment for a particular product.

 

I know that the module I need to edit is the built in module: Product Comments.

 

I know that the location of the modue is: yoursite/modules/productcomments

 

And I know I need to add a mail call function to one of the files there.

 

I have seen people say that the "productcomments.php" files needs to be edited.

 

This is where I get stuck...

 

Could someone please clearly define the mail call function and please exactly show where it must be put, in the relevant file.

Edited by mandrin (see edit history)
Link to comment
Share on other sites

Thank you for your assistance :)

 

I did reply, but unfortunately, I am not a coder and don't know the exact syntax and exact location to put the string.

 

I have not been lazy and googled the hell out of this :) But what is basic for coders is not for a non-coder.

 

My further reply is in the link you posted above.

 

Kind regards,

Link to comment
Share on other sites

Sweeet! Got it figured out. Thanks Vekia!

 

I am running PS 1.5.6

 

I edited the following file: mywebsite/modules/productcomments/controllers/front/default.php

 

And I added the followin line: mail("[email protected]","new review","new review posted on website")

 

After the first "$comment->save();" on line 110, like so:

$comment->title = Tools::getValue('title');
                $comment->grade = 0;
                $comment->validate = 0;
                $comment->save();
                mail("[email protected]","new product review","new product review posted on website");

                $grade_sum = 0;
                foreach(Tools::getValue('criterion') as $id_product_comment_criterion => $grade)
                {
                    $grade_sum += $grade;
                    $product_comment_criterion = new ProductCommentCriterion($id_product_comment_criterion);
                    if ($product_comment_criterion->id)
                        $product_comment_criterion->addGrade($comment->id, $grade);
                }

It's there in the middle...

 

Again,  thanks for your help Vekia :)

Edited by mandrin (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...