Advertisement
johncarlson21

Untitled

Oct 30th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. <?php
  2.  
  3. $collection = Mage::getModel('sales/order')->getCollection();
  4. $collection->addFieldToFilter(
  5.      'updated_at',
  6.      array('from' => $dateStart, 'to' => $dateEnd)
  7. );
  8. $collection->addFieldToFilter(
  9.         'status',
  10.         'complete'
  11. );
  12.  
  13. foreach ($collection as $order) {
  14.     $items = $order->getAllItems();
  15.     foreach ($items as $itemId => $item) {
  16.         $cats = $item->getCategoryIds();
  17.     }
  18. }
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement