Page 1 of 1

Facebook links and images

Posted: Tue Feb 06, 2024 2:15 pm
by mhsuffolk
Phoenix 1.0.8.20
Issue with Facebook links and images.
I post on Facebook with a link to the relevant product page on my website.

I am using the PI Gallery Layout Module and the Product Open Graph Meta Tags Header Tag Module.

If I have just one image in the product FB, correctly displays it using the og.image Tag.
If I have additional images added in the Gallery then FB insists on using the first additional image instead of the original main image, again using the og.image tag. The only solution I have found is to repeat the original image in the 1st additional Gallery position which is not ideal.

Is the Product Open Graph Meta Tags Header Tag Module pointing FB to the wrong image when there are more than one?

Re: Facebook links and images

Posted: Tue Feb 06, 2024 2:25 pm
by burt
https://github.com/CE-PhoenixCart/Phoen ... hp#L32-L33

says:
Use the first large image if there is one, otherwise use the main image.

--

This is a throwback to when the product images were used in this way;

thumbnail
large images

At that time the first large image was always a bigger version of the thumbnail

--

Is it a bug? Maybe. Raise it as a bug in the 1.0.8.21 thread.

You can amend L33 of that file to suit your needs in the meantime.

Re: Facebook links and images

Posted: Tue Feb 06, 2024 2:52 pm
by mhsuffolk
burt wrote: Tue Feb 06, 2024 2:25 pm
You can amend L33 of that file to suit your needs in the meantime.
I have amended L33 to

Code: Select all

$products_image = $product->get('image');
Seems to have cured it.

Re: Facebook links and images

Posted: Tue Sep 03, 2024 10:26 pm
by Cary
Thanks! That worked for now and I really needed that piece of knowledge.
:+1: