Mage_Sales_Block_Reorder_Sidebar Class Reference

Inheritance diagram for Mage_Sales_Block_Reorder_Sidebar:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getLastOrder ()

Protected Member Functions

 _toHtml ()


Detailed Description

Definition at line 34 of file Sidebar.php.


Constructor & Destructor Documentation

__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     }


Member Function Documentation

_toHtml (  )  [protected]

Render block HTML

Returns:
string

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     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:40 2009 for Magento by  doxygen 1.5.8