I have a custom block for my customer/dashboard page, and while everything works, I cannot use the following:
public function getOrders(){
$collection = Mage::getResourceModel('sales/order_collection')
->addFieldToSelect('*')
->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
->setOrder('created_at', 'desc')
;
return $collection;
}
I get a blank page if I access this method. I want to load orders and display them on my dashboard. I took this query from the sales order Mage module.
Am I able to access resources from different modules?
Edit:
I limited it to return one order, but no dice.
$collection = Mage::getResourceModel('sales/order_collection')
->addFieldToSelect('*')
->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
->setOrder('created_at', 'desc')
->setPageSize(1)
->setCurPage(1);