View Single Post
Old June 22nd, 2012, 03:21 AM
andrewjg andrewjg is offline
Join Date: Jun 2012
Posts: 43

Thanks Eric, definitely getting there!

When I click "Like" on a Category page, no image shows in Facebook. And when I click "Like" on a Product page, it uses my header as the image (which is far too wide).

Is it possible to make the code pick one of the product's images off the page and push that to Facebook?

I was going to replace ".image" with ".thumbnail", to see what happens...

<meta property="og:image" content="http://<?php echo $_SERVER['HTTP_HOST']; ?>[product.image tag='0']" />
...but the new code you provided me doesn't seem to reference ".image":

<div class="fb-like" data-href="<?php echo datafeedr_tools()->current_url(true); ?>" data-send="true" data-width="450" data-show-faces="true" data-font="arial"></div>
<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); = id;
js.src = "//";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Failing that, on my website (as opposed to my Store which is set up as a sub-domain), I use this code...

<meta property="og:image" content="" /> pull in this image...

...when the Like button is used. And it's the right size for Facebook.

But ideally it would grab a product image instead. Is this possible?


Last edited by andrewjg : June 22nd, 2012 at 03:28 AM.