Fix shopware importer for shopware 6.6

This commit is contained in:
Andreas Palm 2024-07-05 21:34:01 +02:00
parent e94894bad6
commit cd2a163174

View File

@ -1430,14 +1430,16 @@ class Shopimporter_Shopware6 extends ShopimporterBase
continue;
}
$mediaData = $this->shopwareRequest('POST', 'media?_response=true', []);
$mediaData = $this->shopwareRequest('POST', 'media?_response=true', [
'title' => $imageTitle,
'alt' => $imageAltText
]);
if(empty($mediaData['data']['id'])){
$this->Shopware6Log('Error when creating media for sku: ' . $internalArticleData['nummer'],
['mediaData' => $mediaData, 'title' => $imageTitle, 'text' => $imageAltText]);
continue;
}
$mediaId = $mediaData['data']['id'];
$this->setMediaTitleAndAltText($mediaId, $imageTitle, $imageAltText);
$mediaAssociationData = [
[