@@ -682,9 +682,6 @@ protected function _getEntityCollection($resetCollection = false)
682
682
{
683
683
if ($ resetCollection || empty ($ this ->_entityCollection )) {
684
684
$ this ->_entityCollection = $ this ->_entityCollectionFactory ->create ();
685
- $ this ->_entityCollection ->setOrder ('has_options ' , 'asc ' );
686
- $ this ->_entityCollection ->setStoreId (Store::DEFAULT_STORE_ID );
687
-
688
685
}
689
686
return $ this ->_entityCollection ;
690
687
}
@@ -757,9 +754,12 @@ public function export()
757
754
$ page = 0 ;
758
755
while (true ) {
759
756
++$ 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 );
761
761
$ this ->paginateCollection ($ page , $ this ->getItemsPerPage ());
762
- if ($ this -> _getEntityCollection () ->count () == 0 ) {
762
+ if ($ entityCollection ->count () == 0 ) {
763
763
break ;
764
764
}
765
765
$ exportData = $ this ->getExportData ();
@@ -769,7 +769,7 @@ public function export()
769
769
foreach ($ exportData as $ dataRow ) {
770
770
$ writer ->writeRow ($ dataRow );
771
771
}
772
- if ($ this -> _getEntityCollection ()-> getCurPage () >= $ this -> _getEntityCollection () ->getLastPageNumber ()) {
772
+ if ($ entityCollection -> getCurPage () >= $ entityCollection ->getLastPageNumber ()) {
773
773
break ;
774
774
}
775
775
}
0 commit comments