Author Topic: How are you using Facebook's Like Button with VM?  (Read 16239 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10437
  • VirtueMart Version: 3+

studiostefan

  • Beginner
  • *
  • Posts: 8
Re: How are you using Facebook's Like Button with VM?
« Reply #16 on: March 24, 2011, 11:41:55 am »
Hi.

This is my solution. I guess there are better ones out there, but it worked for me.

First i generated a link to one of the products in my webshop at facebooks "Like" page: http://developers.facebook.com/docs/reference/plugins/like/

Then, in the top part of the flypage, i declared all the variables necessary to build the link:
Code: [Select]
<?php
if ( isset ( $_GET["page"] ) ) { $fb_page $_GET["page"]; } else { $fb_page ""; }
if ( isset ( 
$_GET["flypage"] ) ) { $fb_flypage $_GET["flypage"]; } else { $fb_flypage ""; }
if ( isset ( 
$_GET["product_id"] ) ) { $fb_product_id $_GET["product_id"]; } else { $fb_product_id ""; }
if ( isset ( 
$_GET["category_id"] ) ) { $fb_category_id $_GET["category_id"]; } else { $fb_category_id ""; }
if ( isset ( 
$_GET["option"] ) ) { $fb_option $_GET["option"]; } else { $fb_option ""; }
if ( isset ( 
$_GET["Itemid"] ) ) { $fb_Itemid $_GET["Itemid"]; } else { $fb_Itemid ""; }
?>

I guess there is an easier way. :)

Then i built the link within the facebook generated code and pasted it inside the layout html:
Code: [Select]
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2YOURDOMAIN%2Findex.php%3Fpage%3D<?php echo $fb_page?>%26flypage%3D<?php echo $fb_flypage?>%26product_id%3D<?php echo $fb_product_id?>%26category_id%3D<?php echo $fb_category_id?>%26option%3D<?php echo $fb_option?>%26Itemid%3D<?php echo $fb_itemid?>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
I hope this is of help to someone.

-studiostefan

m.davide82

  • Jr. Member
  • **
  • Posts: 192
Re: How are you using Facebook's Like Button with VM?
« Reply #17 on: March 31, 2011, 12:21:42 pm »
I always have red error...

Yereverluvinunclebert

  • Jr. Member
  • **
  • Posts: 88
Re: How are you using Facebook's Like Button with VM?
« Reply #18 on: September 12, 2011, 01:33:23 am »
This plugin works with Joomla 1.0.15 and virtuemart 1.0.15

http://lightquick.co.uk/jdownloads/facebook-like-this-button-for-joomla-1.0.html
Yereverluvinunclebert - Maker of some steampunk widgets of distinction

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10437
  • VirtueMart Version: 3+
Re: How are you using Facebook's Like Button with VM?
« Reply #19 on: September 12, 2011, 14:28:30 pm »
Hi.

This is my solution. I guess there are better ones out there, but it worked for me.

First i generated a link to one of the products in my webshop at facebooks "Like" page: http://developers.facebook.com/docs/reference/plugins/like/

Then, in the top part of the flypage, i declared all the variables necessary to build the link:
Code: [Select]
<?php
if ( isset ( $_GET["page"] ) ) { $fb_page $_GET["page"]; } else { $fb_page ""; }
if ( isset ( 
$_GET["flypage"] ) ) { $fb_flypage $_GET["flypage"]; } else { $fb_flypage ""; }
if ( isset ( 
$_GET["product_id"] ) ) { $fb_product_id $_GET["product_id"]; } else { $fb_product_id ""; }
if ( isset ( 
$_GET["category_id"] ) ) { $fb_category_id $_GET["category_id"]; } else { $fb_category_id ""; }
if ( isset ( 
$_GET["option"] ) ) { $fb_option $_GET["option"]; } else { $fb_option ""; }
if ( isset ( 
$_GET["Itemid"] ) ) { $fb_Itemid $_GET["Itemid"]; } else { $fb_Itemid ""; }
?>

I guess there is an easier way. :)

Then i built the link within the facebook generated code and pasted it inside the layout html:
Code: [Select]
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2YOURDOMAIN%2Findex.php%3Fpage%3D<?php echo $fb_page?>%26flypage%3D<?php echo $fb_flypage?>%26product_id%3D<?php echo $fb_product_id?>%26category_id%3D<?php echo $fb_category_id?>%26option%3D<?php echo $fb_option?>%26Itemid%3D<?php echo $fb_itemid?>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
I hope this is of help to someone.

-studiostefan

You should use Jrequest when possible
http://api.joomla.org/Joomla-Framework/Environment/JRequest.html

beltoforion

  • Jr. Member
  • **
  • Posts: 182
  • Everything is Possible!
    • Ofix-Comp
Re: How are you using Facebook's Like Button with VM?
« Reply #20 on: April 09, 2012, 21:09:42 pm »
does this work for VM2? anybody been trying it out?
wanting to learn to create good templates

rupesh

  • Jr. Member
  • **
  • Posts: 113
Re: How are you using Facebook's Like Button with VM?
« Reply #21 on: May 21, 2012, 18:44:48 pm »
does this work for VM2? anybody been trying it out?

ya its needed in vm 2 also but most of them are commercial like http://www.nordmograph.com/en/downloads/details/110/151/virtuemart-plugins/vm2-share-plugin-for-virtuemart.html

QubeSys Technologies

  • Jr. Member
  • **
  • Posts: 288
  • Joomla & Magento Services
Blissful!