Skip to content

Commit bcffd63

Browse files
author
Denys Rudchenko
committed
MAGETWO-37726: Incorrect export result on medium profile
1 parent 99c09fb commit bcffd63

File tree

1 file changed

+6
-6
lines changed
  • app/code/Magento/CatalogImportExport/Model/Export

1 file changed

+6
-6
lines changed

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,6 @@ protected function _getEntityCollection($resetCollection = false)
682682
{
683683
if ($resetCollection || empty($this->_entityCollection)) {
684684
$this->_entityCollection = $this->_entityCollectionFactory->create();
685-
$this->_entityCollection->setOrder('has_options', 'asc');
686-
$this->_entityCollection->setStoreId(Store::DEFAULT_STORE_ID);
687-
688685
}
689686
return $this->_entityCollection;
690687
}
@@ -757,9 +754,12 @@ public function export()
757754
$page = 0;
758755
while (true) {
759756
++$page;
760-
$this->_prepareEntityCollection($this->_getEntityCollection(true));
757+
$entityCollection = $this->_getEntityCollection(true);
758+
$entityCollection->setOrder('has_options', 'asc');
759+
$entityCollection->setStoreId(Store::DEFAULT_STORE_ID);
760+
$this->_prepareEntityCollection($entityCollection);
761761
$this->paginateCollection($page, $this->getItemsPerPage());
762-
if ($this->_getEntityCollection()->count() == 0) {
762+
if ($entityCollection->count() == 0) {
763763
break;
764764
}
765765
$exportData = $this->getExportData();
@@ -769,7 +769,7 @@ public function export()
769769
foreach ($exportData as $dataRow) {
770770
$writer->writeRow($dataRow);
771771
}
772-
if ($this->_getEntityCollection()->getCurPage() >= $this->_getEntityCollection()->getLastPageNumber()) {
772+
if ($entityCollection->getCurPage() >= $entityCollection->getLastPageNumber()) {
773773
break;
774774
}
775775
}

0 commit comments

Comments
 (0)