Thanks for your help I got it sorted. Turns out the problem was simply that the site was down for maintenance so facebook couldn't scrape the page for the information. Once I figured out how the facebook like button worked it was pretty obvious.
I made a few code changes to html_header.php if anyone is interested.
To get the preview pop up window to show when the like button is pressed open the includes/templates/andover_modern/common/html_header.php
Find this near the top
Code:
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
and replace with this
Code:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" <?php echo HTML_PARAMS; ?>>
I then had an issue with facebook using the wrong image, this is because it uses the first image it finds on the page, in my case it was the first image in the whats new sidebox. so to make sure it uses the correct image and to comply with facebooks recommended tags in the same file as above find this:
Code:
<title><?php echo META_TAG_TITLE; ?></title>
and under this add:
Code:
<meta property="og:title" content="<?php echo META_TAG_TITLE; ?>" />
<meta property="og:type" content="product" />
<meta property="og:site_name" content="<?php echo STORE_NAME; ?>" />
<meta property="og:description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<?php
if (isset($_GET['products_id'])) { // use products_image if products_id exists
$facebook_image = $db->Execute("select p.products_image from " . TABLE_PRODUCTS . " p where products_id='" . (int)$_GET['products_id'] . "'");
$fb_image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $facebook_image->fields['products_image'];
}
if ($fb_image == 'stickadefaultimagehere') { // if no products image, use the default image if enabled
$fb_image = '';
}
if ($fb_image != '') {
?>
<meta property="og:image" content="<?php echo $fb_image; ?>" />
<?php
}
?>
Hope this helps anyone whos looking for it
Bookmarks