tswitze Posted June 27, 2010 Share Posted June 27, 2010 I'm trying to implement Facebook's open graph meta tags (see http://developers.facebook.com/docs/opengraph) on a 1.31.1 store and can't figure out how to generate the og:image tag. This is the code I have so far. The code for the og:title and og:url are parsing the correct values but I have no idea what code to use to get the correct product image for the og:image tag <html xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> ....... <meta property="og:title" content="{$meta_title|escape:'htmlall':'UTF-8'}"/> <meta property="og:type" content="product"/> <meta property="og:url" content="{php} echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; {/php}"/> <meta property="og:image" content=""/> <meta property="fb:app_id" content="(your developer ID)"/> <meta property="og:site_name" content="(your site name)"/> Link to comment Share on other sites More sharing options...
jinxx Posted July 19, 2010 Share Posted July 19, 2010 I'm not a presta developer, but in is the best image url for product, ok? So look to classes/Product and Product::getImages($lang) or Product::getCover($lang) which return product's cover image ID. If you have an ID of a image, you win.Look at for example to modules/gsitemap to Gsitemap::_postProcess where are generated URLs to sitemap.xml, ones from cms pages, ones for products and ones for images. Ok, I think, that image URL is something like this:$link = new Link();ogImageUrl = 'http://'.htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').'/img/p'.$link->getImageLink($productId.'-'.$imageId);I answered you?I'm going to make something similar, but not now, to 3 months later... Do you place your plugin as opensource? I will be continuing in your work. I'm trying to implement Facebook's open graph meta tags (see http://developers.facebook.com/docs/opengraph) on a 1.31.1 store and can't figure out how to generate the og:image tag. This is the code I have so far. The code for the og:title and og:url are parsing the correct values but I have no idea what code to use to get the correct product image for the og:image tag<html xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> ....... <meta property="og:title" content="{$meta_title|escape:'htmlall':'UTF-8'}"/> <meta property="og:type" content="product"/> <meta property="og:url" content="{php} echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; {/php}"/> <meta property="og:image" content=""/> <meta property="fb:app_id" content="(your developer ID)"/> <meta property="og:site_name" content="(your site name)"/> Link to comment Share on other sites More sharing options...
Kitlam123 Posted December 9, 2010 Share Posted December 9, 2010 did you ever get this to work? i am trying to do the same thing..and get the cover image product thumb url and use it in the og:image meta tag in header.php. Link to comment Share on other sites More sharing options...
jinxx Posted February 16, 2011 Share Posted February 16, 2011 Ok, I'm sick today, for worst flu in my life so I had time to done this download from http://code.google.com/p/prestashop-facebook-opengraph-module/Your contributions are very welcomed.This is working plugin implementing META tags from http://developers.facebook.com/docs/reference/api/So if page is not product page, it displays site logo and og:type website. If a page is product's page, it displays product image (first from lang_id and product_id) and og:type product.Enjoy! Link to comment Share on other sites More sharing options...
peanut Posted March 31, 2011 Share Posted March 31, 2011 Hi JinxxThanks for your module. I just have one problem, the image will not show up for the product correctly. Can you please help? I have friendly url enabled on PS1.3.2Thanks Link to comment Share on other sites More sharing options...
chup Posted June 15, 2011 Share Posted June 15, 2011 Hi Jinxxim running 1.4.2.5, and the images is not showing up also. any fixed for that? Link to comment Share on other sites More sharing options...
joshua_lee Posted June 16, 2011 Share Posted June 16, 2011 Yes, there is something that is not working in creating the image URL, it does this:www.something.com/img/p/102--large.jpgIt's not getting the id_image for some reason. Please help, this is a great module! Link to comment Share on other sites More sharing options...
DFC005 Posted June 22, 2011 Share Posted June 22, 2011 If you're having trouble with this great mod, try editing fbopengraph.php and looking for this piece of code. //if language is present $id_lang = $_GET['id_lang']; if (!isset($id_lang)) { //if is not present, hardcode lang_id as in www.acidx.cz //change this to whatever language code you actually use $id_lang = 3; } if ($_DEBUG == 1) { echo 'IdLang: '.$id_lang.''; } I had to change $lang_id = 3 to $lang_id = 1 and then it worked fine for me. 1 Link to comment Share on other sites More sharing options...
joshua_lee Posted June 22, 2011 Share Posted June 22, 2011 That's the fix! Thanks DFC005. Link to comment Share on other sites More sharing options...
bakte Posted September 19, 2011 Share Posted September 19, 2011 Hello, Really good and light module! Doesn't work with PS 1.4.3 since i update the shop ! Link to comment Share on other sites More sharing options...
bakte Posted September 19, 2011 Share Posted September 19, 2011 my images have a new image path .../p/1/x/xxx.jpg and this module link is to : .../p/xxx.jpg i am confuse with this new way of stocking image thanks for you help ! Link to comment Share on other sites More sharing options...
Eddan Posted September 24, 2011 Share Posted September 24, 2011 I have not been managed to get this to work... when I click on the "like" button on a product, wrong image is being displayed att the wall on fb. can someone tell step by step how to figured this out best regards Eddan Link to comment Share on other sites More sharing options...
mr10 Posted September 28, 2011 Share Posted September 28, 2011 check http://www.prestashop.com/forums/topic/67536-solved-load-category-name-and-product-name-in-header/ i got the open graph meta tags working in the header that way (see my post there #14) good luck! Link to comment Share on other sites More sharing options...
kyrre Posted October 26, 2011 Share Posted October 26, 2011 Hi guys I have installed the module in my 1.3.1.1 and the Facebook Like button writes the Like to the wall, but an error appears, and the Like button count is 0. "Applikasjons-IDen specifiied in meta tag "fb:app_id" is not alowed on that domain." Please advice Link to comment Share on other sites More sharing options...
avantec Posted April 3, 2012 Share Posted April 3, 2012 Thanks for this!! I've already used it together with prestaloveaddthis module. This module if free for use, but...it has several disfunction like FB open graph, its not included. So I added fbopengraphmodule (I'm using PS 1.4.7 here http://www.luxusni-pradylko.cz) and I had also problems with images....I made change like DFC005 and now its working all fine :-))) THX DFC005 for saving my time!! Link to comment Share on other sites More sharing options...
peanut Posted May 4, 2012 Share Posted May 4, 2012 Hi I tried this, it wasn't working and now suddenly my Facebook Like block & Facebook connect block isn't showing up properly. Any ideas why? Link to comment Share on other sites More sharing options...
peanut Posted May 5, 2012 Share Posted May 5, 2012 Hi So I figured that this code in my header.tpl was interferring with all my other Facebook modules: [color=#000000][font=arial, sans-serif][size=3]<html xmlns:og="[/size][/font][/color][url="http://ogp.me/ns#"]http://ogp.me/ns#[/url][color=#000000][font=arial, sans-serif][size=3]" xmlns:fb="[/size][/font][/color][url="http://www.facebook.com/2008/fbml"]http://www.facebook.com/2008/fbml[/url][color=#000000][font=arial, sans-serif][size=3]">[/size][/font][/color] But this is what the opengraph module says must be added. How can I get Opengraph to work? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now