Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add to facebook link


Guest

Recommended Posts

Posted

There is a facility of facebook where you can have a link on your site to facebook, and when the user clicks it, it adds the url to the users facebook account....thus allowing 30million people to see it;

 

Anyway, the code facebook provide looks like this;

 

 

--------------

<script> function fbs_click() {u=location.href;t=document.title;window.open(‘http://www.facebook.com/sharer.php?u=’encodeURIComponent(u)‘&t=’+encodeURIComponent(t),‘sharer’,‘toolbar=0,status=0,width=626,hei

ght=436’);return false;}</script><style> html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?12:26981) no-repeat top left; }</style><a href=“http://www.facebook.com/share.php?u=<url>” onclick=“return fbs_click()” target=”_blank” class=“fb_share_link”>Share on Facebook</a>

---------------

 

Im thinking of placing it instead of my REVIEWS button (which isnt used), in product_info.php

 

Can anyone make a stab at how this code would need editing to work on product_info.php and return the correct URL?

  • 1 year later...
Posted
There is a facility of facebook where you can have a link on your site to facebook, and when the user clicks it, it adds the url to the users facebook account....thus allowing 30million people to see it;

 

Anyway, the code facebook provides looks like this;

 

 

--------------

<script> function fbs_click() {u=location.href;t=document.title;window.open(‘http://www.facebook.com/sharer.php?u=’encodeURIComponent(u)‘&t=’+encodeURIComponent(t),‘sharer’,‘toolbar=0,status=0,width=626,hei

ght=436’);return false;}</script><style> html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?12:26981) no-repeat top left; }</style><a href=“http://www.facebook.com/share.php?u=<url>” onclick=“return fbs_click()” target=”_blank” class=“fb_share_link”>Share on Facebook</a>

---------------

 

Im thinking of placing it instead of my REVIEWS button (which isnt used), in product_info.php

 

Can anyone make a stab at how this code would need editing to work on product_info.php and return the correct URL?

 

Find

<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?>

 

Then, Make a small Facebook Banner in Photoshop, or Paint, similar to addTBoltonFacebook.png

 

then go to your page, and copy your page's URL. It should look something like

 

http://www.facebook.com/profile.php?id=672481566

Or 

[url="http://www.facebook.com/utensil"]http://www.facebook.com/utensil[/url]

 

Then replace the first code I had you find on Product_info.php with

 

<a href="http://www.facebook.com/YOUR_URL"><img src="http://www.tboltusa.com/709images/addTBoltonFacebook.png?YOUR_HOSTED_IMAGE"></a>

A little knowledge of php goes a long way.

Posted

I added a facebook link today to my store, I didnt bother with coding I just used a banner and linked the banner image to my facebook group url. Much easier, I found. Take a look here www.styleme4less.com.au

Hope this helps

  • 4 months later...
Posted

Find

<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?>

 

Then, Make a small Facebook Banner in Photoshop, or Paint, similar to addTBoltonFacebook.png

 

then go to your page, and copy your page's URL. It should look something like

 

http://www.facebook.com/profile.php?id=672481566

Or 

[url="http://www.facebook.com/utensil"]http://www.facebook.com/utensil[/url]

 

Then replace the first code I had you find on Product_info.php with

 

<a href="http://www.facebook.com/YOUR_URL"><img src="http://www.tboltusa.com/709images/addTBoltonFacebook.png?YOUR_HOSTED_IMAGE"></a>

 

 

I still cannot get the facebook link to post. I have done all of the changes that you put up, but I don't see any difference on my website. Should i change something other than the product_info.php?

This is my signature.

Posted

I still cannot get the facebook link to post. I have done all of the changes that you put up, but I don't see any difference on my website. Should i change something other than the product_info.php?

The link I have seen, not tested, is

http://www.facebook.com/share.php?u=http://www.yoursite.com&title=yoursitename

 

Use whatever graphic you want.

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

  • 9 months later...
Posted

Does anyone know a way of tracking if they actually shared the link so you could reward them e.g with a coupon?

  • 3 months later...
  • 3 months later...
Posted

Hi,

Where can I find the product_php? I also want to place the Facebook link on homepage of website. I dont know how to find these things. Need help.

  • 4 months later...
Posted

This is my own solution to adding a custom facebook share button on the product_info.php file:

 

 

<?php $prodlink = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];?>

<?php $prodimage = 'http://'.$_SERVER['SERVER_NAME'].'/'.DIR_WS_IMAGES . $product_info['products_image'];?>

 

<a href="http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $tags_array['desc'] ?>&p=<?php echo $prodlink;?>&p[images][0]=<?php echo $prodimage;?> "target="blank"><img src="../images/custom_images/bb-fb.png" width="14" height="14" border="0" alt="Share on Facebook"></a>

 

Hope this helps someone. All the best - Dave Roberts - [email protected]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...