Jump to content

productcomments ServiceNotFoundException


pabloliracecilio

Recommended Posts

Prestshop 1.7.7.1 

php 7.2

At production environment I call the url https://torretecidos.com.br/module/productcomments/ListComments?id_product=55501261&page=1

and get this

image.png.e88ebcc43c7d3500c40b3f2db4e878fb.png

 

at Development enviroment I get correct answer 

https://torrevermelha.com.br/clean/module/productcomments/ListComments?id_product=55501261&page=1:1

{"comments_nb":2,"comments_per_page":"5","comments":[{"id_product":"55501261","id_product_comment":"651","title":"Indico!","content":"Tecido bonito, brilhoso e o blackout funciona. Coloquei em um quarto e ficou melhor do que eu imaginava.","customer_name":"Rosy","date_add":"05\/12\/17 16:13","grade":"5","firstname":null,"lastname":null,"usefulness":0,"total_usefulness":0},{"id_product":"55501261","id_product_comment":"502","title":"Tecido blackout ","content":"Tecido de qualidade e entrega rápida! \r\nSatisfeito com o produto e com a loja!","customer_name":"Marcelo Vogel ","date_add":"25\/04\/17 15:33","grade":"5","firstname":null,"lastname":null,"usefulness":0,"total_usefulness":0}]}

The database of both are equal:

image.thumb.png.c949fe7a893dcf8d35342408abcca82c.png

at product page, the comment count appears, but they are not listed:

image.png.74ec251c3b7a50a4adae844e2876388b.png

Tks in advance

 

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

  • 1 month later...

Just leaving the fix I had to do so others can save some time:
at file modules/productcomments/controllers/front/ListComments;php
around line 60 there is:
dateFormatter = new \IntlDateFormatter(
I swiched that to the date_format aproach, and it worked,

like that
/**$dateFormatter = new \IntlDateFormatter(
$this->context->language->locale,
\IntlDateFormatter::SHORT,
\IntlDateFormatter::SHORT
);
**/
$productComment['customer_name'] = htmlentities($productComment['customer_name']);
$productComment['title'] = htmlentities($productComment['title']);
$productComment['content'] = htmlentities($productComment['content']);
$productComment['date_add'] = date_format($dateAdd,"d/m/Y H:i:s");//$dateFormatter->format($dateAdd);

cheers!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...