Forums / Strategies for Advertising my Online Store / Posting specified image to Facebook

Posting specified image to Facebook

Views: 106

Results 1 to 8 of 8
7 Feb 2021, 4:39 PM
#1
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Posting specified image to Facebook

v. 1.55

I'm aware of the FB Open Graph specification, but have never been able to tie the desired image into a Facebook post or comment. You never know what's going to pop up instead of what you actually linked to. Has anyone figured this out? I've looked at a couple of different apps that purport to solve the problem, but the one I tried made no difference at all and the other one messed up the website so bad I had to uninstall it.

website is https://www.newnaturalsonline.com

7 Feb 2021, 9:31 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,864
Plugin Contributions:
18

Re: Posting specified image to Facebook

Funny this should come up as just yesterday I was planning to revisit the addthis.com method of doing this. Have been using it for some time on a couple of sites that are such that I didn't care if the image matched the product shared.

From their https://addthis.com/academy site, they talk specifically about specifying the page tags to truly make add this work.

<meta property="og:title" content="AddThis Tour" /><meta property="og:description" content="Watch the AddThis Tour video." />
<meta property="og:image" content="http://i2.ytimg.com/vi/1F7DKyFt5pY/default.jpg" />
<meta property="og:video" content="http://www.youtube.com/v/1F7DKyFt5pY&fs=1" />
<meta property="og:video:width" content="560" />
<meta property="og:video:height" content="340" />
<meta property="og:video:type" content="application/x-shockwave-flash" />

Specifically, for 99.9% of the cases where I want to use this, I was going to look at getting help in turning the red image code```
<meta property="og:image" content="http://i2.ytimg.com/vi/1F7DKyFt5pY/default.jpg" />


Propagating it with ZC code versus having to take the time to enter the data manually 
Results from their [debug tool](https://developers.facebook.com/tools/debug) shows that a standard 1.5.7b install just needs an accurate og:image to work.  Of course, they want you to add all the og tags but it would work with just the og:image listed correctly.  I have no idea how it currently picks an image but, it is NOT the one for the product ID.

Maybe others will jump in here with possible solutions to generating the meta tag.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

7 Feb 2021, 10:11 PM
#3
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Posting specified image to Facebook

Thanks, that confirms my conclusion that there is no good way to do it, lol. We're at 1.55 and I can not take the time to do an upgrade until after the company move. It just bugged me today that I added a link to our FB page and it popped up some image I didn't remember ever seeing on the website before. I was hoping there was some relatively quick way to accomplish this that I could implement immediately. I'll work on it again after the upgrade and update here if I'm successful.

7 Feb 2021, 10:53 PM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,864
Plugin Contributions:
18

Re: Posting specified image to Facebook

IMHO, yesterday is the best day to upgrade. With a _test folder above the root of your site, you can "play" while the site carries on.

I stress this more in your case as your site is not responsive, has several critical HTML errors, and accessibility problems.

A few years ago, a foreign law firm was taking advantage of folks who unknowingly used a copyrighted image on their site. That has moved on to accessibility. There were over 90 e-commerce ADA lawsuits in this last month.

itssugarDOTcom had two lawsuits filed in January and their scores are not bad compared to most.

To me, it's the best insurance time can buy. Using webaim.org can really be of help.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

14 Jun 2021, 1:17 AM
#5
elemi avatar

elemi

Zen Follower

Join Date:
Mar 2006
Location:
Auckland, New Zealand
Posts:
242
Plugin Contributions:
0

Re: Posting specified image to Facebook

I would love some progress on this - trying to link my products to my FB page and I just keep getting my logo... which is okay if I was posting on someone else's page, but not really that necessary for mine!

Elemi

The Art of Bespoke Aromatherapy
https://www.AmorAromatherapy.co.nz

14 Jun 2021, 8:23 AM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Posting specified image to Facebook

You can do something like this in includes/templates/YOUR_TEMPLATE/common/html_header.php in the <head> block:

<!-- Facebook --> <?php if ($current_page_base == 'product_info' && isset($_GET['products_id'])) { $sql = "select p.products_image from " . TABLE_PRODUCTS . " p where products_id='" . (int)$_GET['products_id']. "'"; $look_up = $db->Execute($sql); echo '<meta property="og:image" content="' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . "images/" . $look_up->fields['products_image'] . '" />'; } else { echo '<meta property="og:image" content="' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . $template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE. '" />'; } if (isset($canonicalLink) && $canonicalLink != '') { echo '<meta property="og:url" content="' . $canonicalLink . '" />'; } ?>

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

14 Jun 2021, 9:04 AM
#7
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Posting specified image to Facebook

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

15 Jun 2021, 6:15 AM
#8
elemi avatar

elemi

Zen Follower

Join Date:
Mar 2006
Location:
Auckland, New Zealand
Posts:
242
Plugin Contributions:
0

Re: Posting specified image to Facebook

swguy:

You can do something like this in includes/templates/YOUR_TEMPLATE/common/html_header.php in the <head> block:

<!-- Facebook --> <?php if ($current_page_base == 'product_info' && isset($_GET['products_id'])) { $sql = "select p.products_image from " . TABLE_PRODUCTS . " p where products_id='" . (int)$_GET['products_id']. "'"; $look_up = $db->Execute($sql); echo '<meta property="og:image" content="' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . "images/" . $look_up->fields['products_image'] . '" />'; } else { echo '<meta property="og:image" content="' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . $template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE. '" />'; } if (isset($canonicalLink) && $canonicalLink != '') { echo '<meta property="og:url" content="' . $canonicalLink . '" />'; } ?>

Thanks Scott :-)

Elemi

The Art of Bespoke Aromatherapy
https://www.AmorAromatherapy.co.nz