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_Downloadable
35: extends Mage_Downloadable_Block_Sales_Order_Item_Renderer_Downloadable
36: {
37: 38: 39: 40: 41: 42: 43:
44: public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
45: {
46:
47: $item = $this->getItem();
48:
49:
50: $itemXml = $orderItemXmlObj->addCustomChild('item', null, array(
51: 'product_id' => $item->getProductId()
52: ));
53: $itemXml->addCustomChild('name', $item->getName());
54:
55:
56: $weeeHelper = $this->helper('weee');
57:
58: $taxHelper = $this->helper('tax');
59:
60: Mage::helper('xmlconnect/customer_order')->addItemOptionsToXml($this, $itemXml);
61:
62: $addtInfoBlock = $this->getProductAdditionalInformationBlock();
63: if ($addtInfoBlock) {
64:
65:
66: }
67:
68: $links = $this->getLinks();
69: if ($links) {
70: $linksXml = $itemXml->addCustomChild('links', null, array('label' => $this->getLinksTitle()));
71: foreach ($links->getPurchasedItems() as $link) {
72: $linksXml->addCustomChild('link', $link->getLinkTitle());
73: }
74: }
75:
76: $itemXml->addCustomChild('entity_type', $item->getProductType());
77: $itemXml->addCustomChild('description', $item->getDescription());
78: $itemXml->addCustomChild('sku', Mage::helper('core/string')->splitInjection($this->getSku()));
79:
80:
81: $priceXml = $itemXml->addChild('price');
82:
83:
84: Mage::helper('xmlconnect/customer_order')->addQuantityToXml($this, $itemXml->addChild('qty'), $item);
85:
86:
87: $subtotalXml = $itemXml->addChild('subtotal');
88:
89: $this->setWeeeTaxAppliedAmount($item->getWeeeTaxAppliedAmount());
90: $this->setWeeeTaxDisposition($item->getWeeeTaxDisposition());
91:
92: $typeOfDisplay1 = $weeeHelper->typeOfDisplay($item, 1, 'sales')
93: && $this->getWeeeTaxAppliedAmount();
94: $typeOfDisplay2 = $weeeHelper->typeOfDisplay($item, 2, 'sales')
95: && $this->getWeeeTaxAppliedAmount();
96: $typeOfDisplay4 = $weeeHelper->typeOfDisplay($item, 4, 'sales')
97: && $this->getWeeeTaxAppliedAmount();
98: $typeOfDisplay014 = $weeeHelper->typeOfDisplay($item, array(0, 1, 4), 'sales')
99: && $this->getWeeeTaxAppliedAmount();
100:
101: $this->setTypesOfDisplay(array(
102: Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_1 => $typeOfDisplay1,
103: Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_2 => $typeOfDisplay2,
104: Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_4 => $typeOfDisplay4,
105: Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_14 => $typeOfDisplay014,
106: ));
107: $this->setWeeeTaxes($weeeHelper->getApplied($item));
108:
109:
110: if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceExclTax()) {
111: Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
112: $this,
113: $item,
114: $priceXml,
115: $subtotalXml
116: );
117: }
118:
119:
120: if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceInclTax()) {
121: Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
122: $this, $item, $priceXml, $subtotalXml, true
123: );
124: }
125: }
126: }
127: