Skip to content

Commit 34b2b75

Browse files
Meta catalog Incremental product batch API sync calls bug fixed (#262)
* Incremental product sync calls bug fixed * access token added for delete after calls
1 parent e3088fe commit 34b2b75

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/code/Meta/Catalog/Observer/Product/DeleteAfter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ private function deleteProduct($storeId, $product): void
121121
'method' => 'DELETE',
122122
'data' => ['id' => $this->identifier->getMagentoProductRetailerId($product)],
123123
];
124-
124+
$this->graphApiAdapter->setDebugMode($this->systemConfig->isDebugMode($storeId))
125+
->setAccessToken($this->systemConfig->getAccessToken($storeId));
125126
$catalogId = $this->systemConfig->getCatalogId($storeId);
126127
$this->graphApiAdapter->catalogBatchRequest($catalogId, [$requestData]);
127128
} catch (GuzzleException $e) {

app/code/Meta/Catalog/Observer/Product/SaveAfter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ private function updateProduct($storeId, $productId): void
133133
return;
134134
}
135135

136-
// @todo implement error handling/logging for invalid access token and other non-happy path scenarios
137136
// @todo implement batch API status check
138137
// @todo implement async call
139-
138+
$this->graphApiAdapter->setDebugMode($this->systemConfig->isDebugMode($storeId))
139+
->setAccessToken($this->systemConfig->getAccessToken($storeId));
140140
$catalogId = $this->systemConfig->getCatalogId($storeId);
141141
$requestData = $this->batchApi->buildRequestForIndividualProduct($product);
142142
$this->graphApiAdapter->catalogBatchRequest($catalogId, [$requestData]);

0 commit comments

Comments
 (0)