Skip to content

Commit

Permalink
nullify the bathcid #1945 for magento 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz committed Apr 3, 2024
1 parent fbc04c9 commit f1d8d2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Helper/Sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public function saveEcommerceData(
$modified = null,
$deleted = null,
$token = null,
$sent = null
$sent = null,
$nullifyBatchId = false
) {
if (!empty($entityId)) {
$chimpSyncEcommerce = $this->getChimpSyncEcommerce($storeId, $entityId, $type);
Expand Down Expand Up @@ -89,6 +90,9 @@ public function saveEcommerceData(
if ($sent) {
$chimpSyncEcommerce->setMailchimpSent($sent);
}
if ($nullifyBatchId) {
$chimpSyncEcommerce->setBatchId(null);
}
$chimpSyncEcommerce->getResource()->save($chimpSyncEcommerce);
}
}
Expand Down
8 changes: 5 additions & 3 deletions Model/Api/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ protected function processDeletedProducts($magentoStoreId, $mailchimpStoreId)
$data['operation_id'] = $this->_batchId . '_' . $productId;
$data['body'] = $body;
$deletedData [] = $data;
$this->_updateProduct($mailchimpStoreId, $productId);
$this->_updateProduct($mailchimpStoreId, $productId,null, null, null, true);
}
}
return $deletedData;
Expand Down Expand Up @@ -703,7 +703,8 @@ protected function _updateProduct(
$entityId,
$sync_delta = null,
$sync_error = null,
$sync_modified = null
$sync_modified = null,
$nullifyBatchId = false
) {
$this->syncHelper->saveEcommerceData(
$storeId,
Expand All @@ -714,7 +715,8 @@ protected function _updateProduct(
$sync_modified,
null,
null,
\Ebizmarts\MailChimp\Helper\Data::WAITINGSYNC
\Ebizmarts\MailChimp\Helper\Data::WAITINGSYNC,
$nullifyBatchId
);
}
}

0 comments on commit f1d8d2e

Please sign in to comment.