Skip to content

Instantly share code, notes, and snippets.

@bluvertigo
Created March 9, 2018 13:41
Show Gist options
  • Save bluvertigo/155197a3e4d0b19f5aafe7d578d57941 to your computer and use it in GitHub Desktop.
Save bluvertigo/155197a3e4d0b19f5aafe7d578d57941 to your computer and use it in GitHub Desktop.
<?php
public function create()
{
$productCollection = $this->_getProductCollection();
$pages = $productCollection->getLastPageNumber();
$pageNumber = 1;
do {
$productCollection->setCurPage($pageNumber);
$productCollection->load();
foreach ($productCollection as $product) {
// Process product information and write it to file....
}
$pageNumber++;
$productCollection->clear();
$productCollection = $this->_getProductCollection();
} while ($pageNumber <= $pages);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment