Facebook links and images

Open to all! Ask other shopowners for help.
Post Reply
User avatar
mhsuffolk
Contributor
Posts: 199
Joined: Sat Oct 26, 2019 9:13 am
Phoenix Version: v1.1.0.6
Has thanked: 12 times
Been thanked: 11 times

Facebook links and images

Post 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?


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Facebook links and images

Post 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.
User avatar
mhsuffolk
Contributor
Posts: 199
Joined: Sat Oct 26, 2019 9:13 am
Phoenix Version: v1.1.0.6
Has thanked: 12 times
Been thanked: 11 times

Re: Facebook links and images

Post 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.
User avatar
Cary
Member
Posts: 34
Joined: Fri Mar 12, 2021 9:36 pm
Phoenix Version: v1.0.9.1
Has thanked: 3 times
Been thanked: 3 times

Re: Facebook links and images

Post by Cary »

Thanks! That worked for now and I really needed that piece of knowledge.
:+1:
- Cary


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply