Author Topic: Facebook Like & Tweet Button Code for Flypage (SOLVED)  (Read 19761 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Facebook Like & Tweet Button Code for Flypage (SOLVED)
« on: January 14, 2011, 19:57:39 pm »
For creating a facebook "Like Button" on flypage etc.

 
Code: [Select]
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode("http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); ?>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=tahoma&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:65px"></iframe>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Facebook Like Button Code (SOLVED)
« Reply #1 on: January 20, 2011, 11:09:43 am »
For the tweet button, you will need to add the code for the tweet picture


ONLY problem with this code is you have to hardcode the "flypage" in the url

Code: [Select]
<a href="http://twitter.com/home?status=ADDRESS HERE /index.php?page=shop.product_details&amp;flypage=[b]1.tpl[/b]&amp;product_id=<?php echo $product_id ?>&amp;category_id=<?php echo $category_id ?>&amp;option=com_virtuemart&Itemid=1">Tweet

</a>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

perigonza

  • Beginner
  • *
  • Posts: 6
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #2 on: January 23, 2011, 12:31:38 pm »
Hi!

Sorry for asking something that might be obvious, but ... what is the flypage file where you have to include that code? I don't find it ...

Thanks for the help,

Pedro

chimp_rex

  • Beginner
  • *
  • Posts: 1
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #3 on: January 23, 2011, 13:07:14 pm »
Hello Pedro! Correct me if i'm wrong...The file is: /public_html/components/com_virtuemart/themes/default/templates/product_details/flypage.tpl.php.

perigonza

  • Beginner
  • *
  • Posts: 6
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #4 on: January 23, 2011, 13:14:21 pm »
Hi!

Sorry for asking something that might be obvious, but ... what is the flypage file where you have to include that code? I don't find it ...

Thanks for the help,

Pedro


Found it, it was in the template directory under other name.

:)

perigonza

  • Beginner
  • *
  • Posts: 6
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #5 on: January 23, 2011, 13:16:19 pm »
Hello Pedro! Correct me if i'm wrong...The file is: /public_html/components/com_virtuemart/themes/default/templates/product_details/flypage.tpl.php.

Thanks ! sometimes the more you watch the less you see !

basiloukos

  • Beginner
  • *
  • Posts: 6
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #6 on: April 21, 2011, 12:42:34 pm »
Hi,

i've been trying to use this code for facebook like button, and get 2 problems:

1 (red square on attached pic) - sometimes i get the proper title (name) of the item posted on facebook, other times i get the full url of the website.

2 (green square on attached pic) - no matter what the title of the post will be (correct or wrong), i always get some wrong picture showing up, instead of the item picture. On another website I tried the code on, it showed up the little email joomla icon, now I get this mastercard icon that I use on my website's footer.

Anyone got any idea?

Thanks in advance

[attachment cleanup by admin]

bambou

  • Beginner
  • *
  • Posts: 28
    • Bambou Home + Baby - Discover beautiful babywear online
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #7 on: April 27, 2011, 03:32:48 am »
Hi, I have used this code on my flypage and the wrong image is showing up on facebook when the like button is pressed....anybody have a solution?

tormodnor

  • Beginner
  • *
  • Posts: 44
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #8 on: October 08, 2011, 16:00:00 pm »
Hi, i just tried this code, and it works great on-site, but on facebook the link shows up with a virtuemart symbol, not the product photo or even my site logo. Is there a way to edit this easily?

I also want to ad some css to adjust it a bit more. In firebug, i get a "element style", which result in the code;

<html id="facebook" class="" lang="nb" style="width: 340px; margin-top: 25px;">

BUt where do i change this in the actuall codes? (not firebug)

shakensoul

  • Beginner
  • *
  • Posts: 24
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #9 on: December 25, 2011, 16:44:15 pm »
I have tried the code and it works....but shows incorrect image of the product..any fix for this ?

My url is www.futuresounds.in

rupesh

  • Jr. Member
  • **
  • Posts: 113
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #10 on: May 21, 2012, 18:49:14 pm »
can u please modify it for vm 2.x?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #11 on: May 21, 2012, 23:57:43 pm »
can u please modify it for vm 2.x?

This is what I use for facebook share, tweet, and gplus,

I just create a php file called share.php and use this whole code below,
Then place it in my product details override folder.
Then call the code from default.php
like this <?php include("share.php"); ?>

*This is the content of share.php*
<?php defined( '_JEXEC' ) or die( 'Restricted access' );
$sharelink=JURI::current();
?>
<div class="wrap_me" id="shareit">

<div class="gplus">
<div class="g-plusone" data-size="medium"></div></div>

<div class="fbookwrap"><a class="fbooklink none" title="Share on Facebook" href="http://www.facebook.com/share.php?u=<?php echo $sharelink ?>" target="_blank"></a></div>

<div class="tweeter"><a class="tweetlink none" title="Share on Twitter" href="http://twitter.com/home?status=<?php echo $sharelink ?>">
</a></div>

<div class="pin">
<a href="http://pinterest.com/pin/create/button/" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></div>


</div><div class="wrap"></div>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #12 on: May 22, 2012, 00:00:17 am »
Too add the like button to the code above


<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $sharelink ?>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=tahoma&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:65px"></iframe>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

rupesh

  • Jr. Member
  • **
  • Posts: 113
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #13 on: May 24, 2012, 13:00:18 pm »
can u please modify it for vm 2.x?

This is what I use for facebook share, tweet, and gplus,

I just create a php file called share.php and use this whole code below,
Then place it in my product details override folder.
Then call the code from default.php
like this <?php include("share.php"); ?>

*This is the content of share.php*
<?php defined( '_JEXEC' ) or die( 'Restricted access' );
$sharelink=JURI::current();
?>
<div class="wrap_me" id="shareit">

<div class="gplus">
<div class="g-plusone" data-size="medium"></div></div>

<div class="fbookwrap"><a class="fbooklink none" title="Share on Facebook" href="http://www.facebook.com/share.php?u=<?php echo $sharelink ?>" target="_blank"></a></div>

<div class="tweeter"><a class="tweetlink none" title="Share on Twitter" href="http://twitter.com/home?status=<?php echo $sharelink ?>">
</a></div>

<div class="pin">
<a href="http://pinterest.com/pin/create/button/" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></div>


</div><div class="wrap"></div>

hello sir,
first of all thanks for sharing your code but i ddint got any buttons for google and facebook share instead i got button called PIn

see "http://www.elifeshopping.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=286&virtuemart_category_id=41"

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Facebook Like & Tweet Button Code for Flypage (SOLVED)
« Reply #14 on: May 24, 2012, 14:02:39 pm »




I use my own buttons, and this is the CSS assigned to it

/*share this*/
#shareit{position:relative;right:0px;top:13px;width:160px;height:40px;}
#shareit2{position:absolute;right:0px;top:3px;width:160px;height:40px;}
.fbooklink{background:url(/images/fbook.png) no-repeat scroll 0 0 transparent;height:23px;width:23px;display:block;}
.tweetlink{background:url(/images/tweeter.png) no-repeat scroll 0 0 transparent;height:23px;width:23px;display:block;}
.gplus{width:34px;float:left;overflow:hidden;}
#shareit div,#shareit2 div{display:inline;text-align:left;float:left;padding-right:2px;}




[attachment cleanup by admin]
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)