Skip to content

Commit

Permalink
Add open graph
Browse files Browse the repository at this point in the history
  • Loading branch information
hamidpeywasti committed Sep 11, 2017
1 parent 043cdb9 commit 366f179
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions library/Respinar/Products/Frontend/Module/ModuleProductDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ protected function compile()

$this->Template->product = $arrProduct;

if ($objProduct->singleSRC != '')
{
$objModel = \FilesModel::findByUuid($objProduct->singleSRC);
}

$ogTagsURL = self::replaceInsertTags('{{env::path}}{{env::request}}');

$GLOBALS['TL_HEAD'][] = '<meta property="og:type" content="product" />';
$GLOBALS['TL_HEAD'][] = '<meta property="og:title" content="'.$objProduct->title.'" />';
$GLOBALS['TL_HEAD'][] = '<meta property="og:url" content="'.$ogTagsURL.'" />';
$GLOBALS['TL_HEAD'][] = '<meta property="og:image" content="'.$objModel->path.'" />';

$objProduct->related = deserialize($objProduct->related);

Expand Down

0 comments on commit 366f179

Please sign in to comment.