Author Topic: Tutorial: How to get Facebook Like working on your Virtuemart site  (Read 107824 times)

kevinwood

  • Jr. Member
  • **
  • Posts: 151
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #105 on: October 12, 2011, 18:07:58 pm »
Thanks for this plugin. It's been working a treat on our site.. :)

Although when testing links at http://developers.facebook.com/tools/debug it says that og:locale should be explicitly provided.
It shows as a warning that should be fixed as opposed to an error..

Is there a way to do this through the plugin in some way??


Hi there.  Thanks for the heads up.  It appears that Facebook is finally introducing internationalization to open graph:
https://developers.facebook.com/docs/beta/opengraph/internationalization/

At this point the addition of the og:locale tag is optional and I don't think it is a good idea to have the plugin put it in until it can be done right.  It is not clear to me from the FB documentation how it might work with existing Joomla multi-language extensions such as JoomFish.  I'd want to work with a JoomFish user to see how it fits together.


filterit

  • Jr. Member
  • **
  • Posts: 147
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #106 on: October 19, 2011, 18:47:38 pm »
Worked great in putting the og: information in there only problem for me is that the URL shown is not the sh404sef url.
Shame

kevinwood

  • Jr. Member
  • **
  • Posts: 151
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #107 on: October 19, 2011, 18:52:10 pm »
Worked great in putting the og: information in there only problem for me is that the URL shown is not the sh404sef url.
Shame

what version of sh404sef are you using?

JasonShoulet

  • Beginner
  • *
  • Posts: 3
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #108 on: October 27, 2011, 06:26:32 am »
First off THANKS for a great plugin!  My like button posts everything to my wall appropriately (picture, url and message) but on my website I get the red error and the page doesn't remember I liked it.  The send button works without issue.  Here's my information:

Error: The app ID specified within the "fb:app_id" meta tag is not allowed on this domain. You must setup the Connect Base Domains for your app to be a prefix of http://www.careerpillar.com/Interview-Mentor-Products/What-Are-Your-Salary-Expectations.html.

sh404sef version: 2.3.0.988

VM version: 1.1.7 and the cookie checkbox is unchecked

Any help would be greatly appreciated.  Thanks

Jason

!!!! FIXED !!!!

Had to go into my FB app settings and add my domain to the App Domain setting (careerpillar.com) and then fill out the site URL setting (this setting is further down the page from the App Domain setting) this is the core site URL with a trailing slash "/" (http://www.careerpillar.com/).  Hope this helps someone else...THANKS AGAIN kevinwood!

agiovacchini

  • Beginner
  • *
  • Posts: 2
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #109 on: November 01, 2011, 23:31:14 pm »
Hallo, thank you for the big work you have done, it's working very good. I've got only one problem: my "likes" go to facebook without images and I've red all the eight pages of posts looking for something I could have mistaken but everything seems right, even the og:image is good:

<meta property="og:image" content="http://www.agware.it/components/com_virtuemart/shop_image/product/resized/VaVeliero___Back_4e9a12efa760b_90x90.png"/>


This is the code I've putted at the top of flypage:

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__);
 ?>


and this after the "add to cart" button:

<fb:like send="true" width="450" show_faces="false"></fb:like>


A sample page is this: http://www.agware.it/index.php/VaVeliero/Altri-accessori-Notebook/8034140802097-VaVeliero-Back-Cover-per-iPad-2-Carbonio.html

Greets,
Andrea

pmuruaga

  • Beginner
  • *
  • Posts: 21
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #110 on: November 02, 2011, 15:58:48 pm »
I follow the tutorial step by step but the images are not shown, and neither the title, just the url. What could be the problem and how can I solve that? the site is live in vs-tech.com.ar.
The source is including the --meta property="og:image" -- url and title correctly, but on fb nothing is include. Thanks in advance.

kevinwood

  • Jr. Member
  • **
  • Posts: 151
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #111 on: November 02, 2011, 16:27:25 pm »
I suspect that the problem is with Facebook.  Nothing that I "like" right now is showing up on my FB wall at all.

pmuruaga

  • Beginner
  • *
  • Posts: 21
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #112 on: November 06, 2011, 17:25:10 pm »
I changed my site folder structure, I used to have the site inside a subfolder, now I leave it directly over the /web directory, but it is still showing the url and not images, anyway I test with some examples I find looking for this and virtuemart with like button in other sites works correctly and show the image/title not url.
Any idea on how can we solve this.
Thanks in advance.

kevinwood

  • Jr. Member
  • **
  • Posts: 151
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #113 on: November 13, 2011, 15:16:30 pm »
Facebook has clearly changed the behavior of the Like button.  No matter what web site I visit, if I click "Like", it does not post anything to my wall. 

I need to spend some time looking into this more, but haven't had a chance yet.

zdjl505

  • Beginner
  • *
  • Posts: 18
    • roncekembang
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #114 on: November 24, 2011, 06:35:01 am »
Hi Kevin, thanks for your great plugin. This plugin can show product name in 'og:title' meta. In my website, I want to show product category & combined with product name in 'og:title' meta with format 'Product Category | Product Name'. To do so, I slightly change your plugin as follow:

1. Add extra option in 'vmp_title' parameter for choosing 'Product Category | Product Name' as format for 'og:title' meta. To do so I change file vmopengraph.xml as follow
Before
Code: [Select]
<param name="vmp_title" type="list" default="1" label="Title"  description="Select which of the options you would like to use for the og:title tag.  ">
  <option value="0">Do not set tag (uses page title)</option>
  <option value="1">Use Product Name</option>
</param>
After
Code: [Select]
<param name="vmp_title" type="list" default="1" label="Title"  description="Select which of the options you would like to use for the og:title tag.  ">
  <option value="0">Do not set tag (uses page title)</option>
  <option value="1">Use Product Name</option>
  <option value="2">Use Category Name | Product Name</option>
</param>

2.  Modify vmopengraph.php for extracting 1st publish product category. The changes as follow:
Before
Code: [Select]
// add title if requested (FB will default to the page name if no tag added)
$title = $params->get('vmp_title');
if ( $title ) {
$db->setQuery("SELECT product_name FROM #__vm_product WHERE product_id = " . $db->quote($prod_id) );
$db->query();
$result = $db->loadResult();
if ($result) {
$document->addCustomTag( '<meta property="og:title" content="' . $result . '"/>' );
}

After
Code: [Select]
// add title if requested (FB will default to the page name if no tag added)
$title = $params->get('vmp_title');
if ( $title == 1 ) {
$db->setQuery("SELECT product_name FROM #__vm_product WHERE product_id = " . $db->quote($prod_id) );
$db->query();
$result = $db->loadResult();
if ($result) {
$document->addCustomTag( '<meta property="og:title" content="' . $result . '"/>' );
}
} elseif ( $title == 2 ) {
// get the number of categories for the product
$db->setQuery("SELECT COUNT(*) FROM #__vm_product_category_xref WHERE product_id = " . $db->quote($prod_id) );
$db->query();
$numcats = $db->loadResult();

// get list of categories
$db->setQuery("SELECT category_id FROM #__vm_product_category_xref WHERE product_id = " . $db->quote($prod_id) );
$db->query();
$cats = $db->loadResultArray();

// find category name of the first published category
foreach ($cats as $cat) {
$db->setQuery("SELECT category_publish, category_name FROM #__vm_category WHERE category_id = " . $db->quote($cat) );
$db->query();
$row = $db->loadRow();
if ( $row[0] == 'Y' ) { break; }
}
$cat_name = $row[1];

// find product name
$db->setQuery("SELECT product_name FROM #__vm_product WHERE product_id = " . $db->quote($prod_id) );
$db->query();
$prd_name = $db->loadResult();

$result = $cat_name . ' | ' . $prd_name;
if ($result) {
$document->addCustomTag( '<meta property="og:title" content="' . $result . '"/>' );
}
}

This modif already implemented in http://www.roncekembang.com.

Regards,
The spirit of sharing

cmathias

  • Beginner
  • *
  • Posts: 5
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #115 on: December 03, 2011, 18:14:59 pm »
Hello,

I have followed your tutorial and got the Like button working using your Open Graph plugin.
However, after I've clicked on a Like button, I have an error link displayed next to the button pointing to this:

"The app ID "xxxx" specified within the "fb:app_id" meta tag was invalid."

In the plug-in settings, I have populated the Facebook Admins field with my facebook page administrator ID.

Could you help me solve this problem ?

Thanks
Mathias

shakensoul

  • Beginner
  • *
  • Posts: 24
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #116 on: December 25, 2011, 18:59:31 pm »
Merry christmas to everyone... :)

I have used this plugin and everything works except the images. Facebook always picks the wrong image for the product.

As per an earlier post, I tried changing the code from the

Code: [Select]
$imgurl = JURI::base() . "components/com_virtuemart/shop_image/product/" . $image;
to

Code: [Select]
$imgurl = $image;
but still fb gets the wrong image. When I look at the product page, the image url is displayed as

http://www.futuresounds.in/components/com_virtuemart/show_image_in_imgtag.php?filename=resized%2FJunbai_Modern_4ef38f65edfab_130x120.jpg&newxsize=130&newysize=120&fileout=

I tried changing the image path to com_virtuemart/shop_image/product/resized/ but did not help.

Any help would be appreciated to resolve this issue. Domain is www.futuresounds.in

ludmoral

  • Beginner
  • *
  • Posts: 1
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #117 on: December 31, 2011, 18:10:52 pm »
mine is working alright just one problem.... when I go to a child product the button disappearse, anyone seen/solved that one?

Best regards

joomlaforever

  • Beginner
  • *
  • Posts: 42
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #118 on: January 04, 2012, 07:30:05 am »
is there a plugin for VM2?

jjakes24

  • Beginner
  • *
  • Posts: 1
Re: Tutorial: How to get Facebook Like working on your Virtuemart site
« Reply #119 on: January 16, 2012, 02:36:12 am »
This is not working for me as well, the image is always incorrect.  Using the facebook debugger, it is always pulling the incorrect final URL.  The initial and conanical URLS are correct and have the correct OG meta tags in them.  This doesn't seem to matter though as it fully hinged on the final URL which is completely wrong somehow.

http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.stupidhockey.com%2Fplayer%2Fplayersticks%2F1-piece-sticks%2Fdetail%2F79-rink-rat%2Fflypage.pbv.tabs%2F547-rink-rat-vt733-4-pack%3Fsef%3Dhcfp

anyone have any ideas?