Jump to content

Archived

This topic is now archived and is closed to further replies.

acidvertigo

<link rel="img_src" for facebook share

Recommended Posts

Hello,

 

I'want to control the thumbnail that facebook show when a user share a link on my site.

 

Following this directive: Facebook Meta tags

 

I need that in the meta tag:

<link rel="image_src" href="http://www.example.com/catalog/images/product_picture.jpg" />

 

in my product_info.php page points directly to the image of my product generated

 

is this possible?

Share this post


Link to post
Share on other sites

Hi

 

I realise that this thread is very old; however it is the only one I found in a Google search so I will post the solution here.

 

I have installed Social Bookmarks from the code of osCv2.3 at Github and the wrong image was displayed on Facebook.

 

The solution is to add a link to the default image to the Product_info Header between <head> and </head> (or template top in v2.3)

 

<link rel="image_src" href="<?php echo tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) ?>" >

 

Hope this helps someone who is searching for the answer in the future.

 

Regards

 

Ken

Share this post


Link to post
Share on other sites

Hi

 

I realise that this thread is very old; however it is the only one I found in a Google search so I will post the solution here.

 

I have installed Social Bookmarks from the code of osCv2.3 at Github and the wrong image was displayed on Facebook.

 

The solution is to add a link to the default image to the Product_info Header between <head> and </head> (or template top in v2.3)

 

<link rel="image_src" href="<?php echo tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) ?>" >

 

Hope this helps someone who is searching for the answer in the future.

 

Regards

 

Ken

 

 

Thanks Ken you are helping to me on the way. In the source code the path to my product images shows up in the <link rel="image_src" link but this stops wiith /images and not absoltue link to my product is found. How can I integrate the Product ID in this tag so the absolute link will be present for FB?

 

Regards,

 

John

Share this post


Link to post
Share on other sites

Thanks Ken you are helping to me on the way. In the source code the path to my product images shows up in the <link rel="image_src" link but this stops wiith /images and not absoltue link to my product is found. How can I integrate the Product ID in this tag so the absolute link will be present for FB?

 

Regards,

 

John

 

 

<link rel="image_src" href="<?php echo tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) ?>" >

 

I think the problem lies in $product_info['products_image'] is not defined yet in the head section of the page. Later in the page the sql is asserted to define it. the question is How to get $product_info['products_image'] defined in the header section?

 

Any Ideas on how to get this done. I have other $product_info things working in the head section.

Share this post


Link to post
Share on other sites

<link rel="image_src" href="<?php echo tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) ?>" >

 

I think the problem lies in $product_info['products_image'] is not defined yet in the head section of the page. Later in the page the sql is asserted to define it. the question is How to get $product_info['products_image'] defined in the header section?

 

Any Ideas on how to get this done. I have other $product_info things working in the head section.

 

Hi,

 

Anyone found a solution for this? Thnaks.

Share this post


Link to post
Share on other sites

Hi,

 

Anyone found a solution for this? Thnaks.

 

 

osC 2.3.1...

 

works for me


My store is currently running Phoenix 1.0.3.0

I'm currently working on 1.0.5.0 and hope to get it live before 1.0.6.0 arrives

I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary

Share this post


Link to post
Share on other sites

Still looking for a fix for this.

Surely it cant be that difficult.

I have the share to facebook working, but it does not add the prodcut image from that page,

facebook adds the (gives a choice) of the images in colunm right and colnum left and footer, but not the product_info.

 

Any help would be great

Piperman

Share this post


Link to post
Share on other sites

<link rel="image_src" href="<?php echo tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) ?>" >

 

I think the problem lies in $product_info['products_image'] is not defined yet in the head section of the page. Later in the page the sql is asserted to define it. the question is How to get $product_info['products_image'] defined in the header section?

 

Any Ideas on how to get this done. I have other $product_info things working in the head section.

 

Anyone solved the problem how to use $product_info['products_image'] in header section?

Please help me with this.

Share this post


Link to post
Share on other sites

I am also looking for a solution to this. If anyone is kind of enough to share a fix, it would be greatly appreciated.

Share this post


Link to post
Share on other sites

OK, I found a solution, but it will require you to be running the STS contribution.

 

1. Put this in includes/modules/sts_inc/product_info.php:

 

$sts->template['image_src'] = '<link rel="image_src" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '">';

 

(make sure product_info.php has the appropriate $product_info query and that the above code is underneath it)

 

2. Put this in the <head> of includes/sts_templates/product_info.php.html:

 

$image_src$

 

The output of link rel should now have the product image and should display once Liked.

 

Confirmed working on oSC 2.2 rc2a.

Share this post


Link to post
Share on other sites

Try this in your head section:

 

<?

$product_pic_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

$product_pic = tep_db_fetch_array($product_pic_query);

 

if (tep_not_null($product_pic['products_image'])) {

$products_image = '<link rel="image_src" href="' . tep_href_link(DIR_WS_IMAGES . $product_pic['products_image']) . '">';

} else {

$products_image = '';

}

?>

Share this post


Link to post
Share on other sites

×