doooomed:
Hello,
(using 1.5) I have been searching around but I can't seem to find a complete answer (at least not one that I understand) so if this is posted/answered elsewhere, apologies.
I have this installed, and seems to work fine with the exception that I do not get pictures on my FB page after liking a product, just a link to the product page, nothing else. Any help would be great!
A link to your store would help a lot and save guess work
Did you do these edits:
- tpl_product_info.php
look afor this at the top of the page:
//require(DIR_WS_MODULES . '/debug_blocks/product_info_prices.php');
?>
<div class="centerColumn" id="productGeneral">
Add this code after it
<!-- bof Facebook Like Button -->
<div id="likeButton"><fb:like></fb:like></div>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '**your application id**', status: true, cookie: true,
xfbml: true});
FB.Event.subscribe('edge.create', function(href, widget) {
// Do something, e.g. track the click on the "Like" button here
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
<!-- eof Facebook Like Button -->
after
<div class="centerColumn" id="productGeneral"> at the top of the file
- html_header.php
Change the second line of the file to: <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>> to
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?> xmlns:fb="http://www.facebook.com/2008/fbml">
Add this code
<meta property="og:title" content="<?php echo META_TAG_FBTITLE; ?>"/>
<meta property="og:site_name" content="<?php echo TITLE; ?>"/>
<meta property="og:image" content="<?php echo META_TAG_FBIMG; ?>"/>
<meta property="og:url" content="<?php echo $canonicalLink; ?>"/>
<meta property="fb:admins" content="**your_application_id or facebook admins**"/>
<meta property="og:type" content="product"/>
anywhere before the </html> tag.
******* **this is how mine looks:<meta property="og:title" content="<?php echo META_TAG_FBTITLE; ?>"/>
<meta property="og:title" content="<?php echo META_TAG_TITLE; ?>"/>
<meta property="og:site_name" content="<?php echo TITLE; ?>"/>
<meta property="og:image" content="<?php echo META_TAG_FBIMG; ?>"/>
<meta property="og:url" content="<?php echo $canonicalLink; ?>"/>
<meta property="og:type" content="product"/>
<meta property="fb:admins" content="app_id_here"/> *****
- metatags.php
Replace this code (line 210 in 1.3.8)
$sql= "select pd.products_name, p.products_model, p.products_price_sorter, p.products_tax_class_id,
p.metatags_title_status, p.metatags_products_name_status, p.metatags_model_status,
p.products_id, p.metatags_price_status, p.metatags_title_tagline_status,
pd.products_description, p.product_is_free, p.product_is_call,
mtpd.metatags_title, mtpd.metatags_keywords, mtpd.metatags_description
with this
$sql= "select pd.products_name, p.products_model, p.products_price_sorter, p.products_tax_class_id, p.products_image,
p.metatags_title_status, p.metatags_products_name_status, p.metatags_model_status,
p.products_id, p.metatags_price_status, p.metatags_title_tagline_status,
pd.products_description, p.product_is_free, p.product_is_call,
mtpd.metatags_title, mtpd.metatags_keywords, mtpd.metatags_description
-
metatags.php
Add this code (line 293 in 1.3.8):
//bof facebook like button
if($product_info_metatags->fields['products_image']!='') {
$FBimgURL = (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ) . DIR_WS_IMAGES . $product_info_metatags->fields['products_image'];
define('META_TAG_FBIMG', $FBimgURL);
} else {
define('META_TAG_FBIMG', '');
}
define('META_TAG_FBTITLE', str_replace('"','',zen_clean_html($product_info_metatags->fields['products_name'])));
//eof facebook like button
between this
} // CUSTOM META TAGS
and this
} // EOF
break;
also I have this code added and am able to have image go up when link is clicked too:
place it in tpl_product_info_display.php also which I put after <!--eof Product Price block -->
<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,height=436');return false;}</script><style> html .fb_share_link { padding:2px 0 0 20px; height:32px;) no-repeat top left; }</style><a href="http://www.facebook.com/share.php?u=<?php echo "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'];?>" onclick="return fbs_click()" target="_blank" class="fb_share_link"><img src=http://fantasiesrealm.com/images/facebook.gif width=25><font size=+2> Share on FaceBook: <strong><?php echo $products_name; ?></strong></a></font><br/><br/><br/><br/>
all the <br/> are there by me fo spacing on my template you can go to my store to look where I have my FB link at in product pages...so those can be removed.
hope this helps