`
cgzhang
  • 浏览: 73433 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Use call back function to proccess Magento large collection

PHP 
阅读更多
$orders = Mage::getModel('sales/order')->getCollection();
Mage::getSingleton('core/resource_iterator')->walk($orders->getSelect(), array(array($this,'proccessOrder')));
public function proccessOrder($args)
	{
		$order = Mage::getModel('sales/order');
		$order->setData($args['row']);
		echo $order->getIncrementId() . '<br/>';
		echo $order->getGrandTotal()  . '<br />';
		$orderAmount = $orderAmount+$order->getGrandTotal();
		echo '----------------------<br/>';
		
	}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics