diff --git a/Model/Write/Products.php b/Model/Write/Products.php index c71644e..7025d75 100644 --- a/Model/Write/Products.php +++ b/Model/Write/Products.php @@ -136,8 +136,9 @@ public function exportStore(Writer $writer, XMLWriter $xml, Store $store, array foreach ($this->iterator as $index => $data) { $this->writeProduct($xml, $store->getId(), $data); // Flush every so often - if ($index % 100 === 0) { + if ($index % 2 === 0) { $writer->flush(); + break; } } diff --git a/Model/Write/Products/CollectionDecorator/StockData/SourceItemMapProvider.php b/Model/Write/Products/CollectionDecorator/StockData/SourceItemMapProvider.php index 6c91ad6..758fbdf 100644 --- a/Model/Write/Products/CollectionDecorator/StockData/SourceItemMapProvider.php +++ b/Model/Write/Products/CollectionDecorator/StockData/SourceItemMapProvider.php @@ -111,7 +111,7 @@ public function getStockItemMap(Collection|StockCollection $collection): array return []; } - $skus = $collection->getAllSkus(); + $entityIds = $collection->getAllIds(); $store = $collection->getStore(); $sourceCodes = $this->getSourceCodesForStore($store); @@ -207,7 +207,7 @@ public function getStockItemMap(Collection|StockCollection $collection): array 'backorders', ] ) - ->where("$productTableName.sku IN (?)", $skus) + ->where("$productTableName.entity_id IN (?)", $entityIds) ->columns( [ 'product_entity_id' => "$productTableName.entity_id", diff --git a/Model/Write/Writer.php b/Model/Write/Writer.php index e5203d3..96a4d66 100644 --- a/Model/Write/Writer.php +++ b/Model/Write/Writer.php @@ -257,6 +257,7 @@ protected function determineWriters($type = null) : void if ($type === null) { unset ($this->writers['stock']); unset($this->writers['price']); + unset($this->writers['categories']); } else { foreach ($this->writers as $key => $value) { if($type !== $key) {