diff --git a/mailchimp.php b/mailchimp.php index 0c1b0f6..6e28bba 100644 --- a/mailchimp.php +++ b/mailchimp.php @@ -2694,13 +2694,6 @@ protected function exportProducts($offset, $idShops = null, $remaining = false) ] ); } else { - // Clear the path first, remove old variants and images - if (!empty($images)) { - $payload['images'] = array_values($images); - foreach ($images as $image) { - yield $client->deleteAsync("ecommerce/stores/tbstore_{$idShop}/products/{$product['id_product']}/images/{$image['id']}"); - } - } yield $client->postAsync( "ecommerce/stores/tbstore_{$idShop}/products", [ @@ -2744,14 +2737,6 @@ protected function exportProducts($offset, $idShops = null, $remaining = false) && json_decode((string) $reason->getResponse()->getBody())->title === 'Resource Not Found' ) { try { - // Clear the path first, remove old images and variants - $product = new Product($idProduct); - $images = $product->getImages($this->context->language->id); - if (!empty($images)) { - foreach ($images as $image) { - yield $client->deleteAsync("ecommerce/stores/tbstore_{$m['id_shop']}/products/{$idProduct}/images/{$image['id_image']}"); - } - } $client->post("ecommerce/stores/tbstore_{$m['id_shop']}/products", [ 'body' => (string) $reason->getRequest()->getBody(),