im_presto Posted April 5, 2014 Share Posted April 5, 2014 Hi There, I am facing an issue while showing product compare link for product list at home page. I have tried to fix the issue related with this but didn't find any reasonable solution. I am getting JS error "ReferenceError: comparedProductsIds is not defined" while showing "Add compare" link for product.. please see image attached If anyone can help ... i will be very grateful for this. Link to comment Share on other sites More sharing options...
vekia Posted April 5, 2014 Share Posted April 5, 2014 im trying to reproduce issue but... ican't turn this button on from featured on homepage products :/ how you activated it? Link to comment Share on other sites More sharing options...
im_presto Posted April 7, 2014 Author Share Posted April 7, 2014 Hi vekia, I have created my own module for featured products and copied product-list.tpl in own module tpl file, in that i have removed page filter of showing compare button. Dilip Link to comment Share on other sites More sharing options...
vekia Posted April 7, 2014 Share Posted April 7, 2014 i have no idea what and how you did that, it will be hard to help without possiblity to debug it. Link to comment Share on other sites More sharing options...
im_presto Posted April 10, 2014 Author Share Posted April 10, 2014 Do one thing... Go into your theme folder and edit product-list.tpl There you would see a line having if condition ie. {if $page_name != 'index'} make it {if TRUE || $page_name != 'index'} Then you can activate compare link for your home page. 1 Link to comment Share on other sites More sharing options...
frank_jarle Posted August 28, 2014 Share Posted August 28, 2014 (edited) I have been looking for this kind of feature for looooooong time, thanks for the tips. However i did a test run: The compare button appear in the front page and i can add product for comparison, just as i wished for. However after going to the Compare page, remove all items and then go back to the main page again it is now not possible to add products to be compared from the front page. If i go to the product category where compare is at default i can add from there. Admin workaround: Preferences->Products: Click on the save button for the General settings (first/top save button on the page). Then it works again. But, this is kinda....strange, it just works perfectly in the Product category page, not in the front page. Any advice on this? Edited August 28, 2014 by frank_jarle (see edit history) Link to comment Share on other sites More sharing options...
Mikie Posted October 6, 2014 Share Posted October 6, 2014 Hi, same problem for me. I have disabled the cache and now it works. Link to comment Share on other sites More sharing options...
frank_jarle Posted October 6, 2014 Share Posted October 6, 2014 Hi, same problem for me. I have disabled the cache and now it works. Yes you are right, i did the exactly same thing (forgot to come back here to write about it). i disabled SMARTY all together (even its not advisable), i think it must be some bug with SMARTY around this. Link to comment Share on other sites More sharing options...
kashifkhan112 Posted February 5, 2015 Share Posted February 5, 2015 I have added this code in homefeatured.tpl and it works, using Prestashop 1.6.0.9 <div class="content_sortPagiBar clearfix"> <div class="sortPagiBar clearfix"> {include file="{$tpl_dir}product-compare.tpl"} </div> </div> Link to comment Share on other sites More sharing options...
frank_jarle Posted February 5, 2015 Share Posted February 5, 2015 I have added this code in homefeatured.tpl and it works, using Prestashop 1.6.0.9 <div class="content_sortPagiBar clearfix"> <div class="sortPagiBar clearfix"> {include file="{$tpl_dir}product-compare.tpl"} </div> </div> Where in the file should this code be placed? Is this code in addition to the original solution? " Go into your theme folder and edit product-list.tpl There you would see a line having if condition ie. {if $page_name != 'index'} make it {if TRUE || $page_name != 'index'}" Will your code work together with SMARTY cache? Link to comment Share on other sites More sharing options...
shadowwalker675 Posted June 7, 2015 Share Posted June 7, 2015 I have added this code in homefeatured.tpl and it works, using Prestashop 1.6.0.9 <div class="content_sortPagiBar clearfix" style="display:none;"> <div class="sortPagiBar clearfix"> {include file="{$tpl_dir}product-compare.tpl"} </div> </div> just copy code in some of your template which will always can run for example header or footer which can be load on all templates.. i just changed this code so no one can see that ugly button style="display:none;" that i added <div class="content_sortPagiBar clearfix" style="display:none;"> <div class="sortPagiBar clearfix"> {include file="{$tpl_dir}product-compare.tpl"} </div> </div> Link to comment Share on other sites More sharing options...
Recommended Posts