Skip to content

Commit

Permalink
fix: variant disabled must not appear in rich snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
cbastienbaron authored and JulienLoison committed Aug 2, 2024
1 parent bcd93ec commit 2d5093c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Factory/ProductRichSnippetFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ protected function getOffers(RichSnippetSubjectInterface $subject): array
$currencyCode = $this->currencyContext->getCurrencyCode();

return array_map(function (ProductVariantInterface $variant) use ($channel, $url, $currencyCode) {
if (!$variant->isEnabled()) {
return;
}

$price = $this->priceHelper->getPrice(
$variant,
['channel' => $channel],
Expand Down

0 comments on commit 2d5093c

Please sign in to comment.