I added

https://www.facebook.com/sharer/sharer.php?u=&t=', 'facebook', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="__('Share on Facebook') ?>">Facebook

for product share on facebook. Everything works fine but image not showing.

2 Answers 2


Add the below og details to your product details page:

<meta property="og:description" content="Your content to share on facebook" />
<meta property="og:image" content="http://www.example.com/media...productimage.jpg" />

Replace description and image url with your product description and image.

For more guidance you can refer the below link: https://developers.facebook.com/docs/sharing/best-practices#tags

Add the below code snippet to your head.phtml

 $_prodID = Mage::registry('current_product')->getId();
 $_product = Mage::getModel('catalog/product')->load($_prodID );
<meta property="og:title" content="<?php echo $_product->getog_title() ?>" />
<meta property="og:type" content="product" />
<meta property="og:image" content="<?php echo $_product->getog_image() ?>" />
<meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
<meta property="og:description" content="<?php echo $_product->getog_description() ?>" />
<meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
  • where i add this afater by sahre code?
    – imtia
    Jun 26, 2018 at 14:19
  • Under head tag of product details page. Jun 26, 2018 at 14:23
  • can you give little breif code? because i have sahringfile.phtml
    – imtia
    Jun 26, 2018 at 14:28
  • Wait! I am posting the code. Jun 26, 2018 at 14:29
  • <a href="javascript:popWin('facebook.com/sharer/sharer.php?u=<?php echo urlencode($_productUrl ); ?>&t=<?php echo urlencode($productName); ?>', 'facebook', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="<?php echo $this->__('Share on Facebook') ?>">Facebook</a> <meta property="og:image" content="<?php echo urldecode($_productImageUrl) ?>"/>
    – imtia
    Jun 26, 2018 at 14:30

You have to debug your url here https://developers.facebook.com/tools/debug/ where you can find error on your url. After added your url you have to click on fetch new information or scrap again. In facebook if one time product shared then it's data cached in facebook so you have to click on "scrap again" button for get updated data. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.