Product Images for Facebook Like

====This is no longer working, ideas welcome =) === Facebook like buttons on your product pages are a nice touch to your social media marketing endeavors. However, it’s quite discerning when someone shares your product page and posts a button or other stupid image instead of the product image. Several requests lead me to try to solve this… and I believe I have, with the following “tweak” for your Zen Cart.

  • First make sure you are using the Facebook Like button on your product pages. Next you are going to add a simple edit to your html_header.php
  • So navigate to includes/templates/your_template/common/html_header.php and back it up!
  • If you lack a html_header.php in that loaction got to includes/templates/template_default/common/html_header.php download it and upload it to includes/templates/your_template/common/
  • Now, at some logical location we will add one line of markup using the Facebook Open Graph protocol for the meta property=”og:image”
  • Generally speaking we want to add this without breaking up a php process. I suggest you add it right after <?php } //endif FAVICON ?>

You will be adding the following line:

<meta property=”og:image” content=”<?php echo zen_image(DIR_WS_IMAGES . $product_info->fields[‘products_image’], $product_info->fields[‘products_name’], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT) ?>”/>

That should do it, now Facebook should use your product images and not some rogue image from wherever they decide to latch on to. Please click here to download the text version of these instructions to avoid issues. Like us to install the Facebook Like, Facebook send and this image fix for you? Order the Facebook Like installation for your Zen Cart and get it half off until 8/1/2011 with coupon code BLOGREADER.

One response to “Product Images for Facebook Like”