Skip to content

Commit

Permalink
Do not clear images first
Browse files Browse the repository at this point in the history
  • Loading branch information
firstred committed Apr 30, 2018
1 parent 6210808 commit 3b85c50
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions mailchimp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
[
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 3b85c50

Please sign in to comment.