Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract Class Reference

Inheritance diagram for 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 Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Compared Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Pcompared Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Pviewed Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Reorder Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Viewed Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Wishlist

List of all members.

Public Member Functions

 getSidebarStorageAction ()
 canDisplay ()
 canDisplayItemQty ()
 canRemoveItems ()
 getIdentifierId ($item)
 getItemId ($item)
 getItemCount ()
 getItems ()
 getItemCollection ()
 canDisplayPrice ()

Protected Attributes

 $_sidebarStorageAction = 'add'


Detailed Description

Definition at line 34 of file Abstract.php.


Member Function Documentation

canDisplay (  ) 

Retrieve display block availability

Returns:
bool

Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Viewed.

Definition at line 53 of file Abstract.php.

00054     {
00055         return $this->getCustomerId();
00056     }

canDisplayItemQty (  ) 

Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart, and Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Reorder.

Definition at line 58 of file Abstract.php.

00059     {
00060         return false;
00061     }

canDisplayPrice (  ) 

Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Reorder.

Definition at line 157 of file Abstract.php.

00158     {
00159         return true;
00160     }

canRemoveItems (  ) 

getIdentifierId ( item  ) 

Retrieve identifier of block item

Parameters:
Varien_Object $item
Returns:
int

Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart, Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Pcompared, Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Pviewed, and Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Reorder.

Definition at line 79 of file Abstract.php.

00080     {
00081         return $item->getProductId();
00082     }

getItemCollection (  ) 

getItemCount (  ) 

Retreive item count

Returns:
int

Definition at line 100 of file Abstract.php.

00101     {
00102         $count = $this->getData('item_count');
00103         if (is_null($count)) {
00104             $count = count($this->getItems());
00105             $this->setData('item_count', $count);
00106         }
00107         return $count;
00108     }

getItemId ( item  ) 

Retrieve item identifier of block item

Parameters:
mixed $item
Returns:
int

Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Compared, and Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Wishlist.

Definition at line 90 of file Abstract.php.

00091     {
00092         return $item->getId();
00093     }

getItems (  ) 

Retrieve all items

Returns:
array

Definition at line 115 of file Abstract.php.

00116     {
00117         if ($collection = $this->getItemCollection()) {
00118             $productTypes = Mage::getConfig()->getNode('adminhtml/sales/order/create/available_product_types')->asArray();
00119             $productTypes = array_keys($productTypes);
00120             if (is_array($collection)) {
00121                 $items = $collection;
00122             } else {
00123                 $items = $collection->getItems();
00124             }
00125             /*
00126              * filtering items by product type
00127              */
00128             foreach($items as $key=>$item) {
00129                 if ($item instanceof Mage_Catalog_Model_Product) {
00130                     $type = $item->getTypeId();
00131                 } else if ($item instanceof Mage_Sales_Model_Order_Item) {
00132                     $type = $item->getProductType();
00133                 } else if ($item instanceof Mage_Sales_Model_Quote_Item) {
00134                     $type = $item->getProductType();
00135                 } else {
00136                     $type = '';
00137                 }
00138                 if (!in_array($type, $productTypes)) {
00139                     unset($items[$key]);
00140                 }
00141             }
00142             return $items;
00143         }
00144         return array();
00145     }

getSidebarStorageAction (  ) 

Return name of sidebar storage action

Returns:
string

Definition at line 43 of file Abstract.php.

00044     {
00045         return $this->_sidebarStorageAction;
00046     }


Member Data Documentation

$_sidebarStorageAction = 'add' [protected]


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