Skip to content
Code-Schnipsel Gruppen Projekte
Commit 8d9d04d0 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix: json ld fix -> #221

Übergeordneter d344ad66
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -141,17 +141,25 @@ protected static function getImages(ProductInterface $Product)
$Image = $Product->getImage();
if ($Image) {
$images[] = $Image->getSizeCacheUrl();
$url = $Image->getSizeCacheUrl();
if (!empty($url)) {
$images[] = $url;
}
}
} catch (QUI\Exception $Exception) {
// nothing
}
$images = $Product->getImages();
$productImages = $Product->getImages();
foreach ($images as $Image) {
foreach ($productImages as $Image) {
try {
$images[] = $Image->getSizeCacheUrl();
$url = $Image->getSizeCacheUrl();
if (!empty($url)) {
$images[] = $url;
}
} catch (QUI\Exception $Exception) {
// nothing
}
......@@ -198,6 +206,8 @@ protected static function getOffer(ProductInterface $Product, $Locale = null)
// variant parent
if (!($Product instanceof VariantParent)) {
$offers['lowPrice'] = $offers['price'];
return [
'offers' => $offers
];
......@@ -220,9 +230,10 @@ protected static function getOffer(ProductInterface $Product, $Locale = null)
if (isset($prices['highPrice']) || isset($prices['lowPrice'])) {
unset($offers['price']);
} elseif (!isset($prices['lowPrice'])) {
$offers['lowPrice'] = $offers['price'];
}
// list variants
$count = 0;
$models = [];
......@@ -271,8 +282,6 @@ protected static function getMaxMin(
if ($MinPrice && $MinPrice->getValue()) {
$offers['lowPrice'] = $Formatter->format($MinPrice->getValue());
} else {
$offers['lowPrice'] = $Formatter->format($Product->getPrice()->getValue());
}
if ($MaxPrice && $MaxPrice->getValue()) {
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren