Skip to content

Commit a6330ae

Browse files
Merge pull request #889 from sdinteractive/bugfix/ADO-211-meta-product-set-id
ADO-211: Reset Product Set Id for Magento Category
2 parents cc3e0c7 + be96d45 commit a6330ae

File tree

1 file changed

+15
-26
lines changed

1 file changed

+15
-26
lines changed

app/code/Meta/Catalog/Model/Category/CategoryCollection.php

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -315,34 +315,23 @@ private function pushCategoriesToFBCollections(
315315
if (!$isVisibleOnMeta && !$isAllCategoriesSyncEnabled) {
316316
continue;
317317
}
318-
319-
$setId = $category->getData(SystemConfig::META_PRODUCT_SET_ID);
318+
320319
$products = $this->categoryUtilities->getCategoryProducts($category, $storeId);
321-
if ($setId) {
322-
$requests[] = $this->updateCategoryWithFBRequestJson(
323-
$category,
324-
$products,
325-
$setId,
326-
$storeId,
327-
$isVisibleOnMeta
328-
);
329-
} else {
330-
if ($products->getSize() === 0) {
331-
$this->fbeHelper->log(sprintf(
332-
"Category update: Empty CATEGORY %s and store %s, product set creation skipped",
333-
$category->getName(),
334-
$storeId
335-
));
336-
continue;
337-
}
338-
$requests[] = $this->pushCategoryWithFBRequestJson(
339-
$category,
340-
$products,
341-
$catalogId,
342-
$storeId,
343-
$isVisibleOnMeta
344-
);
320+
if ($products->getSize() === 0) {
321+
$this->fbeHelper->log(sprintf(
322+
"Category update: Empty CATEGORY %s and store %s, product set creation skipped",
323+
$category->getName(),
324+
$storeId
325+
));
326+
continue;
345327
}
328+
$requests[] = $this->pushCategoryWithFBRequestJson(
329+
$category,
330+
$products,
331+
$catalogId,
332+
$storeId,
333+
$isVisibleOnMeta
334+
);
346335
$updatedCategories[] = $category;
347336
if (count($requests) === self::BATCH_MAX) {
348337
$batchResponse = $this->flushCategoryBatchRequest(

0 commit comments

Comments
 (0)