Zen Cart Logo
Forums / All Other Contributions/Addons / No Image when sharing on Facebook

No Image when sharing on Facebook

Views: 13,924

Results 41 to 43 of 43
9 Jan 2013, 2:22 AM
#41
freeze avatar

freeze

New Zenner

Join Date:
Jan 2013
Posts:
1
Plugin Contributions:
0

No Image when sharing on Facebook

jasperandjax:

I have zen cart v1.5 and IH4 and am having the same issue as well... Well actually it sort of varies.. sometimes I get no image pulled over at all for the FB share and sometimes I get a random image out of the catalog...

Does anyone know if this is a coding issue, on IH4 issue or a FB share issue so I might be able to figure out where to start looking. (granted I have zilch for coding skills and just google everything and trial and error till I get it figured out) It is a zen cart issue. I have come close to fixing mine. The only problem is I have my images in sub-directories because I have so many.

<meta property="og:image" content="http://<?=$_SERVER["SERVER_NAME"]?>/images/<? echo META_TAG_PRODUCT_IMAGE;?>" />

The meta tag product image is not working for the Open graph image.

28 Mar 2013, 3:41 PM
#42
gabstero avatar

gabstero

Zen Follower

Join Date:
Nov 2007
Posts:
342
Plugin Contributions:
0

Re: No Image when sharing on Facebook

Freeze:

It is a zen cart issue. I have come close to fixing mine. The only problem is I have my images in sub-directories because I have so many.

<meta property="og:image" content="http://<?=$_SERVER["SERVER_NAME"]?>/images/<? echo META_TAG_PRODUCT_IMAGE;?>" />

> The meta tag product image is not working for the Open graph image.

Where do you add this code?

thanks,
g
28 Mar 2013, 4:18 PM
#43
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: No Image when sharing on Facebook

This is not an issue specifically with Zen Cart.

For those who use a URL Rewriter or have their website installed in a subdirectory you may want to read this post. It explains some issues facebook has with the "base" meta tag and automatic scraping.

If you are specifying your own opengraph tags for the image, make sure the links are absolute with something like:

<meta property="og:image" content="<?php echo(HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $products_image); ?>" />

You may need to modify the above code depending upon how your image path is saved in the database or if you are using IH4 (to omit DIR_WS_IMAGES, add an extra /, or use HTTPS if your entire site forces HTTPS).