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_Sales_Block_Order_Email_Items_Order_Default extends Mage_Core_Block_Template
00036 {
00037
00038
00039
00040
00041
00042 public function getOrder()
00043 {
00044 return $this->getItem()->getOrder();
00045 }
00046
00047 public function getItemOptions()
00048 {
00049 $result = array();
00050 if ($options = $this->getItem()->getProductOptions()) {
00051 if (isset($options['options'])) {
00052 $result = array_merge($result, $options['options']);
00053 }
00054 if (isset($options['additional_options'])) {
00055 $result = array_merge($result, $options['additional_options']);
00056 }
00057 if (isset($options['attributes_info'])) {
00058 $result = array_merge($result, $options['attributes_info']);
00059 }
00060 }
00061
00062 return $result;
00063 }
00064
00065 public function getValueHtml($value)
00066 {
00067 if (is_array($value)) {
00068 return sprintf('%d', $value['qty']) . ' x ' . $this->htmlEscape($value['title']) . " " . $this->getItem()->getOrder()->formatPrice($value['price']);
00069 } else {
00070 return $this->htmlEscape($value);
00071 }
00072 }
00073
00074 public function getSku($item)
00075 {
00076 if ($item->getProductOptionByCode('simple_sku'))
00077 return $item->getProductOptionByCode('simple_sku');
00078 else
00079 return $item->getSku();
00080 }
00081 }