Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Facebook "like" and tpl_tabular_display

Facebook "like" and tpl_tabular_display

Locked

Views: 1,493

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
9 Jul 2010, 11:08 AM
#1
flinders avatar

flinders

New Zenner

Join Date:
Nov 2007
Posts:
58
Plugin Contributions:
0

Facebook "like" and tpl_tabular_display

Hi,
The effect I'm trying to achieve is seem in the following image.
http://imgur.com/Tq96K.jpg
You can see the original here - > http://tinyurl.com/38abyde

Basically I'm trying to add a face book like button to each product in category view and in searches...

I have figured out that I will need to edit tpl_tabular_display.php

But I'm having trouble figuring out how to work with that file. I can read and edit basic php but that one has stumped me a little.

Any pointers? Am I off track?

Cheers

Guys and Girls

9 Jul 2010, 11:13 AM
#2
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

Just add this code to the Category HTML in the editor

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=dark" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; display:none; overflow:hidden; width:450px; height:40px" onload="this.style.display = 'block';"></iframe>

Change the colourscheme to dark or light depending on your background colour.

9 Jul 2010, 11:15 AM
#3
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

Ah, sorry, didnt see that you wanted in each item.

Why not just have it on the individual product page, instead of on the listing?

9 Jul 2010, 11:19 AM
#5
flinders avatar

flinders

New Zenner

Join Date:
Nov 2007
Posts:
58
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

Thanks anyway :D

9 Jul 2010, 11:25 AM
#6
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

I just managed to do it on this page on my site...

But it appears to keep the same attribute for all of the items, so some more tweaking would be required.

File I modified was tpl_product_modules_all_listing.php

9 Jul 2010, 11:26 AM
#7
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

I also makes the page very slow to load because of all the iFrames, so I wouldnt advise it.

9 Jul 2010, 11:28 AM
#8
flinders avatar

flinders

New Zenner

Join Date:
Nov 2007
Posts:
58
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

Thanks mate you're a champ.

I agree using Iframes makes it slow. However I plan to do it using the other faster method of adding the Like button

9 Jul 2010, 11:29 AM
#9
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

Cheers, Ill take it off my page now.

9 Jul 2010, 11:31 AM
#10
flinders avatar

flinders

New Zenner

Join Date:
Nov 2007
Posts:
58
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

Hmm. This gives works on the "all product listing" but not on other listings. Im really keen to have it show up on searches... ie this page on your site.

http://www.chargecooler.co.uk/index.php?zenid=b3f492bafc3b803f40c37f0664f23a88&main_page=advanced_search_result&keyword=kit&search_in_description=1&categories_id=&inc_subcat=1&manufacturers_id=&pfrom=&pto=&dfrom=&dto=&x=27&y=3

Once I've found out where to put it I can tweak the code to be for each individual item

9 Jul 2010, 11:32 AM
#11
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

Try editing

tpl_advanced_search_result_default.php

9 Jul 2010, 11:40 AM
#12
flinders avatar

flinders

New Zenner

Join Date:
Nov 2007
Posts:
58
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

As far as I can tell that relies on tpl_modules_product_listing.php which in turn relies on tpl_tabular_display.php

Which i'm struggling to read

11 Jul 2010, 4:33 AM
#13
flinders avatar

flinders

New Zenner

Join Date:
Nov 2007
Posts:
58
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

Anyone else out there with more ideas. I'm stuck at the moment, despite a lot of effort. :(

16 Jul 2010, 3:42 PM
#14
flinders avatar

flinders

New Zenner

Join Date:
Nov 2007
Posts:
58
Plugin Contributions:
0

Re: Facebook "like" and tpl_tabular_display

OK. Giving up on this then. Getting this to work would be awesome. I'd be willing to contribute $$$ for someone to develop a working addon.