- Posts: 195
- Thank you received: 18
How to edit Open Graph Title and Description
3 years 7 months ago #349366
by Sandra74
How to edit Open Graph Title and Description was created by Sandra74
-- url of the page with the problem -- :
rolex.jewelrygoldfinger.com/fr/collectio...-ii/m126710blnr-0003
-- HikaShop version -- : 4.7.1
-- Joomla version -- : 4.2.8
-- PHP version -- : 8.1.14
Hi,
Currrently, the Open Graph Title is generated from the name of the product and the Open Graph Description from the description of the product.
I would like the Open Graph Title to be the 'Page Title' of the Product and the Open Graph Description to be the 'Meta Description' of the product.
I presume I need to edit these lines:
'<meta property="og:title" content="'.htmlspecialchars($element->name, ENT_COMPAT,'UTF-8').'"/> '
and
$description = $this->_cleanDescription($element->description);
$this->meta = '<meta property="og:description" content="'.$description.'"/> ';
But I have no clue what to do.
Would it be possible to help me?
Thanks in advance!
Sandra
-- HikaShop version -- : 4.7.1
-- Joomla version -- : 4.2.8
-- PHP version -- : 8.1.14
Hi,
Currrently, the Open Graph Title is generated from the name of the product and the Open Graph Description from the description of the product.
I would like the Open Graph Title to be the 'Page Title' of the Product and the Open Graph Description to be the 'Meta Description' of the product.
I presume I need to edit these lines:
'<meta property="og:title" content="'.htmlspecialchars($element->name, ENT_COMPAT,'UTF-8').'"/> '
and
$description = $this->_cleanDescription($element->description);
$this->meta = '<meta property="og:description" content="'.$description.'"/> ';
But I have no clue what to do.
Would it be possible to help me?
Thanks in advance!
Sandra
Please Log in or Create an account to join the conversation.
3 years 7 months ago #349369
by nicolas
Replied by nicolas on topic How to edit Open Graph Title and Description
Hi,
You would have the change the lines:
to:
in the file plugins/system/hikashopsocial/hikashopsocial.php
You would have the change the lines:
Code:
$ret->name = $element->product_name;
$ret->description = $element->product_description;
Code:
$ret->name = $element->product_page_title;
$ret->description = $element->product_meta_description;
Please Log in or Create an account to join the conversation.
3 years 7 months ago #349373
by Sandra74
Replied by Sandra74 on topic How to edit Open Graph Title and Description
Thnaks a lot for your help Nicolas.
Wish you a great weekend.
Sandra
Wish you a great weekend.
Sandra
The following user(s) said Thank You: Philip
Please Log in or Create an account to join the conversation.
Time to create page: 0.159 seconds