Public Member Functions | |
__construct () | |
getHeaderText () | |
getLastOrder () | |
getItemCollection () | |
canDisplayItemQty () | |
canRemoveItems () | |
canDisplayPrice () | |
getIdentifierId ($item) | |
Protected Attributes | |
$_sidebarStorageAction = 'reorder' |
Definition at line 34 of file Reorder.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 39 of file Reorder.php.
00040 { 00041 parent::__construct(); 00042 $this->setId('sales_order_create_sidebar_reorder'); 00043 $this->setDataId('reorder'); 00044 }
canDisplayItemQty | ( | ) |
Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.
Definition at line 92 of file Reorder.php.
canDisplayPrice | ( | ) |
Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.
Definition at line 102 of file Reorder.php.
canRemoveItems | ( | ) |
Retrieve availability removing items in block
Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.
Definition at line 97 of file Reorder.php.
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
Varien_Object | $item |
Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.
Definition at line 113 of file Reorder.php.
getItemCollection | ( | ) |
Retrieve item collection
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
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 }
$_sidebarStorageAction = 'reorder' [protected] |
Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.
Definition at line 37 of file Reorder.php.