Jump to content

Product Comments Not Working - Error


Recommended Posts

I'm trying to add comments for my products and it's not working. Does anyone know if this is a known issue or not? I tried both Chrome and IE and both have the following error message when I hit submit.

 

"Failed to load resource: the server responded with a status of 404 (Not Found)".

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

I am too looking for a solution..

 

One thing I noticed is the url which is generating 404 is pointing to "/modules/productcomments/default&action=" although the default.php is in "/modules/productcomments/controllers/front/"

are there any ways to force the url to point to default.php in "/modules/productcomments/controllers/front/", maybe that helps ?
Link to comment
Share on other sites

I think the ploblems is in thi file productcomments.tpl, i am sendig a copy.

 

<script type="text/javascript">

var productcomments_controller_url = '{$productcomments_controller_url}';

var confirm_report_message = "{l s='Are you sure you want report this comment?' mod='productcomments'}";

var secure_key = "{$secure_key}";

var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';

</script>

 

<div id="idTab5">

<div id="product_comments_block_tab">

{if $comments}

{foreach from=$comments item=comment}

{if $comment.content}

<div class="comment clearfix">

<div class="comment_author">

<span>{l s='Grade' mod='productcomments'}&nbsp</span>

<div class="star_content clearfix">

{section name="i" start=0 loop=5 step=1}

{if $comment.grade le $smarty.section.i.index}

<div class="star"></div>

{else}

<div class="star star_on"></div>

{/if}

{/section}

</div>

<div class="comment_author_infos">

<strong>{$comment.customer_name|escape:'html':'UTF-8'}</strong><br/>

<em>{dateFormat date=$comment.date_add|escape:'html':'UTF-8' full=0}</em>

</div>

</div>

<div class="comment_details">

<h4>{$comment.title}</h4>

<p>{$comment.content|escape:'html':'UTF-8'|nl2br}</p>

<ul>

{if $comment.total_advice > 0}

<li>{l s='%1$d out of %2$d people found this review useful.' sprintf=[$comment.total_useful,$comment.total_advice] mod='productcomments'}</li>

{/if}

{if $logged == 1}

{if !$comment.customer_advice}

<li>{l s='Was this comment useful to you?' mod='productcomments'}<button class="usefulness_btn" data-is-usefull="1" data-id-product-comment="{$comment.id_product_comment}">{l s='yes' mod='productcomments'}</button><button class="usefulness_btn" data-is-usefull="0" data-id-product-comment="{$comment.id_product_comment}">{l s='no' mod='productcomments'}</button></li>

{/if}

{if !$comment.customer_report}

<li><span class="report_btn" data-id-product-comment="{$comment.id_product_comment}">{l s='Report abuse' mod='productcomments'}</span></li>

{/if}

{/if}

</ul>

</div>

</div>

{/if}

{/foreach}

{else}

{if ($too_early == false AND ($logged OR $allow_guests))}

<p class="align_center">

<a id="new_comment_tab_btn" class="open-comment-form" href="#new_comment_form">{l s='Be the first to write your review' mod='productcomments'} !</a>

</p>

{else}

<p class="align_center">{l s='No customer comments for the moment.' mod='productcomments'}</p>

{/if}

{/if}

</div>

</div>

 

<!-- Fancybox -->

<div style="display: none;">

<div id="new_comment_form">

<form action="#" method="post" id="sendComment" style="display:block;">

<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>

<div class="product clearfix">

<img src="{$link->getImageLink($stf_product->link_rewrite, $productcomment_cover, 'home')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$stf_product->name|escape:html:'UTF-8'}" />

<div class="product_desc">

<p class="product_name"><strong>{$product->name}</strong></p>

{$product->description_short}

</div>

</div>

 

<div class="new_comment_form_content">

<h2>{l s='Write your review' mod='productcomments'}</h2>

 

<div id="new_comment_form_error" class="error" style="display: none;">

<ul></ul>

</div>

 

{if $criterions|@count > 0}

<ul id="criterions_list">

{foreach from=$criterions item='criterion'}

<li>

<label>{$criterion.name|escape:'html':'UTF-8'}:</label>

<div class="star_content">

<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="1" />

<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="2" />

<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="3" checked="checked" />

<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="4" />

<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="5" />

</div>

<div class="clearfix"></div>

</li>

{/foreach}

</ul>

{/if}

 

<label for="comment_title">{l s='Title' mod='productcomments'}: <sup class="required">*</sup></label>

<input id="comment_title" name="title" type="text" value=""/>

 

<label for="content">{l s='Comment' mod='productcomments'}: <sup class="required">*</sup></label>

<textarea id="content" name="content"></textarea>

 

{if $allow_guests == true && $logged == 0}

<label>{l s='Your name' mod='productcomments'}: <sup class="required">*</sup></label>

<input id="commentCustomerName" name="customer_name" type="text" value=""/>

{/if}

 

<div id="new_comment_form_footer">

<input id="id_product_comment_send" name="id_product" type="hidden" value='{$id_product_comment_form}'></input>

<p class="fl required"><sup>*</sup> {l s='Required fields' mod='productcomments'}</p>

<p class="fr">

<a href="#" onclick="$.fancybox.close();">{l s='Cancel' mod='productcomments'}</a> {l s='or' mod='productcomments'} 

<button id="submitNewMessage" name="submitMessage" type="submit">{l s='Send' mod='productcomments'}</button>

</p>

<div class="clearfix"></div>

</div>

</div>

</form><!-- /end new_comment_form_content -->

</div>

</div>

<!-- End fancybox -->

 

Maybe you can help me..

 

Tnank you... :rolleyes:

Link to comment
Share on other sites

The url that is adding the comment is

 

 

The "?" before action should be &.

 

Can you try with the following "row 59":

 

	    url: productcomments_controller_url+'&action=add_comment&secure_key='+secure_key,

 

  • Like 2
Link to comment
Share on other sites

Thanks for the help UltraWebDev! That did the trick.

 

Damien, you said you fixed the problem and also said you fixed it in the forget but I don't see an update to the module. Have you not released it yet or are you going to include this update in the next Prestashop release?

 

Thanks!

Link to comment
Share on other sites

Hi, my comment can be post to server, i can see it under validated section, but the box was not able to close itself, it seems like it didn't get back the ajax feedback...anyone have idea how to fix it...?

 

thanks

 

edit:

ok , i found out the problem....as i don't have any criterion, and result in getting php warning in line 113 (default.php), and fail the json string

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

  • 2 weeks later...

Thank you very much UltraWebDev

 

Open \modules\productcomments\js\productcomments.js

 

at row 57 (PrestaShop 1.5.0.17) there's:

 

url_options = productcomments_url_rewrite ? '&' : '?';

 

replace it with:

 

url_options = '?';

 

If this helps consider giving me 5 stars at my profile :) and "like" my comment.

 

PS: This is the quickest way (the simplest). For the people that know a little bit JS, they can just remove that line, remove the variable using at row 59, and add the "?" before "action", so row 59 will be:

url: productcomments_controller_url+'?action=add_comment&secure_key='+secure_key,

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 2 months later...
  • 2 weeks later...
  • 3 weeks later...

Well, my products comment module in PS 1.5.3.1 is not working.

When I install the module, my product page stop loading, giving server error, I guess is some code error, but as I'm not an expert, I don't know what can be.

 

I tryed with the module from 1.4.x version, but it doesn't install.

 

Someone have this issue?

 

Can someone upload the module in this thread so I can try using it?

Thanks!

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Well, my products comment module in PS 1.5.3.1 is not working.

When I install the module, my product page stop loading, giving server error, I guess is some code error, but as I'm not an expert, I don't know what can be.

 

I tryed with the module from 1.4.x version, but it doesn't install.

 

Someone have this issue?

 

Can someone upload the module in this thread so I can try using it?

Thanks!

 

Me also i'll give it a shot. I have it working on one site and not the other. A little confused here.

Link to comment
Share on other sites

  • 5 weeks later...
  • 2 weeks later...

Open \modules\productcomments\js\productcomments.js

 

at row 57 (PrestaShop 1.5.0.17) there's:

 

url_options = productcomments_url_rewrite ? '&' : '?';

 

replace it with:

 

url_options = '?';

 

If this helps consider giving me 5 stars at my profile :) and "like" my comment.

 

PS: This is the quickest way (the simplest). For the people that know a little bit JS, they can just remove that line, remove the variable using at row 59, and add the "?" before "action", so row 59 will be:

url: productcomments_controller_url+'?action=add_comment&secure_key='+secure_key,

 

This saved my day!

 

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 3 months later...

Seems there are some problems also on PS 1.5.5.

 

The fix is very simple, just replace this line 62 on file modules/productcomments/js/productcomments.js:

data: $('#fancybox_content form').serialize()

 

with this one

data: $('#new_comment_form form').serialize()

 

Someone has changed the template on frontend and forget to change the js script to match the IDs form html code.

 

 

 

Link to comment
Share on other sites

Seems there are some problems also on PS 1.5.5.

 

The fix is very simple, just replace this line 62 on file modules/productcomments/js/productcomments.js:

data: $('#fancybox_content form').serialize()

 

with this one

data: $('#new_comment_form form').serialize()

 

Someone has changed the template on frontend and forget to change the js script to match the IDs form html code.

 

 

The fix we have implemented is actually changing that line to

 

data: $('#id_new_comment_form').serialize(),

 

 

Does this work for you? 

Link to comment
Share on other sites

  • 3 weeks later...

I am using the same module...Right now i am facing three problem with this please help me out

1) How to remove the title options from the product  comment...i dnt want the title options in my comment.PLease note that some how i have managed to remove the title field from comment but after removing it when i leave a comment it give error as wrong title.

2) There is options in this module about "Was this comment useful to you", but it seem it is not working on my website

3) At last most important, even if the customer is logged in it is asking for the name of customer

Please note that i am using the same tpl file given above....

Link to comment
Share on other sites

I have the same error

 

 

I'm getting this error when user wants to comment:

 

  • Title is incorrect
  • Comment is incorrect
  • Product not found

 

 

I did a php dump in function ajaxProcessAddComment() to see the input being sent to /productcomments/default no review information is submitted from form.

 

Also Firebug is showing only 3 GET and nothing in POST

action=add_comment

secure_key=***************

rand=***************

die(print_r($_POST,true).' :: '.print_r($_GET,true));
Link to comment
Share on other sites

The fix we have implemented is actually changing that line to

 

data: $('#id_new_comment_form').serialize(),

 

 

Does this work for you? 

 

I had to add id="id_new_comment_form" to the file /modules/productcomments/productcomments.tpl

    <div id="new_comment_form">
        <form action="#" id="id_new_comment_form">
            <h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
Link to comment
Share on other sites

  • 3 weeks later...

 

I had to add id="id_new_comment_form" to the file /modules/productcomments/productcomments.tpl

    <div id="new_comment_form">
        <form action="#" id="id_new_comment_form">
            <h2 class="title">{l s='Write your review' mod='productcomments'}</h2>

Partly helps, now no errors displayed - 2-3 secs and window with comment closes. But website doesn't show the comment. What can I do?

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

Partly helps, now no errors displayed - 2-3 secs and window with comment closes. But website doesn't show the comment. What can I do?

 

See if your setting is set to true for  "All comments must be validated by an employee" in the Backofice -> Modules -> Product Comments

Link to comment
Share on other sites

  • 3 weeks later...

Same problem here ...

 

in the TPL i have :

<div id="new_comment_form">
		<form id="id_new_comment_form" action="#">
			<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>

and in the JS :

url_options = parseInt(productcomments_url_rewrite) ? '?' : '&';
		$.ajax({
			url: productcomments_controller_url + url_options + 'action=add_comment&secure_key=' + secure_key + '&rand=' + new Date().getTime(),
			data: $('#id_new_comment_form').serialize(),
			type: 'POST',
			headers: { "cache-control": "no-cache" },

But no action ...

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

Same problem here ...

 

in the TPL i have :

<div id="new_comment_form">
		<form id="id_new_comment_form" action="#">
			<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>

and in the JS :

url_options = parseInt(productcomments_url_rewrite) ? '?' : '&';
		$.ajax({
			url: productcomments_controller_url + url_options + 'action=add_comment&secure_key=' + secure_key + '&rand=' + new Date().getTime(),
			data: $('#id_new_comment_form').serialize(),
			type: 'POST',
			headers: { "cache-control": "no-cache" },

But no action ...

 

Hi, what version are you using? The comment module works well on a default install and theme. 

Link to comment
Share on other sites

Awesome. Make sure to test out all installations of modules and themes first. That way, you can know what was working and what was not working before you did changes.

 

Let us know what the developer has said. I did test it for 1.5.6.1 and it worked for me.

 

my website have the same problem. comments module is working on default theme but not working on premium theme

 

i typed to developer.im just waiting to him solve it. or should i do something?

 

Regards

Ps3z

Link to comment
Share on other sites

  • 1 month later...

I'm having this same error:

 

 

 

 

Is there any solution to this available yet? :(

 

What version are you using? 

 

If you are using v1.5, make sure to back up and then replace the file modules/productcomments/js/productcomments.js with the file here, https://raw2.github.com/PrestaShop/PrestaShop/master/modules/productcomments/js/productcomments.js

 

Copy and paste the contents of that link to replace what you have in the productcomments.js . Make sure to backup!

  • Like 1
Link to comment
Share on other sites

Guys, forget about this module. I posted in this same thread a couple of months ago because I was experiencing the same problem in PS 1.5. Despite all the help from the forum, I never managed to get it working.

 

However, a friend of mine (who had the same problem) told me he found an awesome FREE module that is so much better. 

 

https://www.yotpo.com/

Link to comment
Share on other sites

  • 4 weeks later...
  • 6 months later...

Hello,
I installed Product Comments v3.3.6 - by PrestaShop, Somehow I can't post commenbt on front end.
When we click to be the first to comment, nothing happen. I tried many things, I read on the forum but no success. Anyone can help?

Module is activated and I allow guest and employee to review. 

I use multistore mode. Let me know. Thanks! =)

Link to comment
Share on other sites

Hello,

I installed Product Comments v3.3.6 - by PrestaShop, Somehow I can't post commenbt on front end.

When we click to be the first to comment, nothing happen. I tried many things, I read on the forum but no success. Anyone can help?

 

Module is activated and I allow guest and employee to review. 

I use multistore mode. Let me know. Thanks! =)

 

Do you have a link to your store? I can test it out.

 

by the way, can you keep the color black of your text. It's kind of an informal rule for readability sake. Thanks!

Link to comment
Share on other sites

Hello,

I installed Product Comments v3.3.6 - by PrestaShop, Somehow I can't post commenbt on front end.

When we click to be the first to comment, nothing happen. I tried many things, I read on the forum but no success. Anyone can help?

 

Module is activated and I allow guest and employee to review. 

I use multistore mode. Let me know. Thanks! =)

 

I tried following this : http://hassadee.com/2013/02/26/how-to-add-product-comment-on-prestashop-1-5-3/

but step #3, form doesn't open, I think there is a bug... Hopefully someone can help me.

 

Regards!

Do you have a link to your store? I can test it out.

Sure, one of sub-store is this one : http://achats.boutiquereseau.com/scorpionmasque/fr/

Link to comment
Share on other sites

I tried following this : http://hassadee.com/2013/02/26/how-to-add-product-comment-on-prestashop-1-5-3/

but step #3, form doesn't open, I think there is a bug... Hopefully someone can help me.

 

Regards!

Sure, one of sub-store is this one : http://achats.boutiquereseau.com/scorpionmasque/fr/

Are you using PrestaShop 1.5 or 1.6? I'm thinking it could be an issue with the template you are using.

Link to comment
Share on other sites

Hi everybody,

 

I have the same problem with prestashop 1.6.0.6 product components 2.3 and London soopatheme. I have reinstalled twice product components module and the result is the same, when you go to my front office and try to add a review, nothing happens.

 

My front-office is http://monacorbally.com, I can´t open a ticket to soopatheme because since augsut no news about this team?

 

Thanks for your support!

Regards

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

 

For PS 1.5.6.x  solution is:

 

Go to  modules/productcomments/js/productcomment.js 

on line 66

replace this: data: $('#id_new_comment_form').serialize(),

to this:
data: $('#new_comment_form form').serialize(),

 

Solved!

 

Thanks man! Really helped!

Link to comment
Share on other sites

  • 1 month later...

The problem with "product comment" module is that when you click on "send" that window doesn't close, no matters how much you click it, but in back-end, if you go at "product comment" module, click "configure" you will see that the data from front office has been sent there and the comments will appear on site ...

Does anybody have a solution for this? when a user clicks on "send" the review window to get close automatically?

 

I use prestashop 1.6.0.9

Edited by andrei.nicolae19 (see edit history)
Link to comment
Share on other sites

  • 3 months later...

Problem:

 

-I click "write review"

-Product "write reviw" page opens

-Product image on this page is correct, but product description is same on every product (when I'm on write review page)

 

Does anybody got solution to this problem?

 

Presta 1.6.0.9

Product Comments 3.4.0 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

I've solved the problem in PrestaShop v1.5.x

 

First : Follow solution in Github : https://github.com/PrestaShop/PrestaShop/commit/9377775eca428c7022abd4bfa301ef83c8b108b8

( I use productcomment v3.3.4 and the fix is already done ).

 

Second: Correct the tpl file inside your theme folder modules/productcomments/productcomments.tpl

( as indicate in Github )

 

Third ( i've lost many time to solve this stupid problem ) : check if inside your theme folder there is a sub-folder named js where there are the javascript of your themes, you can find inside another productcomment/productcomments.js file that override the default js file. So you need to modify this file as suggested in github and the problem could be solved.

 

Regards,

Amar

Link to comment
Share on other sites

  • 8 months later...

Any new about this issue on 1.6.x.x?? Ive read all your comments guys and all I can say for sure is any of them solves the problem on 1.6.x.x

 

One strange think Ive checked is on pc you just can write "Tittle" and "Comment", but on mobile phone you can write "Tittle", "Comment" and also "Your name". That stuff make me think probably there are more such a Required fields we should be placing on pc? Actually dont know what is the solution, but as some people said before, you make click on "Send" and anything happens.

 

PS: my prestashop version is 1.6.1.

Link to comment
Share on other sites

×
×
  • Create New...