Jump to content

Product Compare Link at Home Page Product


Recommended Posts

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.

 

post-781425-0-85562500-1396693055_thumb.png

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

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 by frank_jarle (see edit history)
Link to comment
Share on other sites

  • 1 month later...

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

  • 3 months later...

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

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

  • 4 months later...

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

×
×
  • Create New...