Jump to content

I need to upgrade the module socialbookmarksforproducts.


Recommended Posts

  • 2 weeks later...
  • 2 weeks later...

add this code in header of your theme, in the metas

 

 

<meta property="og:image" content="{$fl_default_image}" />

<link rel="image_src" href="{$fl_default_image}" />

 

and in your module, in the php file, in the hookHeader section add this code

 

 

$fb_cover = '';

$protocol_link = @$_SERVER['HTTPS'] == "on"?"https://":"http://";

$cover = Product::getCover(intval(Tools::getValue('id_product')));

if (is_array($cover) && sizeof($cover) == 1)

{

$product = new Product((int)Tools::getValue('id_product'));

if (floatval(substr(_PS_VERSION_,0,3)) >= 1.4)

$fb_cover = $link->getImageLink($product->link_rewrite[$cookie->id_lang], Tools::getValue('id_product').'-'.$cover['id_image'],'thickbox');

else

$fb_cover = 'http://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'img/p/'.Tools::getValue('id_product').'-'.$cover['id_image'].'.jpg';

}

$smarty->assign(array('fl_protocol_link' => $protocol_link, 'fl_lang_code' => $lang, 'fl_default_image' => $fb_cover));

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...