ajensen27 Posted August 12, 2013 Share Posted August 12, 2013 I want to add the product rating stars to my category pages and also my featured products on the homepage. Is there an easy line of code to do this? Thanks! Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted August 12, 2013 Share Posted August 12, 2013 (edited) bump Edited September 11, 2013 by Jiten rash (see edit history) 1 Link to comment Share on other sites More sharing options...
vekia Posted August 12, 2013 Share Posted August 12, 2013 ajensen, can you please confirm, that you solved this issue with nemo's tutorial? Link to comment Share on other sites More sharing options...
ajensen27 Posted August 12, 2013 Author Share Posted August 12, 2013 Thanks Jiten rash! This looks like it will solve my issue. Only question I have now is if I want to do this for my featured products on my homepage do I just follow the same steps but for the featured products module? -Alex Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2013 Share Posted August 13, 2013 just do the same, but in homefeatured.tpl file, just add the hook execution Link to comment Share on other sites More sharing options...
ajensen27 Posted August 13, 2013 Author Share Posted August 13, 2013 Thanks Vekia! You can mark this as "Solved". Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2013 Share Posted August 13, 2013 done, thanks for confirmation anyway, you tested it? does it work as you expected? Link to comment Share on other sites More sharing options...
rgwhitaker Posted August 30, 2013 Share Posted August 30, 2013 (edited) I've tried so many times to get this tutorial to work and can't! I can't get past Step #3. I can't get the "hey there" to work. Any ideas? I'm using PS 1.5.4.1 and a purchased theme. Edited August 30, 2013 by rgwhitaker (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 31, 2013 Share Posted August 31, 2013 looks like module new hook function doesn't work well. you reinstalled module after changing .php file? Link to comment Share on other sites More sharing options...
rgwhitaker Posted August 31, 2013 Share Posted August 31, 2013 Vekia: Yes. I just uninstalled and then re-installed the Product Comments module. I also deleted the class_index.php file within the cache directory, as per Nemo. I still can't get it to work! I'm wondering, have you, or anyone else, had experience with the Google Rich Snippets + Product Ratings and Reviews module? I'm wondering if that would work better, plus there's some nice features as well. I also went into myPHP database and noticed that the ProductInList hook doesn't even appear. What would make a hook not appear in the database? Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted September 11, 2013 Share Posted September 11, 2013 (edited) Nemo's tutorial lacks concept and are overdosed with explanation which nobody has anything to do.. I dont care gimme another warning. I speak facts Edited September 11, 2013 by Jiten rash (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted September 11, 2013 Share Posted September 11, 2013 it really gets down to comfort level and how much time you have. if you are running a serious business and need to get stuff done...and move on...then it's best to get a pro module to accomplish the task. If you want to become a developer...you can use examples given around the web and learn from them. I personally don't do these sorts of 'how to's' because there are a multitude of different ps versions and user experience...i.e. telling a user to load this override and then delete such and such....is well...for some that follow the guide...a disaster and a time eater. Link to comment Share on other sites More sharing options...
PascalVG Posted September 11, 2013 Share Posted September 11, 2013 I see that the link to Nemo's tutorial has been deleted. For those who are still interested: http://nemops.com/prestashop-product-rating-product-list/ pascal. Jiten: It's overdosed with explanation, as it is a TUTORIAL... Look forward to your new, better 'concept' of this... 1 Link to comment Share on other sites More sharing options...
rgwhitaker Posted September 11, 2013 Share Posted September 11, 2013 (edited) Yes, if anyone has any additional ways to do this, I'm all ears! I've tried to go through Nemo's tutorial several times and cannot get beyond Step #3. I can't get the "hey there" to appear. I REALLY want to have stars in the category listings. Edited September 11, 2013 by rgwhitaker (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted September 11, 2013 Share Posted September 11, 2013 click here is some other suggestions 1 Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 11, 2013 Share Posted September 11, 2013 Nemo's tutorial lacks concept and are overdosed with explanation which nobody has anything to do.. I dont care gimme another warning. I speak facts Hi Jiten Rash, If you want, you can always make your own tutorial and share it with the Community. I'm sure everybody would appreciate the time and effort you take to help out other merchants, much like Nemo1 does. Link to comment Share on other sites More sharing options...
jgullstr Posted September 11, 2013 Share Posted September 11, 2013 Tried to make a module of this while experimenting with smarty. Try it out and see if it works.Instruction after install:Add {rating id=$product.id_product} to your product-list.tpl. categorylistratings.zip Link to comment Share on other sites More sharing options...
rgwhitaker Posted September 12, 2013 Share Posted September 12, 2013 (edited) So jgullstr, if that portion of my product-list.tpl file appears like this currently: <h3><a class="product_link" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'|truncate:35:'...'}</a></h3> {hook h='productInList' idproduct=$product.id_product} Where would I put the {rating id=$product.id_product} line? Oh...do I also need to download and install your categorylistratings module? Edited September 12, 2013 by rgwhitaker (see edit history) Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted September 12, 2013 Share Posted September 12, 2013 whenever i have time i always come forward to write tutorials u can see my topics I even have personal conversation with many merchants to short out issues..iam busy with my job im coming in a short while to share some more. thats out of this topic @ rgwhitaker what problem u have in nemos tutorial in step 3 1 Link to comment Share on other sites More sharing options...
jgullstr Posted September 12, 2013 Share Posted September 12, 2013 rgwhitaker: remove any alterations you've done before, then install the module, then put {rating id=$product.id_product} where you previously had {hook h='productInList' idproduct=$product.id_product} Link to comment Share on other sites More sharing options...
rgwhitaker Posted September 12, 2013 Share Posted September 12, 2013 JGULLSTR: That didn't work either. So, I am now officially done trying to get stars in my category listings. For some reason, it just won't work with my theme. Link to comment Share on other sites More sharing options...
jgullstr Posted September 13, 2013 Share Posted September 13, 2013 Have you checked if the rating markup is added to the rendered source? It might be that your theme css is only hiding the output. Link to comment Share on other sites More sharing options...
PascalVG Posted September 13, 2013 Share Posted September 13, 2013 Hi rgwhitaker, - As a last try, can you provide a link to the site and make sure you tried to either add nemo's solution or that you added the lines of code following jgullstr's module solution? Then we can see if there's anything wrong with the code, or that it sneakily uses a different tpl file or so. (If you don't want to share your URL (yet), please PM it to me) Also check: Did you (TEMPORARILY!!): - turn OFF your smarty cache and - 'Template cache' set to "Recompile templates if the files have been updated" in Advanced Parameters->Performance to see the changes take effect? Otherwise it won't work. (Don't forget to turn cache back ON afterwards!) pascal Link to comment Share on other sites More sharing options...
El Patron Posted September 13, 2013 Share Posted September 13, 2013 Tried to make a module of this while experimenting with smarty. Try it out and see if it works. Instruction after install: Add {rating id=$product.id_product} to your product-list.tpl. Please post this under free modules. We can then move the conversation to 'on topic'. Post the link to the 'free module' post here. Thanks for your contribution. Link to comment Share on other sites More sharing options...
jgullstr Posted September 13, 2013 Share Posted September 13, 2013 Please post this under free modules. We can then move the conversation to 'on topic'. Post the link to the 'free module' post here. Thanks for your contribution. Thanks, posted. Can't see why this would be 'off-topic' though Link to comment Share on other sites More sharing options...
rgwhitaker Posted September 13, 2013 Share Posted September 13, 2013 Pascal: Did that. Still doesn't work. Link to comment Share on other sites More sharing options...
El Patron Posted September 13, 2013 Share Posted September 13, 2013 Thanks, posted. Can't see why this would be 'off-topic' though Thanks, you are not off topic..but it seems worthy of it's own post. Link to comment Share on other sites More sharing options...
StefArts Posted January 11, 2017 Share Posted January 11, 2017 Hello,It has been impossible for me to make the module working on my prestashop version (1.6.1.6)I follow these two combined tutorials: http://nemops.com/prestashop-product-rating-product-list/#.WHYJKZLWFE4 http://sobreprestashop.blogspot.com.es/2015/03/mostrar-calificacion-productos-en-lista-productos-prestashop.html It has worked well on my prestashop version.I only had to make a small change on productcomments.php to have the right counting of the number of reviews (Original code Spanish Tutorial): I change: $this->context->smarty->assign('nbComments', (int)ProductComment::getCommentNumber($id_product)); To: $this->smarty->assign(array( 'nbComments' => (int) ProductComment::getCommentNumber($id_product), ));My complete function in productcomments.php is: // Product Stars On Product List public function hookProductInList($params) { require_once(dirname(__FILE__).'/ProductComment.php'); require_once(dirname(__FILE__).'/ProductCommentCriterion.php'); $id_product = $params['idproduct']; $product_average = 0; $grades = ProductComment::getAveragesByProduct($id_product, $this->context->language->id); $criterions = ProductCommentCriterion::getByProduct($id_product, $this->context->language->id); $grade_total = 0; if (count($grades) > 0) { foreach ($criterions as $criterion) { if (isset($grades[$criterion['id_product_comment_criterion']])) { $grade_total += (float)($grades[$criterion['id_product_comment_criterion']]); } } $product_average = $grade_total / count($criterions); $this->context->smarty->assign('average_total', (int)$product_average); // Obtener el número de comentarios $this->smarty->assign(array( 'nbComments' => (int) ProductComment::getCommentNumber($id_product), )); return $this->display(__FILE__, '/product-list-rating.tpl'); } }// End Of Product Stars On Product List Also for all people who have the cart button disappearing when you click on «read reviews» on product page, the solution is there:https://github.com/PrestaShop/PrestaShop/pull/5280/filesBasically you have to modify: themes/YOUR THEME/js/product.jsFind the line: $(window).bind('hashchange', function(){Change:checkUrl();findCombination();To:var is_combination = checkUrl();if (is_combination)findCombination();It has worked like a charm for me on my prestashop version (1.6.1.6)Hope it can help.Regards Link to comment Share on other sites More sharing options...
patrmich Posted July 18, 2017 Share Posted July 18, 2017 (edited) Hi, When I activate the Block Layered Prestashop module, I am getting the following error : PHP Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/product-list.tpl" on line 105 "{rating id=$product.id_product}" unknown tag "rating" The line 105 is : {rating id=$product.id_product} If I delete the line 105, the stars are not displayed on the product list page. Would you know where is the Syntax Error is the line 105 ? Thank you in advance for any help. Patrick Edited July 18, 2017 by patrmich (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now