Open Graph Plugin 2.0.2 CustomTag adding problem

22.04.2023 06:50
#1
vega55
Joomshopping forum user no avatar
Name: Vega Arda
07.12.2022
Posts: 31
Quote
Open Graph Plugin 2.0.2 CustomTag adding problem

Hello
The following example is valid for generating links related to open graph and most plugins generate links in this way.

<meta property="og:title" content="How to Become an SEO Expert (8 Steps)" />
<meta property="og:description" content="Get from SEO newbie to SEO pro in 8 simple steps." />
<meta property="og:image" content="https://ahrefs.com/blog/wp-content/uploads/2019/12/fb-how-to-become-an-seo-expert.png" />

but I installed the joomshopping plugin, it produces links as follows

<meta property="og:title" content="How to Become an SEO Expert (8 Steps)">
<meta property="og:description" content="Get from SEO newbie to SEO pro in 8 simple steps.">
<meta property="og:image" content="https://ahrefs.com/blog/wp-content/uploads/2019/12/fb-how-to-become-an-seo-expert.png /">

it doesn't add the content end " />
For example, the end of the url ends like this /" >
content ends like this " >

i think there seems to be a problem adding CustomTag i am using latest version Open graph 2.0.2

//product
function onBeforeDisplayProductView(&$view) {
$link = \JURI::getInstance();
$lang = \JSFactory::getLang();
$doc = \JFactory::getDocument();
$jshopConfig = \JFactory::getConfig();

$locale = $lang->lang;
$type = 'product';
$url = $link->getScheme() ."://" . $link->getHost() . $link->getPath()."/". $link->getQuery();
$image = $link->getScheme() ."://" . $link->getHost()."/components/com_jshopping/files/img_products/".$view->product->image;
$site_name = $jshopConfig->get( 'sitename' );

$doc->addCustomTag( '<meta property="og:locale" content="'.$locale.'" />' );
$doc->addCustomTag( '<meta property="og:title" content="'.$view->product->name.'" />' );
$doc->addCustomTag( '<meta property="og:type" content="'.$type.'" />' );
$doc->addCustomTag( '<meta property="og:url" content="'.$url.'"/>' );
$doc->addCustomTag( '<meta property="og:image" content="'.$image.'" />' );
$doc->addCustomTag( '<meta property="og:site_name" content="'.$site_name.'" />' );
}


Joomla: 4.3.0
JoomShopping: 5.1.3
PHP: 7.4
 
22.04.2023 08:52
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25964
Quote
Aw: Open Graph Plugin 2.0.2 CustomTag adding problem

it's not obligatory.

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.