Page 1 of 3

Facebook Product share

Posted: Tue Feb 23, 2010 4:27 am
by Cyberdude
Hi guys.

I'm almost there, but, i just don't manage to get the product id shown in facebook share.

I use this code in /catalog/view/theme/default/template/product/product.tpl :

Code: Select all

<a href="http://www.facebook.com/sharer.php?u=http://YOURDOMAIN/index.php?route=product/product&product_id=&title=$products[$j]['name']">Share it</a>
Now, it is ready to share, but, i need to define the product id and picture.

Does someone have an idea?

Re: Facebook Product share

Posted: Tue Feb 23, 2010 5:14 am
by Cyberdude
Ok

it works. :D

i use:

Code: Select all

<a href="http://www.facebook.com/sharer.php?u=http://yourdomain/index.php?route=product/product&product_id=<?php echo $product_id; ?>&t=<?php echo $heading_title; ?>"><img src="http://yourdomain/catalog/view/theme/default/image/facebook.gif"></a>
Only issue now is the picture. Facebook asks to choose picture.

anyone knows how to change that, so it takes image of product?

you can try on my site: Click here

There, choose a product, you will see a facebook icon(i just putted there to test)

Re: Facebook Product share

Posted: Tue Feb 23, 2010 6:47 pm
by Cyberdude
Ok folks,

This is what i found.

Problem is, how to define the product image?
If you want to have a custom image showing besides the link shared on Facebook, you can do it by adding a simple piece of code in your page’s header section. Facebook link sharing is one of the best way to spread your links on most powerful social community platform. You should be careful while sharing links on Facebook as that link may become a branding initiative from your side. In that case, that link should appear perfectly on other’s home page as well.

Whenever we share a link on Facebook, it actually try to retrieve some images from that particular page and show you the option to choose an image as thumbnail or select “No thumbnail”. What if the options shown by the Facebook link sharing tool is not having the proper image thumbnail? In that case you can apply the changes below to have the custom image thumbnail besides the link on Facebook.

You may also like: How To Add Blog Feed On Facebook To Share Latest Post Over There

According to the Facebook Share Documentation, Facebook takes the image provided with tag rel=”image_src” in the header section that will definitely considered in the thumbnail options on link sharing. For example, if you want to have your blog’s logo in link shared as your homepage’s URL then add the below mentioned piece of code to have logo as thumbnail in Facebook,

I added below piece of code in HEAD section of my blog i.e. header.php below wp_head,

<link rel="image_src" href="http://media.clickonf5.org/image/logo.png" />
But, how can you replace it so that it uses the thumb image of each product?

Re: Facebook Product share

Posted: Tue Feb 23, 2010 11:08 pm
by Cyberdude
Afther hours of looking on the net and facebook, i found this:
ShopSite custom template example

If you are using ShopSite and want to make sure this functionality exists in your “More Information” product template, you could use the following tags/code:


<meta name="title" content="[-- PRODUCT.MoreInformationTitle --]" />
<meta name="description" content="[-- PRODUCT.MoreInformationMetaDescription --]" />
<link rel="image_src" href="http://www.ABC.com/media/[-- IMAGE Product.MoreInformationGraphic --]" />
can anyone tell me if we can use it?

Re: Facebook Product share

Posted: Tue Feb 23, 2010 11:13 pm
by Cyberdude
I find the same thing every time, but this is when you specify a image !

I need it to take the image of the Product page.

Come on guys, this is almost working, just the product picture needs to display on facebook.

I already did the hardest part i think :D

Re: Facebook Product share

Posted: Fri Feb 26, 2010 1:36 am
by fmucar

Code: Select all

<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
catalog/view/theme/default/template/product/product.tpl
paste this code to product.tpl anywhere you want it to appear and then it is good to go.
Thats all.

Re: Facebook Product share

Posted: Fri Feb 26, 2010 2:03 am
by Cyberdude
thanks,

but this does not fix the image problem

Re: Facebook Product share

Posted: Sat Feb 27, 2010 1:04 am
by fmucar
This is working quite well for me. I have no idea why it is not working for you.

Re: Facebook Product share

Posted: Sat Feb 27, 2010 1:53 am
by OSWorX
The posted code is quite okay (while not optimal), cyberdude has a problem with another (addionally 3PD) installed module which send wrong imgaes to facebook.

Re: Facebook Product share

Posted: Mon Mar 01, 2010 12:10 pm
by MulderDSM
When I use this code:
<td><a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share on FaceBook</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></td>

FaceBook link works, but it doesn't have the Product Name in the FaceBook posting, but when you click on the link it goes to the correct page.

Is there anyway to include the Product Name and maybe some default text like "You should check out PRODUCT NAME at WEBSITE"?

Re: Facebook Product share

Posted: Mon Mar 01, 2010 2:23 pm
by OSWorX
MulderDSM wrote:Is there anyway to include the Product Name and maybe some default text like "You should check out PRODUCT NAME at WEBSITE"?
Yes.

Re: Facebook Product share

Posted: Mon Mar 01, 2010 2:39 pm
by Cyberdude
Maybe tell him how :D

Re: Facebook Product share

Posted: Mon Mar 01, 2010 5:59 pm
by OSWorX
For all who wants to add the Facebook button to your (product) page.
At http://osworx.net (Downloads) you will find the complete modification (either copy the already modified files or edit the files manual - readme is enclosed).

Re: Facebook Product share

Posted: Tue Mar 02, 2010 8:53 am
by MulderDSM
Thanks, I download your mods and installed them, Facebook button still works to send to Facebook, but the Product Description still defaults back to the sight's name and not the product name.

Re: Facebook Product share

Posted: Tue Mar 02, 2010 2:11 pm
by OSWorX
Having any link to your site?
If the headers (title and description) are there, FB will use them.

Re: Facebook Product share

Posted: Tue Mar 16, 2010 1:14 pm
by priceyboy
Thank you all for helping.

I have added the 'Facebook Share' which works great, but I have a problem, in fire fox, the 'facebook popup' is in spanish ~ but when I use Internet Explore the 'Facebook popup' is in english.
I have been up all night trying to work that one out..

if any one can work it out, I will be eternally in your debt
Thanks

Priceyboy

Re: Facebook Product share

Posted: Tue Mar 16, 2010 2:06 pm
by migz
thank you! O0

Re: Facebook Product share

Posted: Tue Mar 16, 2010 4:12 pm
by Cyberdude
priceyboy wrote:Thank you all for helping.

I have added the 'Facebook Share' which works great, but I have a problem, in fire fox, the 'facebook popup' is in spanish ~ but when I use Internet Explore the 'Facebook popup' is in english.
I have been up all night trying to work that one out..

if any one can work it out, I will be eternally in your debt
Thanks

Priceyboy
Did you try to clear your Cache ?

Re: Facebook Product share

Posted: Wed Mar 17, 2010 2:57 pm
by priceyboy
Clearing the cache.. why did'nt I think of somthing that obvious!

But you were correct... Fixed :)

Thanks

Priceyboy

Re: Facebook Product share

Posted: Mon Mar 22, 2010 1:58 pm
by migz
It's working! Are there any icons to choose from?