Skip to content

Commit

Permalink
Merge pull request #61 from breakone/master
Browse files Browse the repository at this point in the history
Fix og:image URL for CoreShop third party og tag
  • Loading branch information
solverat committed Feb 9, 2024
2 parents 6721eb0 + b9315fc commit 4892d67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MetaData/Extractor/ThirdParty/CoreShop/OGExtractor.php
Expand Up @@ -32,7 +32,8 @@ public function updateMetadata(mixed $element, ?string $locale, SeoMetaDataInter
}

if (method_exists($element, 'getImage') && !empty($element->getImage())) {
$ogImage = Tool::getHostUrl() . $element->getImage()->getThumbnail('coreshop_seo');
$path = $element->getImage()->getThumbnail('coreshop_seo');
$ogImage = (str_starts_with('http', $path) ? '' : Tool::getHostUrl()).$path;
$seoMetadata->addExtraProperty('og:image', $ogImage);
}
}
Expand Down

0 comments on commit 4892d67

Please sign in to comment.