Social Plugin Facebook Share Desription

  • Posts: 13
  • Thank you received: 0
9 years 6 months ago #198988

-- Joomla version -- : 2.5
-- PHP version -- : 5
-- Browser(s) name and version -- : Trust Deal

Hi,

is it possible to change the Facebook Share Description, it retrives the product description, iwould like it to retrive the Meta Description in the Product.

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
9 years 6 months ago #198989

Hi,

It requires to modify the plugin itself ; so it is possible but it's not recommended if you want to update HikaShop afterwards (because you will lost your modification with the update).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
9 years 6 months ago #199309

I Have no plan to update, so can you tell me where i can do the changes in the plugin please.

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #199311

Hi,

So you have to edit the file "plugins/system/hikashopsocial/hikashopsocial.php" in the function "_addFacebookButton()" replace:

$this->meta['property="og:description"'] = '<meta property="og:description" content="'.htmlspecialchars(strip_tags($element->description), ENT_COMPAT,'UTF-8').'"/> ';
By:
$this->meta['property="og:description"'] = '<meta property="og:description" content="'.htmlspecialchars(strip_tags($element->product_meta_description), ENT_COMPAT,'UTF-8').'"/> ';

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
9 years 6 months ago #199413

Hi,
Thank you for the info.
i did what written before but no luck, everytime i press the share button it keeps retrieving the product description.

thank you

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
9 years 6 months ago #199414

i have attached the file so you can see if i have done it correctly.

thank you

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #199427

Hi,

My bad, wrong modification, please revert back the code to:

$this->meta['property="og:description"'] = '<meta property="og:description" content="'.htmlspecialchars(strip_tags($element->description), ENT_COMPAT,'UTF-8').'"/> ';
And then in the function "_getElementInfo()" replace:
$ret->description = $element->product_description;
By:
$ret->description = $element->product_meta_description;

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
9 years 6 months ago #199561

Hi,

i have done the changes and i cannot see the Meta description.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #199569

Hi,

The previous code must work, but as I remember Facebook has a kind of cache, so the changes may take time to appear correctly. I will have a deeper look at the Facebook API.

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
9 years 6 months ago #200248

Hi,

the changes still haven't been done.

thank you

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #200284

Hi,

So if the changes has no effect, please try to disable the plugin and see if you still have the meta tag in the page content.
If it is, so it come from another plugin/component, that don't come from HikaShop.

Please Log in or Create an account to join the conversation.

  • Posts: 13
  • Thank you received: 0
9 years 6 months ago #200354

Hi,

I did what you written but no luck, I noticed in the plugin there are 2 hikashop social network plug, I enabled the system but nothing happens, I disable the content plugin and the social network goes away. I have attached an image so you can see.

thank you

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #200360

Hi,

Please disable the content plugin, and enable the system one with the indicated code changes.

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum