Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Reorder Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Reorder:

Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract Mage_Adminhtml_Block_Sales_Order_Create_Abstract Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getHeaderText ()
 getLastOrder ()
 getItemCollection ()
 canDisplayItemQty ()
 canRemoveItems ()
 canDisplayPrice ()
 getIdentifierId ($item)

Protected Attributes

 $_sidebarStorageAction = 'reorder'


Detailed Description

Definition at line 34 of file Reorder.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 39 of file Reorder.php.

00040     {
00041         parent::__construct();
00042         $this->setId('sales_order_create_sidebar_reorder');
00043         $this->setDataId('reorder');
00044     }


Member Function Documentation

canDisplayItemQty (  ) 

Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.

Definition at line 92 of file Reorder.php.

00093     {
00094         return false;
00095     }

canDisplayPrice (  ) 

Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.

Definition at line 102 of file Reorder.php.

00103     {
00104         return false;
00105     }

canRemoveItems (  ) 

Retrieve availability removing items in block

Returns:
bool

Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.

Definition at line 97 of file Reorder.php.

00098     {
00099         return false;
00100     }

getHeaderText (  ) 

Definition at line 47 of file Reorder.php.

00048     {
00049         return Mage::helper('sales')->__('Last ordered items');
00050     }

getIdentifierId ( item  ) 

Retrieve identifier of block item

Parameters:
Varien_Object $item
Returns:
int

Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.

Definition at line 113 of file Reorder.php.

00114     {
00115         return $item->getId();
00116     }

getItemCollection (  ) 

Retrieve item collection

Returns:
mixed

Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.

Definition at line 78 of file Reorder.php.

00079     {
00080         if ($order = $this->getLastOrder()) {
00081             $items = array();
00082             foreach ($order->getItemsCollection() as $item) {
00083                 if (!$item->getParentItem()) {
00084                     $items[] = $item;
00085                 }
00086             }
00087             return $items;
00088         }
00089         return false;
00090     }

getLastOrder (  ) 

Retrieve last order on current website

Returns:
Mage_Sales_Model_Order|false

Definition at line 57 of file Reorder.php.

00058     {
00059         $storeIds = $this->getQuote()->getStore()->getWebsite()->getStoreIds();
00060         $collection = Mage::getResourceModel('sales/order_collection')
00061             ->addAttributeToSelect('*')
00062             ->addAttributeToFilter('customer_id', $this->getCustomerId())
00063             ->addAttributeToFilter('store_id', array('in' => $storeIds))
00064             ->addAttributeToSort('created_at', 'desc')
00065             ->setPage(1, 1)
00066             ->load();
00067         foreach ($collection as $order) {
00068             return $order;
00069         }
00070 
00071         return false;
00072     }


Member Data Documentation

$_sidebarStorageAction = 'reorder' [protected]

Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.

Definition at line 37 of file Reorder.php.


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

Generated on Sat Jul 4 17:23:00 2009 for Magento by  doxygen 1.5.8