Mage_Bundle_Block_Adminhtml_Sales_Order_View_Items_Renderer Class Reference

Inheritance diagram for Mage_Bundle_Block_Adminhtml_Sales_Order_View_Items_Renderer:

Mage_Adminhtml_Block_Sales_Order_View_Items_Renderer_Default Mage_Adminhtml_Block_Sales_Items_Abstract Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 isShipmentSeparately ($item=null)
 isChildCalculated ($item=null)
 getSelectionAttributes ($item)
 getOrderOptions ()
 getValueHtml ($item)
 canShowPriceInfo ($item)


Detailed Description

Definition at line 35 of file Renderer.php.


Member Function Documentation

canShowPriceInfo ( item  ) 

Definition at line 143 of file Renderer.php.

00144     {
00145         if (($item->getParentItem() && $this->isChildCalculated())
00146                 || (!$item->getParentItem() && !$this->isChildCalculated())) {
00147             return true;
00148         }
00149         return false;
00150     }

getOrderOptions (  ) 

Definition at line 110 of file Renderer.php.

00111     {
00112         $result = array();
00113         if ($options = $this->getItem()->getProductOptions()) {
00114             if (isset($options['options'])) {
00115                 $result = array_merge($result, $options['options']);
00116             }
00117             if (isset($options['additional_options'])) {
00118                 $result = array_merge($result, $options['additional_options']);
00119             }
00120             if (!empty($options['attributes_info'])) {
00121                 $result = array_merge($options['attributes_info'], $result);
00122             }
00123         }
00124         return $result;
00125     }

getSelectionAttributes ( item  ) 

Definition at line 98 of file Renderer.php.

00098                                                   {
00099         if ($item instanceof Mage_Sales_Model_Order_Item) {
00100             $options = $item->getProductOptions();
00101         } else {
00102             $options = $item->getOrderItem()->getProductOptions();
00103         }
00104         if (isset($options['bundle_selection_attributes'])) {
00105             return unserialize($options['bundle_selection_attributes']);
00106         }
00107         return null;
00108     }

getValueHtml ( item  ) 

Definition at line 127 of file Renderer.php.

00128     {
00129         $result = $this->htmlEscape($item->getName());
00130         if (!$this->isShipmentSeparately($item)) {
00131             if ($attributes = $this->getSelectionAttributes($item)) {
00132                 $result =  sprintf('%d', $attributes['qty']) . ' x ' . $result;
00133             }
00134         }
00135         if (!$this->isChildCalculated($item)) {
00136             if ($attributes = $this->getSelectionAttributes($item)) {
00137                 $result .= " " . $this->getItem()->getOrder()->formatPrice($attributes['price']);
00138             }
00139         }
00140         return $result;
00141     }

isChildCalculated ( item = null  ) 

Definition at line 67 of file Renderer.php.

00068     {
00069         if ($item) {
00070             if ($parentItem = $item->getParentItem()) {
00071                 if ($options = $parentItem->getProductOptions()) {
00072                     if (isset($options['product_calculations']) && $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD) {
00073                         return true;
00074                     } else {
00075                         return false;
00076                     }
00077                 }
00078             } else {
00079                 if ($options = $item->getProductOptions()) {
00080                     if (isset($options['product_calculations']) && $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD) {
00081                         return false;
00082                     } else {
00083                         return true;
00084                     }
00085                 }
00086             }
00087         }
00088 
00089         if ($options = $this->getItem()->getProductOptions()) {
00090             if (isset($options['product_calculations'])
00091                 && $options['product_calculations'] == Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_CHILD) {
00092                 return true;
00093             }
00094         }
00095         return false;
00096     }

isShipmentSeparately ( item = null  ) 

Definition at line 37 of file Renderer.php.

00038     {
00039         if ($item) {
00040             if ($parentItem = $item->getParentItem()) {
00041                 if ($options = $parentItem->getProductOptions()) {
00042                     if (isset($options['shipment_type']) && $options['shipment_type'] == Mage_Catalog_Model_Product_Type_Abstract::SHIPMENT_SEPARATELY) {
00043                         return true;
00044                     } else {
00045                         return false;
00046                     }
00047                 }
00048             } else {
00049                 if ($options = $item->getProductOptions()) {
00050                     if (isset($options['shipment_type']) && $options['shipment_type'] == Mage_Catalog_Model_Product_Type_Abstract::SHIPMENT_SEPARATELY) {
00051                         return false;
00052                     } else {
00053                         return true;
00054                     }
00055                 }
00056             }
00057         }
00058 
00059         if ($options = $this->getOrderItem()->getProductOptions()) {
00060             if (isset($options['shipment_type']) && $options['shipment_type'] == Mage_Catalog_Model_Product_Type_Abstract::SHIPMENT_SEPARATELY) {
00061                 return true;
00062             }
00063         }
00064         return false;
00065     }


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

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