My own solution
=============================
Save the following as includes/modules/YOUR_TEMPLATE/og_tags.php
Code:
<?php
$og_title = META_TAG_TITLE;
$og_site_name = TITLE;
$og_image = HTTP_SERVER.DIR_WS_CATALOG.'includes/templates/custom/images/default_image.png';
$og_url = $canonicalLink;
$og_fb_admin = 'XXXXXXX'; // something like 2614614
$og_type = 'website';
$og_description = META_TAG_TITLE;
if(substr($_GET['main_page'],-5) == '_info')
{
// this is a product info page
$sql = "SELECT p.products_image
FROM ".TABLE_PRODUCTS." p
WHERE p.products_id = '" . (int)$_GET['products_id'] . "'"
;
$obj = $db->Execute($sql);
$og_image = HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES.$obj->fields['products_image'];
}
echo
'<meta property="og:title" content="'.$og_title.'"/>
<meta property="og:site_name" content="'.$og_site_name.'"/>
<meta property="og:image" content="'.$og_image.'"/>
<meta property="og:url" content="'.$og_url.'"/>
<meta property="fb:admins" content="'.$og_fb_admin.'"/>
<meta property="og:type" content="'.$og_type.'"/>';
You'll need to change the facebook id to your own one!
=============================
Then add a line in includes/templates/YOUR_TEMPLATE/common/html_header.php
Code:
<meta name="generator" content="shopping cart program by Zen Cart™, http://www.zen-cart.com eCommerce" />
<!--Add OG tags-->
<?include(DIR_WS_MODULES . zen_get_module_directory('og_tags.php'));?>
the red lines are new - the other line is just there to show you where to put it.
=============================
Then upload an image to :
'includes/templates/custom/images/default_image.png
This is the image that will be used for pages other than product pages. Usually the logo of the store.
=============================