1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Default extends Mage_Sales_Block_Order_Item_Renderer_Default
35: {
36: 37: 38: 39: 40: 41: 42:
43: public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
44: {
45:
46: $item = $this->getItem();
47:
48:
49: $itemXml = $orderItemXmlObj->addCustomChild('item', null, array(
50: 'product_id' => $item->getProductId()
51: ));
52: $itemXml->addCustomChild('name', $item->getName());
53:
54:
55: $weeeHelper = $this->helper('weee');
56:
57: $taxHelper = $this->helper('tax');
58:
59: Mage::helper('xmlconnect/customer_order')->addItemOptionsToXml($this, $itemXml);
60:
61: $addtInfoBlock = $this->getProductAdditionalInformationBlock();
62: if ($addtInfoBlock) {
63:
64:
65: }
66:
67: $itemXml->addCustomChild('entity_type', $item->getProductType());
68: $itemXml->addCustomChild('description', $item->getDescription());
69: $itemXml->addCustomChild('sku', Mage::helper('core/string')->splitInjection($this->getSku()));
70:
71: $this->setWeeeTaxAppliedAmount($item->getWeeeTaxAppliedAmount());
72: $this->setWeeeTaxDisposition($item->getWeeeTaxDisposition());
73:
74: $typeOfDisplay1 = $weeeHelper->typeOfDisplay($item, 1, 'sales')
75: && $this->getWeeeTaxAppliedAmount();
76: $typeOfDisplay2 = $weeeHelper->typeOfDisplay($item, 2, 'sales')
77: && $this->getWeeeTaxAppliedAmount();
78: $typeOfDisplay4 = $weeeHelper->typeOfDisplay($item, 4, 'sales')
79: && $this->getWeeeTaxAppliedAmount();
80: $typeOfDisplay014 = $weeeHelper->typeOfDisplay($item, array(0, 1, 4), 'sales')
81: && $this->getWeeeTaxAppliedAmount();
82:
83: $this->setTypesOfDisplay(array(
84: Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_1 => $typeOfDisplay1,
85: Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_2 => $typeOfDisplay2,
86: Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_4 => $typeOfDisplay4,
87: Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_14 => $typeOfDisplay014,
88: ));
89: $this->setWeeeTaxes($weeeHelper->getApplied($item));
90:
91:
92: $priceXml = $itemXml->addChild('price');
93:
94:
95: Mage::helper('xmlconnect/customer_order')->addQuantityToXml($this, $itemXml->addChild('qty'), $item);
96:
97:
98: $subtotalXml = $itemXml->addChild('subtotal');
99:
100:
101: if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceExclTax()) {
102: Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml($this, $item, $priceXml, $subtotalXml);
103: }
104:
105:
106: if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceInclTax()) {
107: Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
108: $this, $item, $priceXml, $subtotalXml, true
109: );
110: }
111: }
112: }
113: