Hey, there! I am needing to know the php that will pick up the main product image on each product pages, so that Facebook knows which pic to use for social sharing. Right now, when someone shares to FB, it picks up random images on the page.
Here is what I am trying to put in the head.tpl
Here is what I need:
<meta property="og:image" content="url_of_image" />
I have tried both of these:
<meta property="og:image" content="<?php echo $image_url; ?>" />
<meta property="og:image" content="<?php echo $image['main_url']; ?>" />
However, when I view source, it shows up like this, so it isn't picking up code:
<meta property="og:image" content="" />