Guest Posted November 13, 2007 Posted November 13, 2007 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?
panicgripdesigns Posted August 23, 2009 Posted August 23, 2009 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 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.
anola82 Posted August 26, 2009 Posted August 26, 2009 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
gruntstyle Posted January 11, 2010 Posted January 11, 2010 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 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.
♥mdtaylorlrim Posted January 11, 2010 Posted January 11, 2010 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...?
ozEworks Posted November 10, 2010 Posted November 10, 2010 Does anyone know a way of tracking if they actually shared the link so you could reward them e.g with a coupon?
cathydeere Posted June 8, 2011 Posted June 8, 2011 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.
tauneutrino Posted November 2, 2011 Posted November 2, 2011 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]
axioma Posted November 2, 2011 Posted November 2, 2011 what happened if you use, the facebook share from 2.3.??.. or or use wibya tool bar?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.