Public Member Functions | |
__construct () | |
getLastOrder () | |
Protected Member Functions | |
_toHtml () |
Definition at line 34 of file Sidebar.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 37 of file Sidebar.php.
00038 { 00039 parent::__construct(); 00040 00041 if (Mage::getSingleton('customer/session')->isLoggedIn()) { 00042 $this->setTemplate('sales/order/history.phtml'); 00043 00044 $orders = Mage::getResourceModel('sales/order_collection') 00045 ->addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId()) 00046 ->addAttributeToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates())) 00047 ->addAttributeToSort('created_at', 'desc') 00048 ->setPage(1,1); 00049 //TODO: add filter by current website 00050 00051 $this->setOrders($orders); 00052 00053 } 00054 }
_toHtml | ( | ) | [protected] |
Render block HTML
Reimplemented from Mage_Core_Block_Template.
Definition at line 64 of file Sidebar.php.
00065 { 00066 if (Mage::helper('sales/reorder')->isAllow() && Mage::getSingleton('customer/session')->isLoggedIn()) { 00067 return parent::_toHtml(); 00068 } 00069 return ''; 00070 }
getLastOrder | ( | ) |
Definition at line 56 of file Sidebar.php.
00057 { 00058 foreach ($this->getOrders() as $order) { 00059 return $order; 00060 } 00061 return false; 00062 }