[MOD] Facebook Like Button on Product Page
85 posts
• Page 1 of 5 • 1, 2, 3, 4, 5
[MOD] Facebook Like Button on Product Page

Requirements:
- SEO URLs Must be Enabled
Demo:
Demo Link: http://www.stylemyapple.co.uk
Instructions:
Edit the file: catalog/view/theme/default/template/product/product.tpl
Find this piece of code:
- Code: Select all
</table>
<br />
<?php if ($display_price) { ?>
Replace the <br /> with the following:
- Code: Select all
<div style="width: 100%; padding-top:10px;">
<table>
<tr>
<td><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id='.$this->request->get['product_id']); ?>&layout=standard&show_faces=false&width=280&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:270px; height:35px;" allowTransparency="true"></iframe>
</td>
</tr>
</table>
</div>
I have tested this on OpenCart 1.4.8b in IE6, IE7, IE8, FF 3.6.6
Let me know if you find any problems

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com
Discount Code: DISCOUNT10
Discount Code: DISCOUNT10
- Chrissy Poo
- Posts: 166
- Joined: Mon Jun 29, 2009 12:48 am
- Location: UK
Re: [MOD] Facebook Like Button on Product Page
Can confirm that this is an awesome script, just installed it and tested it on our store! 
Thumbs up!

Thumbs up!
- Signserve
- Posts: 14
- Joined: Mon Jul 19, 2010 12:27 pm
Re: [MOD] Facebook Like Button on Product Page
Signserve wrote:Can confirm that this is an awesome script, just installed it and tested it on our store!
Thumbs up!
Glad you like

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com
Discount Code: DISCOUNT10
Discount Code: DISCOUNT10
- Chrissy Poo
- Posts: 166
- Joined: Mon Jun 29, 2009 12:48 am
- Location: UK
Re: [MOD] Facebook Like Button on Product Page
VERY cool, but when I click on like it, then go to my facebook page it says... likes Product not found!
not sure what to do. Thanks for your help in advance
not sure what to do. Thanks for your help in advance
- musicofthehart
- Posts: 31
- Joined: Fri Jul 16, 2010 7:42 am
Re: [MOD] Facebook Like Button on Product Page
musicofthehart wrote:VERY cool, but when I click on like it, then go to my facebook page it says... likes Product not found!
not sure what to do. Thanks for your help in advance
Do you have SEO URLs enabled?
Is your site live and viewable to the public?
10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com
Discount Code: DISCOUNT10
Discount Code: DISCOUNT10
- Chrissy Poo
- Posts: 166
- Joined: Mon Jun 29, 2009 12:48 am
- Location: UK
Re: [MOD] Facebook Like Button on Product Page
I did NOT have SEO URLS enabled, I am sure that was my problem, but now I have opened up a whole new can of worms since I turned that on.... all of my pages are not found. I am sure it has to do with the fact that I am using godady hosting. Ill try to figure out this problem and get back to you. Great mod btw... and I am sure it works once I get my new problem fixed.
- musicofthehart
- Posts: 31
- Joined: Fri Jul 16, 2010 7:42 am
Re: [MOD] Facebook Like Button on Product Page
All better now, the SEO URLS are enabled, and your script works great. Thank you very much for this!
- musicofthehart
- Posts: 31
- Joined: Fri Jul 16, 2010 7:42 am
Re: [MOD] Facebook Like Button on Product Page
musicofthehart wrote:All better now, the SEO URLS are enabled, and your script works great. Thank you very much for this!
No problems, glad to help

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com
Discount Code: DISCOUNT10
Discount Code: DISCOUNT10
- Chrissy Poo
- Posts: 166
- Joined: Mon Jun 29, 2009 12:48 am
- Location: UK
Re: [MOD] Facebook Like Button on Product Page
Hello,
I added to my code, but it shows error while i clicked the like button.
The page showed.
http://www.facebook.com/connect/connect ... _error.php
cannot access and cannot find item.
What's the matter?
My server problem or my code error?
Thanks,
Felix
I added to my code, but it shows error while i clicked the like button.
The page showed.
http://www.facebook.com/connect/connect ... _error.php
cannot access and cannot find item.
What's the matter?
My server problem or my code error?
Thanks,
Felix
- felizone
- Posts: 59
- Joined: Thu Apr 08, 2010 7:28 am
Re: [MOD] Facebook Like Button on Product Page
felizone wrote:Hello,
I added to my code, but it shows error while i clicked the like button.
The page showed.
http://www.facebook.com/connect/connect ... _error.php
cannot access and cannot find item.
What's the matter?
My server problem or my code error?
Thanks,
Felix
Whats the url for your store?
10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com
Discount Code: DISCOUNT10
Discount Code: DISCOUNT10
- Chrissy Poo
- Posts: 166
- Joined: Mon Jun 29, 2009 12:48 am
- Location: UK
Re: [MOD] Facebook Like Button on Product Page
Great script.
Having troubles with the "likes Product Not Found" as mentioned earlier. We have SEO URLs enabled. URL is below.
Any help would be greatly appreciated.
Thanks,
Chad
(STILL IN DEVELOPMENT) http://www.onecraftymother.net
Having troubles with the "likes Product Not Found" as mentioned earlier. We have SEO URLs enabled. URL is below.
Any help would be greatly appreciated.
Thanks,
Chad
(STILL IN DEVELOPMENT) http://www.onecraftymother.net
- DirtyJeeves
- Posts: 2
- Joined: Tue Sep 07, 2010 3:17 pm
Re: [MOD] Facebook Like Button on Product Page
I guess it would help to add SEO Keywords.
I got it figured out. Again, great script!
I got it figured out. Again, great script!
- DirtyJeeves
- Posts: 2
- Joined: Tue Sep 07, 2010 3:17 pm
Re: [MOD] Facebook Like Button on Product Page
DirtyJeeves wrote:I guess it would help to add SEO Keywords.![]()
I got it figured out. Again, great script!
Glad you got it sorted! Enjoy

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com
Discount Code: DISCOUNT10
Discount Code: DISCOUNT10
- Chrissy Poo
- Posts: 166
- Joined: Mon Jun 29, 2009 12:48 am
- Location: UK
Re: [MOD] Facebook Like Button on Product Page
Hi guyz,
Tanx for the code.. It works great for me.. But i have a small problem.
When i log in, and if i like a particular product, counter gets incremented by 1.
After that when i move to a new product, counter status is still 1.. It juz shows the same value as
it shows for previous product...
I guess its becuz it doesn't recognize my product id....
Here's my code..
<div style="width: 100%; padding-top:10px;">
<table>
<tr>
<td><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id='.$this->request->get['product_id']); ?>&layout=box_count&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:65px;" allowTransparency="true"></iframe>
</td>
</tr>
</table>
</div>
Now what i want is , counter should be distinct for each product.
Can anyone plz tell me how to fix this??? Any ideas or code????
Tanx in advance
Tanx for the code.. It works great for me.. But i have a small problem.
When i log in, and if i like a particular product, counter gets incremented by 1.
After that when i move to a new product, counter status is still 1.. It juz shows the same value as
it shows for previous product...
I guess its becuz it doesn't recognize my product id....
Here's my code..
<div style="width: 100%; padding-top:10px;">
<table>
<tr>
<td><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id='.$this->request->get['product_id']); ?>&layout=box_count&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:65px;" allowTransparency="true"></iframe>
</td>
</tr>
</table>
</div>
Now what i want is , counter should be distinct for each product.
Can anyone plz tell me how to fix this??? Any ideas or code????
Tanx in advance
- ifone_developer
- Posts: 28
- Joined: Sat Jul 10, 2010 10:48 am
Re: [MOD] Facebook Like Button on Product Page
I need help with this.
I added the code but in facebook is displayed "Product not finded". I actiivated SEO Url and added keyword to the products.
I apreciate any help.
My store is this: http://gedyan.com/new/index.php?route=common/home
I added the code but in facebook is displayed "Product not finded". I actiivated SEO Url and added keyword to the products.
I apreciate any help.
My store is this: http://gedyan.com/new/index.php?route=common/home
- henryq30
- Posts: 2
- Joined: Sun Oct 03, 2010 3:20 am
Re: [MOD] Facebook Like Button on Product Page
Ready, it is working.
I added the file .htaccess
with this text inside:
Also I added SEO keywords to the products and categories
I added the file .htaccess
with this text inside:
- Code: Select all
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
# 2. In your opencart directory rename htaccess.txt to .htaccess.
# For any support issues please visit: http://www.opencart.com
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymlinks
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
Also I added SEO keywords to the products and categories
- henryq30
- Posts: 2
- Joined: Sun Oct 03, 2010 3:20 am
Re: [MOD] Facebook Like Button on Product Page
Does this MOD work on 1.3.2 version? Thanks!
- FabioSwiss
- Posts: 18
- Joined: Thu Sep 16, 2010 8:06 pm
Re: [MOD] Facebook Like Button on Product Page
When I turn on the SEO URLs everything goes out the window. The product pages run to "Page Not Found". I have multiple SEO keywords in for each item. They are separated by commas. Any ideas of what I am doing wrong?
- CEOself
- Posts: 15
- Joined: Tue Dec 29, 2009 7:05 am
Re: [MOD] Facebook Like Button on Product Page
The Facebook Like iframe works for me (running OpenCart 1.4.9.2) but the wrong product image is displayed in my Facebook feed. Any ideas how to fix?
Edit: I think what's needed is an Open Graph meta tag with the correct image path, so I've tried entering this into header.tpl, but I don't get it to display the thumb:
Edit: I think what's needed is an Open Graph meta tag with the correct image path, so I've tried entering this into header.tpl, but I don't get it to display the thumb:
- Code: Select all
<?php if ($thumb) { ?>
<meta property="og:image" content="<?php echo $thumb; ?>" />
<?php } ?>
-

sketchi - Posts: 32
- Joined: Wed Sep 22, 2010 9:04 am
Re: [MOD] Facebook Like Button on Product Page
Thank you so much. I worked grate to me.
How can I change the colors of the text in de IFRAME?
Thanks!
How can I change the colors of the text in de IFRAME?
Thanks!
Mamma mia! Donde me meti...?
- leomazz
- Posts: 41
- Joined: Mon Jan 04, 2010 2:45 am
- Location: Banfield - Buenos Aires
85 posts
• Page 1 of 5 • 1, 2, 3, 4, 5
Who is online
Users browsing this forum: No registered users and 7 guests













