00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Adminhtml_Block_Sales_Items_Column_Default extends Mage_Adminhtml_Block_Template
00036 {
00037 public function getItem()
00038 {
00039 if ($this->_getData('item') instanceof Mage_Sales_Model_Order_Item) {
00040 return $this->_getData('item');
00041 } else {
00042 return $this->_getData('item')->getOrderItem();
00043 }
00044 }
00045
00046 public function getOrderOptions()
00047 {
00048 $result = array();
00049 if ($options = $this->getItem()->getProductOptions()) {
00050 if (isset($options['options'])) {
00051 $result = array_merge($result, $options['options']);
00052 }
00053 if (isset($options['additional_options'])) {
00054 $result = array_merge($result, $options['additional_options']);
00055 }
00056 if (!empty($options['attributes_info'])) {
00057 $result = array_merge($options['attributes_info'], $result);
00058 }
00059 }
00060 return $result;
00061 }
00062
00063
00064
00065
00066
00067
00068
00069 public function getCustomizedOptionValue($optionInfo)
00070 {
00071
00072 $_default = $optionInfo['value'];
00073 if (isset($optionInfo['option_type'])) {
00074 try {
00075 $group = Mage::getModel('catalog/product_option')->groupFactory($optionInfo['option_type']);
00076 return $group->getCustomizedView($optionInfo);
00077 } catch (Exception $e) {
00078 return $_default;
00079 }
00080 }
00081 return $_default;
00082 }
00083
00084 public function getSku()
00085 {
00086 if ($this->getItem()->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
00087 return $this->getItem()->getProductOptionByCode('simple_sku');
00088 }
00089 return $this->getItem()->getSku();
00090 }
00091
00092 }