Magento_Mobile - Version 1.6.0.0.22.1

Version Notes

1.6.0.0.22.1 version of package internal svn revision #121425

Download this release

Release Info

Developer Magento Core Team
Extension Magento_Mobile
Version 1.6.0.0.22.1
Comparing to
See all releases


Code changes from version 1.5.0.0.22.1 to 1.6.0.0.22.1

Files changed (175) hide show
  1. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php +1 -1
  2. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php +1 -3
  3. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php +2 -9
  4. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php +2 -7
  5. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php +1 -1
  6. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php +1 -1
  7. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php +1 -1
  8. app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php +1 -1
  9. app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php +3 -4
  10. app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php +1 -1
  11. app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php +1 -1
  12. app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php +1 -1
  13. app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php +1 -1
  14. app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php +1 -1
  15. app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php +5 -13
  16. app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php +2 -2
  17. app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php +5 -4
  18. app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php +1 -1
  19. app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php +48 -0
  20. app/code/core/Mage/XmlConnect/Block/Cart.php +2 -1
  21. app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php +2 -4
  22. app/code/core/Mage/XmlConnect/Block/Cart/Info.php +3 -12
  23. app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php +18 -34
  24. app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php +8 -7
  25. app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php +3 -7
  26. app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php +17 -51
  27. app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php +10 -31
  28. app/code/core/Mage/XmlConnect/Block/Cart/Totals.php +2 -9
  29. app/code/core/Mage/XmlConnect/Block/Catalog/Category.php +4 -9
  30. app/code/core/Mage/XmlConnect/Block/Catalog/Product.php +4 -9
  31. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php +3 -6
  32. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php +3 -9
  33. app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php +3 -6
  34. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php +7 -18
  35. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php +1 -6
  36. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php +2 -12
  37. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php +43 -90
  38. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php +4 -10
  39. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php +1 -2
  40. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php +1 -2
  41. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php +36 -55
  42. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php +124 -335
  43. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php +5 -11
  44. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php +13 -20
  45. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php +1 -2
  46. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php +5 -9
  47. app/code/core/Mage/XmlConnect/Block/Catalog/Search.php +6 -5
  48. app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php +3 -1
  49. app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php +60 -82
  50. app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php +1 -0
  51. app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php +1 -2
  52. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php +1 -2
  53. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php +1 -2
  54. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php +8 -20
  55. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php +4 -11
  56. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php +7 -16
  57. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php +1 -4
  58. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php +4 -9
  59. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php +5 -11
  60. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php +5 -13
  61. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php +19 -41
  62. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php +1 -2
  63. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php +1 -2
  64. app/code/core/Mage/XmlConnect/Block/Configuration.php +2 -8
  65. app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php +46 -75
  66. app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php +7 -10
  67. app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Boolean.php +4 -14
  68. app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Date.php +20 -33
  69. app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/File.php +11 -18
  70. app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Image.php +5 -10
  71. app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiline.php +5 -16
  72. app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Select.php +1 -2
  73. app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Text.php +7 -24
  74. app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Textarea.php +1 -2
  75. app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php +4 -18
  76. app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php +11 -25
  77. app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php +26 -49
  78. app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php +13 -34
  79. app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php +13 -35
  80. app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Giftcard.php +1 -1
  81. app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php +2 -4
  82. app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php +2 -3
  83. app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php +10 -23
  84. app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php +5 -12
  85. app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance.php +2 -5
  86. app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance/Refunded.php +2 -5
  87. app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Giftcards.php +3 -8
  88. app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php +4 -13
  89. app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php +26 -58
  90. app/code/core/Mage/XmlConnect/Block/Home.php +0 -2
  91. app/code/core/Mage/XmlConnect/Block/Review/Form.php +23 -46
  92. app/code/core/Mage/XmlConnect/Controller/Action.php +6 -9
  93. app/code/core/Mage/XmlConnect/Helper/Android.php +4 -9
  94. app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php +1 -0
  95. app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php +1 -2
  96. app/code/core/Mage/XmlConnect/Helper/Customer/Order.php +47 -100
  97. app/code/core/Mage/XmlConnect/Helper/Data.php +63 -43
  98. app/code/core/Mage/XmlConnect/Helper/Image.php +4 -10
  99. app/code/core/Mage/XmlConnect/Helper/Ipad.php +6 -15
  100. app/code/core/Mage/XmlConnect/Helper/Iphone.php +10 -30
  101. app/code/core/Mage/XmlConnect/Helper/Theme.php +3 -7
  102. app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php +1 -1
  103. app/code/core/Mage/XmlConnect/Model/Application.php +25 -57
  104. app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php +13 -28
  105. app/code/core/Mage/XmlConnect/Model/ConfigData.php +3 -9
  106. app/code/core/Mage/XmlConnect/Model/History.php +4 -4
  107. app/code/core/Mage/XmlConnect/Model/Input/Filter/MaliciousCode.php +0 -100
  108. app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php +2 -94
  109. app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php +9 -10
  110. app/code/core/Mage/XmlConnect/Model/Mysql4/Cms/Page/Collection.php +4 -31
  111. app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData.php +1 -72
  112. app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData/Collection.php +1 -141
  113. app/code/core/Mage/XmlConnect/Model/Mysql4/Filter/Collection.php +2 -67
  114. app/code/core/Mage/XmlConnect/Model/Mysql4/History.php +9 -57
  115. app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php +4 -36
  116. app/code/core/Mage/XmlConnect/Model/Mysql4/Queue.php +9 -10
  117. app/code/core/Mage/XmlConnect/Model/Mysql4/Queue/Collection.php +1 -67
  118. app/code/core/Mage/XmlConnect/Model/Mysql4/Setup.php +10 -2
  119. app/code/core/Mage/XmlConnect/Model/Mysql4/Template.php +9 -10
  120. app/code/core/Mage/XmlConnect/Model/Mysql4/Template/Collection.php +1 -36
  121. app/code/core/Mage/XmlConnect/Model/Observer.php +4 -7
  122. app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php +2 -6
  123. app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php +16 -9
  124. app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php +1 -2
  125. app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php +1 -2
  126. app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php +9 -18
  127. app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php +1 -1
  128. app/code/core/Mage/XmlConnect/Model/Queue.php +9 -15
  129. app/code/core/Mage/XmlConnect/Model/Resource/Application.php +121 -0
  130. app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php +45 -0
  131. app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php +62 -0
  132. app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php +102 -0
  133. app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php +173 -0
  134. app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php +101 -0
  135. app/code/core/Mage/XmlConnect/Model/Resource/History.php +90 -0
  136. app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php +67 -0
  137. app/code/core/Mage/XmlConnect/Model/Resource/Queue.php +45 -0
  138. app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php +113 -0
  139. app/code/core/Mage/XmlConnect/{Block/Checkout/Shipping/Method/Avaliable.php → Model/Resource/Setup.php} +2 -5
  140. app/code/core/Mage/XmlConnect/Model/Resource/Template.php +45 -0
  141. app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php +72 -0
  142. app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php +2 -9
  143. app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php +16 -28
  144. app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php +9 -14
  145. app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php +3 -15
  146. app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php +28 -65
  147. app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php +16 -23
  148. app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php +3 -4
  149. app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php +3 -4
  150. app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php +17 -23
  151. app/code/core/Mage/XmlConnect/Model/Template.php +1 -1
  152. app/code/core/Mage/XmlConnect/Model/Theme.php +5 -13
  153. app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php +86 -124
  154. app/code/core/Mage/XmlConnect/controllers/CartController.php +23 -42
  155. app/code/core/Mage/XmlConnect/controllers/CatalogController.php +13 -23
  156. app/code/core/Mage/XmlConnect/controllers/CheckoutController.php +25 -19
  157. app/code/core/Mage/XmlConnect/controllers/CmsController.php +2 -2
  158. app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php +11 -25
  159. app/code/core/Mage/XmlConnect/controllers/CustomerController.php +40 -85
  160. app/code/core/Mage/XmlConnect/controllers/IndexController.php +1 -1
  161. app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php +37 -95
  162. app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php +20 -50
  163. app/code/core/Mage/XmlConnect/controllers/PbridgeController.php +2 -2
  164. app/code/core/Mage/XmlConnect/controllers/ReviewController.php +17 -38
  165. app/code/core/Mage/XmlConnect/controllers/WishlistController.php +18 -32
  166. app/code/core/Mage/XmlConnect/etc/config.xml +8 -6
  167. app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php +279 -0
  168. app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.13-1.4.0.14.php +44 -23
  169. app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.9-1.4.0.10.php +1 -6
  170. app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +501 -0
  171. media/xmlconnect/system/ok.gif +0 -0
  172. package.xml +6 -7
  173. skin/adminhtml/default/default/images/xmlconnect/mobile_preview/android/bg_content.jpg +0 -0
  174. skin/adminhtml/default/default/images/xmlconnect/mobile_preview/android/bg_home_content.jpg +0 -0
  175. skin/adminhtml/default/default/images/xmlconnect/mobile_preview/android/logo_big.png +0 -0
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php CHANGED
@@ -128,7 +128,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit
128
  }
129
 
130
  if (isset($app) && $app->getId()) {
131
- return $this->__('Edit App "%s"', $this->htmlEscape($app->getName()));
132
  } else {
133
  return $this->__('New App');
134
  }
128
  }
129
 
130
  if (isset($app) && $app->getId()) {
131
+ return $this->__('Edit App "%s"', $this->escapeHtml($app->getName()));
132
  } else {
133
  return $this->__('New App');
134
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php CHANGED
@@ -127,9 +127,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Country
127
  $html .= PHP_EOL . '</tr>' . PHP_EOL;
128
  }
129
 
130
- $html .= '</table>'
131
- . PHP_EOL
132
- . $this->getAfterElementHtml();
133
 
134
  return $html;
135
  }
127
  $html .= PHP_EOL . '</tr>' . PHP_EOL;
128
  }
129
 
130
+ $html .= '</table>' . PHP_EOL . $this->getAfterElementHtml();
 
 
131
 
132
  return $html;
133
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Content
35
- extends Mage_Adminhtml_Block_Template
36
  {
37
  /**
38
  * Set path to template used for generating block's output.
@@ -43,13 +42,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Content
43
  public function setTemplate($templateType)
44
  {
45
  $deviceType = Mage::helper('xmlconnect')->getDeviceType();
46
- parent::setTemplate(
47
- 'xmlconnect/edit/tab/design/preview/'
48
- . $templateType
49
- . '_'
50
- . $deviceType
51
- . '.phtml'
52
- );
53
  return $this;
54
  }
55
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Content extends Mage_Adminhtml_Block_Template
 
35
  {
36
  /**
37
  * Set path to template used for generating block's output.
42
  public function setTemplate($templateType)
43
  {
44
  $deviceType = Mage::helper('xmlconnect')->getDeviceType();
45
+ parent::setTemplate('xmlconnect/edit/tab/design/preview/' . $templateType . '_' . $deviceType . '.phtml');
 
 
 
 
 
 
46
  return $this;
47
  }
48
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Tabitems
35
- extends Mage_Adminhtml_Block_Template
36
  {
37
  /**
38
  * Set preview tab items template
@@ -42,11 +41,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Tabitems
42
  parent::__construct();
43
 
44
  $deviceType = Mage::helper('xmlconnect')->getDeviceType();
45
- $this->setTemplate(
46
- 'xmlconnect/edit/tab/design/preview/tab_items_'
47
- . $deviceType
48
- . '.phtml'
49
- );
50
  }
51
 
52
  /**
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Tabitems extends Mage_Adminhtml_Block_Template
 
35
  {
36
  /**
37
  * Set preview tab items template
41
  parent::__construct();
42
 
43
  $deviceType = Mage::helper('xmlconnect')->getDeviceType();
44
+ $this->setTemplate('xmlconnect/edit/tab/design/preview/tab_items_' . $deviceType . '.phtml');
 
 
 
 
45
  }
46
 
47
  /**
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php CHANGED
@@ -114,7 +114,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Submission
114
  {
115
  $app = Mage::helper('xmlconnect')->getApplication();
116
  if ($app && $app->getId()) {
117
- return $this->__('Submit App "%s"', $this->htmlEscape($app->getName()));
118
  }
119
  return '';
120
  }
114
  {
115
  $app = Mage::helper('xmlconnect')->getApplication();
116
  if ($app && $app->getId()) {
117
+ return $this->__('Submit App "%s"', $this->escapeHtml($app->getName()));
118
  }
119
  return '';
120
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php CHANGED
@@ -38,7 +38,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Renderer_Country_Android
38
  /**
39
  * Override setting the template
40
  *
41
- * @return void
42
  */
43
  protected function _construct()
44
  {
38
  /**
39
  * Override setting the template
40
  *
41
+ * @return null
42
  */
43
  protected function _construct()
44
  {
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php CHANGED
@@ -38,7 +38,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Renderer_Country_Istore
38
  /**
39
  * Override setting the template
40
  *
41
- * @return void
42
  */
43
  protected function _construct()
44
  {
38
  /**
39
  * Override setting the template
40
  *
41
+ * @return null
42
  */
43
  protected function _construct()
44
  {
app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php CHANGED
@@ -80,7 +80,7 @@ class Mage_XmlConnect_Block_Adminhtml_Queue_Edit
80
  {
81
  $message = Mage::registry('current_message');
82
  if ($message && $message->getId()) {
83
- return $this->__('Edit AirMail Message Queue #%s', $this->htmlEscape($message->getId()));
84
  } else {
85
  return $this->__('New AirMail Message Queue');
86
  }
80
  {
81
  $message = Mage::registry('current_message');
82
  if ($message && $message->getId()) {
83
+ return $this->__('Edit AirMail Message Queue #%s', $this->escapeHtml($message->getId()));
84
  } else {
85
  return $this->__('New AirMail Message Queue');
86
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php CHANGED
@@ -33,7 +33,6 @@
33
  */
34
  class Mage_XmlConnect_Block_Adminhtml_Queue_Grid extends Mage_Adminhtml_Block_Widget_Grid
35
  {
36
-
37
  /**
38
  * Setting grid_id, sort order and sort direction
39
  */
@@ -70,10 +69,10 @@ class Mage_XmlConnect_Block_Adminhtml_Queue_Grid extends Mage_Adminhtml_Block_Wi
70
  */
71
  protected function _prepareColumns()
72
  {
73
- $this->addColumn('id', array(
74
  'header' => $this->__('ID'),
75
  'align' => 'center',
76
- 'index' => 'main_table.id',
77
  'width' => '40px',
78
  'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_id'
79
  ));
@@ -89,7 +88,7 @@ class Mage_XmlConnect_Block_Adminhtml_Queue_Grid extends Mage_Adminhtml_Block_Wi
89
  $this->addColumn('app_code', array(
90
  'header' => $this->__('Application Name'),
91
  'align' => 'left',
92
- 'index' => 'main_table.app_code',
93
  'type' => 'options',
94
  'options' => Mage::helper('xmlconnect')->getApplications(),
95
  'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_application'
33
  */
34
  class Mage_XmlConnect_Block_Adminhtml_Queue_Grid extends Mage_Adminhtml_Block_Widget_Grid
35
  {
 
36
  /**
37
  * Setting grid_id, sort order and sort direction
38
  */
69
  */
70
  protected function _prepareColumns()
71
  {
72
+ $this->addColumn('queue_id', array(
73
  'header' => $this->__('ID'),
74
  'align' => 'center',
75
+ 'index' => 'main_table.queue_id',
76
  'width' => '40px',
77
  'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_id'
78
  ));
88
  $this->addColumn('app_code', array(
89
  'header' => $this->__('Application Name'),
90
  'align' => 'left',
91
+ 'index' => 'app.code',
92
  'type' => 'options',
93
  'options' => Mage::helper('xmlconnect')->getApplications(),
94
  'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_application'
app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php CHANGED
@@ -42,7 +42,7 @@ class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Application
42
  */
43
  public function render(Varien_Object $row)
44
  {
45
- $str = $this->htmlEscape($row->getAppName());
46
  if ($str == '') {
47
  $str = ' --- ';
48
  }
42
  */
43
  public function render(Varien_Object $row)
44
  {
45
+ $str = $this->escapeHtml($row->getAppName());
46
  if ($str == '') {
47
  $str = ' --- ';
48
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php CHANGED
@@ -46,6 +46,6 @@ class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Msgtitle
46
  if (strlen($msgTitle) > 50) {
47
  $msgTitle = substr($msgTitle, 0, 50) . '...';
48
  }
49
- return $this->htmlEscape($msgTitle);
50
  }
51
  }
46
  if (strlen($msgTitle) > 50) {
47
  $msgTitle = substr($msgTitle, 0, 50) . '...';
48
  }
49
+ return $this->escapeHtml($msgTitle);
50
  }
51
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php CHANGED
@@ -42,6 +42,6 @@ class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Pushtitle
42
  */
43
  public function render(Varien_Object $row)
44
  {
45
- return $this->htmlEscape($row->getPushTitle());
46
  }
47
  }
42
  */
43
  public function render(Varien_Object $row)
44
  {
45
+ return $this->escapeHtml($row->getPushTitle());
46
  }
47
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php CHANGED
@@ -64,6 +64,6 @@ class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Status
64
  $str = $this->__('Undefined');
65
  }
66
 
67
- return $this->htmlEscape($str);
68
  }
69
  }
64
  $str = $this->__('Undefined');
65
  }
66
 
67
+ return $this->escapeHtml($str);
68
  }
69
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php CHANGED
@@ -42,7 +42,7 @@ class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Template
42
  */
43
  public function render(Varien_Object $row)
44
  {
45
- $str = $this->htmlEscape($row->getTplName());
46
  if ($str == '') {
47
  $str .= '---';
48
  }
42
  */
43
  public function render(Varien_Object $row)
44
  {
45
+ $str = $this->escapeHtml($row->getTplName());
46
  if ($str == '') {
47
  $str .= '---';
48
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Adminhtml_Template_Edit
35
- extends Mage_Adminhtml_Block_Widget_Form_Container
36
  {
37
  /**
38
  * Constructor
@@ -44,16 +43,9 @@ class Mage_XmlConnect_Block_Adminhtml_Template_Edit
44
  $this->_blockGroup = 'xmlconnect';
45
  parent::__construct();
46
 
47
- $this->_updateButton(
48
- 'delete',
49
- 'onclick',
50
- 'deleteConfirm(\''
51
- . $this->__('Warning: All related AirMail messages will be deleted!')
52
- . PHP_EOL
53
- . $this->__('Are you sure you want to do this?')
54
- .'\', \''
55
- . $this->getDeleteUrl()
56
- . '\')'
57
  );
58
  $this->_updateButton('save', 'label', $this->__('Save'));
59
  $this->_updateButton('save', 'onclick', 'if (editForm.submit()) {disableElements(\'save\')}');
@@ -79,7 +71,7 @@ class Mage_XmlConnect_Block_Adminhtml_Template_Edit
79
  {
80
  $template = Mage::registry('current_template');
81
  if ($template && $template->getId()) {
82
- return $this->__('Edit Template "%s"', $this->htmlEscape($template->getName()));
83
  } else {
84
  return $this->__('New Template');
85
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Adminhtml_Template_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
 
35
  {
36
  /**
37
  * Constructor
43
  $this->_blockGroup = 'xmlconnect';
44
  parent::__construct();
45
 
46
+ $this->_updateButton('delete', 'onclick', 'deleteConfirm(\''
47
+ . $this->__('Warning: All related AirMail messages will be deleted!') . PHP_EOL
48
+ . $this->__('Are you sure you want to do this?') .'\', \'' . $this->getDeleteUrl() . '\')'
 
 
 
 
 
 
 
49
  );
50
  $this->_updateButton('save', 'label', $this->__('Save'));
51
  $this->_updateButton('save', 'onclick', 'if (editForm.submit()) {disableElements(\'save\')}');
71
  {
72
  $template = Mage::registry('current_template');
73
  if ($template && $template->getId()) {
74
+ return $this->__('Edit Template "%s"', $this->escapeHtml($template->getName()));
75
  } else {
76
  return $this->__('New Template');
77
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php CHANGED
@@ -94,8 +94,8 @@ class Mage_XmlConnect_Block_Adminhtml_Template_Edit_Form
94
  ));
95
  }
96
 
97
- $fieldset->addField('app_code', 'select', array(
98
- 'name' => 'app_code',
99
  'label' => $this->__('Application'),
100
  'title' => $this->__('Application'),
101
  'disabled' => $model->getId() || !$this->_fieldsEnabled ? true : false,
94
  ));
95
  }
96
 
97
+ $fieldset->addField('application_id', 'select', array(
98
+ 'name' => 'application_id',
99
  'label' => $this->__('Application'),
100
  'title' => $this->__('Application'),
101
  'disabled' => $model->getId() || !$this->_fieldsEnabled ? true : false,
app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php CHANGED
@@ -64,17 +64,18 @@ class Mage_XmlConnect_Block_Adminhtml_Template_Grid extends Mage_Adminhtml_Block
64
  */
65
  protected function _prepareColumns()
66
  {
67
- $this->addColumn('id', array(
68
  'header' => $this->__('ID'),
69
  'align' => 'center',
70
- 'index' => 'id',
71
  'width' => '40px'
72
  ));
73
 
74
  $this->addColumn('name', array(
75
  'header' => $this->__('Template Name'),
76
  'align' => 'left',
77
- 'index' => 'name',
 
78
  'escape' => true
79
  ));
80
 
@@ -94,7 +95,7 @@ class Mage_XmlConnect_Block_Adminhtml_Template_Grid extends Mage_Adminhtml_Block
94
 
95
  $this->addColumn('app_code', array(
96
  'header' => $this->__('Application'),
97
- 'index' => 'app_code',
98
  'type' => 'options',
99
  'align' => 'left',
100
  'options' => Mage::helper('xmlconnect')->getApplications(),
64
  */
65
  protected function _prepareColumns()
66
  {
67
+ $this->addColumn('template_id', array(
68
  'header' => $this->__('ID'),
69
  'align' => 'center',
70
+ 'index' => 'template_id',
71
  'width' => '40px'
72
  ));
73
 
74
  $this->addColumn('name', array(
75
  'header' => $this->__('Template Name'),
76
  'align' => 'left',
77
+ 'index' => 'main_table.name',
78
+ 'renderer' => 'xmlconnect/adminhtml_template_grid_renderer_name',
79
  'escape' => true
80
  ));
81
 
95
 
96
  $this->addColumn('app_code', array(
97
  'header' => $this->__('Application'),
98
+ 'index' => 'app.code',
99
  'type' => 'options',
100
  'align' => 'left',
101
  'options' => Mage::helper('xmlconnect')->getApplications(),
app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php CHANGED
@@ -42,7 +42,7 @@ class Mage_XmlConnect_Block_Adminhtml_Template_Grid_Renderer_Application
42
  */
43
  public function render(Varien_Object $row)
44
  {
45
- $str = $this->htmlEscape($row->getAppName());
46
  if ($str == '') {
47
  $str = ' --- ';
48
  }
42
  */
43
  public function render(Varien_Object $row)
44
  {
45
+ $str = $this->escapeHtml($row->getAppName());
46
  if ($str == '') {
47
  $str = ' --- ';
48
  }
app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Adminhtml airmail queue grid block action item renderer
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Block_Adminhtml_Template_Grid_Renderer_Name
35
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
36
+ {
37
+ /**
38
+ * Render grid row
39
+ *
40
+ * @param Varien_Object $row
41
+ * @return string
42
+ */
43
+ public function render(Varien_Object $row)
44
+ {
45
+ $str = $this->escapeHtml($row->getName());
46
+ return $str;
47
+ }
48
+ }
app/code/core/Mage/XmlConnect/Block/Cart.php CHANGED
@@ -91,7 +91,7 @@ class Mage_XmlConnect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
91
  ) {
92
  $inclPrice = $_incl + $item->getWeeeTaxAppliedAmount();
93
  } else {
94
- $inclPrice = $_incl - $item->getWeeeTaxDisposition();
95
  }
96
  }
97
  $exclPrice = Mage::helper('xmlconnect')->formatPriceForXml($exclPrice);
@@ -124,6 +124,7 @@ class Mage_XmlConnect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
124
  * Info for paypal MEP if it's enabled
125
  */
126
  $appConfig = Mage::helper('xmlconnect')->getApplication()->loadConfiguration()->getRenderConf();
 
127
  $isMepActive = $appConfig['paypal']['isActive'];
128
 
129
  $paypalMepIsAvailable = Mage::getModel('xmlconnect/payment_method_paypal_mep')->isAvailable(null);
91
  ) {
92
  $inclPrice = $_incl + $item->getWeeeTaxAppliedAmount();
93
  } else {
94
+ $inclPrice = $_incl - $item->getWeeeTaxDisposition();
95
  }
96
  }
97
  $exclPrice = Mage::helper('xmlconnect')->formatPriceForXml($exclPrice);
124
  * Info for paypal MEP if it's enabled
125
  */
126
  $appConfig = Mage::helper('xmlconnect')->getApplication()->loadConfiguration()->getRenderConf();
127
+
128
  $isMepActive = $appConfig['paypal']['isActive'];
129
 
130
  $paypalMepIsAvailable = Mage::getModel('xmlconnect/payment_method_paypal_mep')->isAvailable(null);
app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php CHANGED
@@ -83,14 +83,12 @@ class Mage_XmlConnect_Block_Cart_Crosssell extends Mage_Checkout_Block_Cart_Cros
83
  }
84
 
85
  if ($this->getChild('product_price')) {
86
- $this->getChild('product_price')->setProduct($product)
87
- ->setProductXmlObj($itemXmlObj)
88
  ->collectProductPrices();
89
  }
90
 
91
  if (!$product->getRatingSummary()) {
92
- Mage::getModel('review/review')
93
- ->getEntitySummary($product, Mage::app()->getStore()->getId());
94
  }
95
 
96
  $itemXmlObj->addChild('rating_summary', round((int)$product->getRatingSummary()->getRatingSummary() / 10));
83
  }
84
 
85
  if ($this->getChild('product_price')) {
86
+ $this->getChild('product_price')->setProduct($product)->setProductXmlObj($itemXmlObj)
 
87
  ->collectProductPrices();
88
  }
89
 
90
  if (!$product->getRatingSummary()) {
91
+ Mage::getModel('review/review')->getEntitySummary($product, Mage::app()->getStore()->getId());
 
92
  }
93
 
94
  $itemXmlObj->addChild('rating_summary', round((int)$product->getRatingSummary()->getRatingSummary() / 10));
app/code/core/Mage/XmlConnect/Block/Cart/Info.php CHANGED
@@ -45,20 +45,11 @@ class Mage_XmlConnect_Block_Cart_Info extends Mage_XmlConnect_Block_Cart
45
  /** @var $xmlObject Mage_XmlConnect_Model_Simplexml_Element */
46
  $xmlObject = Mage::getModel('xmlconnect/simplexml_element', '<cart></cart>');
47
 
48
- $xmlObject->addChild(
49
- 'is_virtual',
50
- (int)$this->helper('checkout/cart')->getIsVirtualQuote()
51
- );
52
 
53
- $xmlObject->addChild(
54
- 'summary_qty',
55
- (int)$this->helper('checkout/cart')->getSummaryCount()
56
- );
57
 
58
- $xmlObject->addChild(
59
- 'virtual_qty',
60
- (int)$quote->getItemVirtualQty()
61
- );
62
 
63
  if (strlen($quote->getCouponCode())) {
64
  $xmlObject->addChild('has_coupon_code', 1);
45
  /** @var $xmlObject Mage_XmlConnect_Model_Simplexml_Element */
46
  $xmlObject = Mage::getModel('xmlconnect/simplexml_element', '<cart></cart>');
47
 
48
+ $xmlObject->addChild('is_virtual', (int)$this->helper('checkout/cart')->getIsVirtualQuote());
 
 
 
49
 
50
+ $xmlObject->addChild('summary_qty', (int)$this->helper('checkout/cart')->getSummaryCount());
 
 
 
51
 
52
+ $xmlObject->addChild('virtual_qty', (int)$quote->getItemVirtualQty());
 
 
 
53
 
54
  if (strlen($quote->getCouponCode())) {
55
  $xmlObject->addChild('has_coupon_code', 1);
app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php CHANGED
@@ -42,7 +42,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_
42
  {
43
  $_item = $this->getItem();
44
  $productXmlObj = $reviewXmlObj->addCustomChild('item');
45
- $productXmlObj->addCustomChild('name', $this->htmlEscape($this->getProductName()));
46
 
47
  if ($_options = $this->getOptionList()) {
48
  $optionsXmlObj = $productXmlObj->addChild('options');
@@ -55,14 +55,10 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_
55
  $value = null;
56
  }
57
 
58
- $optionsXmlObj->addCustomChild(
59
- 'option',
60
- $value,
61
- array(
62
- 'label' => $this->htmlEscape($_option['label']),
63
- 'value' => $_formattedOptionValue['value']
64
- )
65
- );
66
  }
67
  }
68
 
@@ -87,15 +83,14 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_
87
 
88
  if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) {
89
  if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')
90
- && $_item->getWeeeTaxAppliedAmount()) {
91
- $exclPrice = $_item->getRowTotal()
92
- + $_item->getWeeeTaxAppliedRowAmount()
93
  + $_item->getWeeeTaxRowDisposition();
94
  } else {
95
  $exclPrice = $_item->getRowTotal();
96
  }
97
  $exclPrice = $this->_formatPrice($exclPrice);
98
-
99
  $subtotalXmlObj->addAttribute('excluding_tax', $subtotalXmlObj->escapeXml($exclPrice));
100
  }
101
 
@@ -212,45 +207,34 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_
212
  $amount = $tax['amount'];
213
  }
214
 
215
- $weeeXmlObj->addCustomChild(
216
- 'item',
217
- null,
218
- array(
219
- 'name' => $tax['title'],
220
- 'amount' => $this->_formatPrice($amount)
221
- )
222
- );
223
  }
224
  } elseif ($_item->getWeeeTaxAppliedAmount()
225
  && ($typeOfDisplay2 || Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales'))
226
  ) {
227
  foreach (Mage::helper('weee')->getApplied($_item) as $tax) {
228
-
229
  if ($subtotalFlag) {
230
  $amount = $tax['row_amount_incl_tax'];
231
  } else {
232
  $amount = $tax['amount_incl_tax'];
233
  }
234
 
235
- $weeeXmlObj->addCustomChild(
236
- 'item',
237
- null,
238
- array(
239
- 'name' => $tax['title'],
240
- 'amount' => $this->_formatPrice($amount)
241
- )
242
- );
243
  }
244
  }
245
 
246
  if ($typeOfDisplay2 && $_item->getWeeeTaxAppliedAmount()) {
247
  if ($subtotalFlag) {
248
- $totalExcl = $_item->getRowTotal()
249
- + $_item->getWeeeTaxAppliedRowAmount()
250
  + $_item->getWeeeTaxRowDisposition();
251
  } else {
252
- $totalExcl = $_item->getCalculationPrice()
253
- + $_item->getWeeeTaxAppliedAmount()
254
  + $_item->getWeeeTaxDisposition();
255
  }
256
 
42
  {
43
  $_item = $this->getItem();
44
  $productXmlObj = $reviewXmlObj->addCustomChild('item');
45
+ $productXmlObj->addCustomChild('name', $this->escapeHtml($this->getProductName()));
46
 
47
  if ($_options = $this->getOptionList()) {
48
  $optionsXmlObj = $productXmlObj->addChild('options');
55
  $value = null;
56
  }
57
 
58
+ $optionsXmlObj->addCustomChild('option', $value, array(
59
+ 'label' => $this->escapeHtml($_option['label']),
60
+ 'value' => $_formattedOptionValue['value']
61
+ ));
 
 
 
 
62
  }
63
  }
64
 
83
 
84
  if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) {
85
  if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')
86
+ && $_item->getWeeeTaxAppliedAmount()
87
+ ) {
88
+ $exclPrice = $_item->getRowTotal() + $_item->getWeeeTaxAppliedRowAmount()
89
  + $_item->getWeeeTaxRowDisposition();
90
  } else {
91
  $exclPrice = $_item->getRowTotal();
92
  }
93
  $exclPrice = $this->_formatPrice($exclPrice);
 
94
  $subtotalXmlObj->addAttribute('excluding_tax', $subtotalXmlObj->escapeXml($exclPrice));
95
  }
96
 
207
  $amount = $tax['amount'];
208
  }
209
 
210
+ $weeeXmlObj->addCustomChild('item', null, array(
211
+ 'name' => $tax['title'],
212
+ 'amount' => $this->_formatPrice($amount)
213
+ ));
 
 
 
 
214
  }
215
  } elseif ($_item->getWeeeTaxAppliedAmount()
216
  && ($typeOfDisplay2 || Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales'))
217
  ) {
218
  foreach (Mage::helper('weee')->getApplied($_item) as $tax) {
 
219
  if ($subtotalFlag) {
220
  $amount = $tax['row_amount_incl_tax'];
221
  } else {
222
  $amount = $tax['amount_incl_tax'];
223
  }
224
 
225
+ $weeeXmlObj->addCustomChild('item', null, array(
226
+ 'name' => $tax['title'],
227
+ 'amount' => $this->_formatPrice($amount)
228
+ ));
 
 
 
 
229
  }
230
  }
231
 
232
  if ($typeOfDisplay2 && $_item->getWeeeTaxAppliedAmount()) {
233
  if ($subtotalFlag) {
234
+ $totalExcl = $_item->getRowTotal() + $_item->getWeeeTaxAppliedRowAmount()
 
235
  + $_item->getWeeeTaxRowDisposition();
236
  } else {
237
+ $totalExcl = $_item->getCalculationPrice() + $_item->getWeeeTaxAppliedAmount()
 
238
  + $_item->getWeeeTaxDisposition();
239
  }
240
 
app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php CHANGED
@@ -32,8 +32,8 @@
32
  */
33
  class Mage_XmlConnect_Block_Cart_Item_Renderer_Configurable extends Mage_XmlConnect_Block_Cart_Item_Renderer
34
  {
35
- const CONFIGURABLE_PRODUCT_IMAGE= 'checkout/cart/configurable_product_image';
36
- const USE_PARENT_IMAGE = 'parent';
37
 
38
  /**
39
  * Get item configurable product
@@ -42,7 +42,8 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer_Configurable extends Mage_XmlConn
42
  */
43
  public function getConfigurableProduct()
44
  {
45
- if ($option = $this->getItem()->getOptionByCode('product_type')) {
 
46
  return $option->getProduct();
47
  }
48
  return $this->getProduct();
@@ -55,7 +56,8 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer_Configurable extends Mage_XmlConn
55
  */
56
  public function getChildProduct()
57
  {
58
- if ($option = $this->getItem()->getOptionByCode('simple_product')) {
 
59
  return $option->getProduct();
60
  }
61
  return $this->getProduct();
@@ -72,7 +74,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer_Configurable extends Mage_XmlConn
72
  }
73
 
74
  /**
75
- * Get list of all otions for product
76
  *
77
  * @return array
78
  */
@@ -80,7 +82,6 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer_Configurable extends Mage_XmlConn
80
  {
81
  /* @var $helper Mage_Catalog_Helper_Product_Configuration */
82
  $helper = Mage::helper('catalog/product_configuration');
83
- $options = $helper->getConfigurableOptions($this->getItem());
84
- return $options;
85
  }
86
  }
32
  */
33
  class Mage_XmlConnect_Block_Cart_Item_Renderer_Configurable extends Mage_XmlConnect_Block_Cart_Item_Renderer
34
  {
35
+ const CONFIGURABLE_PRODUCT_IMAGE = 'checkout/cart/configurable_product_image';
36
+ const USE_PARENT_IMAGE = 'parent';
37
 
38
  /**
39
  * Get item configurable product
42
  */
43
  public function getConfigurableProduct()
44
  {
45
+ $option = $this->getItem()->getOptionByCode('product_type');
46
+ if ($option) {
47
  return $option->getProduct();
48
  }
49
  return $this->getProduct();
56
  */
57
  public function getChildProduct()
58
  {
59
+ $option = $this->getItem()->getOptionByCode('simple_product');
60
+ if ($option) {
61
  return $option->getProduct();
62
  }
63
  return $this->getProduct();
74
  }
75
 
76
  /**
77
+ * Get list of all options for product
78
  *
79
  * @return array
80
  */
82
  {
83
  /* @var $helper Mage_Catalog_Helper_Product_Configuration */
84
  $helper = Mage::helper('catalog/product_configuration');
85
+ return $helper->getConfigurableOptions($this->getItem());
 
86
  }
87
  }
app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_Xmlconnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Cart_Paypal_Mecl_Details
35
- extends Mage_Paypal_Block_Express_Review_Details
36
  {
37
  /**
38
  * Add cart details to XML object
@@ -47,9 +46,7 @@ class Mage_XmlConnect_Block_Cart_Paypal_Mecl_Details
47
  $this->getItemXml($_item, $itemsXmlObj);
48
  }
49
 
50
- $reviewXmlObj->appendChild(
51
- $this->getChild('totals')->setReturnObjectFlag(true)->_toHtml()
52
- );
53
 
54
  return $reviewXmlObj;
55
  }
@@ -66,8 +63,7 @@ class Mage_XmlConnect_Block_Cart_Paypal_Mecl_Details
66
  Mage_XmlConnect_Model_Simplexml_Element $reviewXmlObj
67
  )
68
  {
69
- $renderer = $this->getItemRenderer($item->getProductType())
70
- ->setItem($item)->setQuote($this->getQuote());
71
  return $renderer->addProductToXmlObj($reviewXmlObj);
72
  }
73
 
31
  * @package Mage_Xmlconnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Cart_Paypal_Mecl_Details extends Mage_Paypal_Block_Express_Review_Details
 
35
  {
36
  /**
37
  * Add cart details to XML object
46
  $this->getItemXml($_item, $itemsXmlObj);
47
  }
48
 
49
+ $reviewXmlObj->appendChild($this->getChild('totals')->setReturnObjectFlag(true)->_toHtml());
 
 
50
 
51
  return $reviewXmlObj;
52
  }
63
  Mage_XmlConnect_Model_Simplexml_Element $reviewXmlObj
64
  )
65
  {
66
+ $renderer = $this->getItemRenderer($item->getProductType())->setItem($item)->setQuote($this->getQuote());
 
67
  return $renderer->addProductToXmlObj($reviewXmlObj);
68
  }
69
 
app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php CHANGED
@@ -41,88 +41,54 @@ class Mage_XmlConnect_Block_Cart_Paypal_Mecl_Review extends Mage_Paypal_Block_Ex
41
  protected function _toHtml()
42
  {
43
  /** @var $reviewXmlObj Mage_XmlConnect_Model_Simplexml_Element */
44
- $reviewXmlObj = Mage::getModel(
45
- 'xmlconnect/simplexml_element',
46
- '<mecl_cart_details></mecl_cart_details>'
47
- );
48
 
49
  if ($this->getPaypalMessages()) {
50
- $reviewXmlObj->addChild(
51
- 'paypal_message',
52
- implode(PHP_EOL, $this->getPaypalMessages())
53
- );
54
  }
55
 
56
  if ($this->getShippingAddress()) {
57
  $reviewXmlObj->addCustomChild(
58
  'shipping_address',
59
- $this->renderAddress($this->getShippingAddress()),
60
  array('label' => $this->__('Shipping Address'))
61
  );
62
  }
63
 
64
  if ($this->_quote->isVirtual()) {
65
- $reviewXmlObj->addCustomChild(
66
- 'shipping_method',
67
- null,
68
- array(
69
- 'label' => $this->__('No shipping method required.')
70
- )
71
- );
72
  } elseif ($this->getCanEditShippingMethod() || !$this->getCurrentShippingRate()) {
73
  if ($groups = $this->getShippingRateGroups()) {
74
  $currentRate = $this->getCurrentShippingRate();
75
  foreach ($groups as $code => $rates) {
76
  foreach ($rates as $rate) {
77
  if ($currentRate === $rate) {
78
- $reviewXmlObj->addCustomChild(
79
- 'shipping_method',
80
- null,
81
- array(
82
- 'rate' => strip_tags($this->renderShippingRateOption($rate)),
83
- 'label' => $this->getCarrierName($code)
84
- )
85
- );
86
  break(2);
87
  }
88
  }
89
  }
90
  }
91
  }
92
- $reviewXmlObj->addCustomChild(
93
- 'payment_method',
94
- $this->escapeHtml($this->getPaymentMethodTitle()),
95
- array(
96
- 'label' => $this->__('Payment Method')
97
- )
98
- );
99
 
100
  $reviewXmlObj->addCustomChild(
101
  'billing_address',
102
- $this->renderAddress($this->getBillingAddress()),
103
  array(
104
- 'label' => $this->__('Billing Address'),
105
- 'payer_email' => $this->__('Payer Email: %s', $this->getBillingAddress()->getEmail())
106
- )
107
- );
108
 
109
  $this->getChild('details')->addDetailsToXmlObj($reviewXmlObj);
110
 
111
  return $reviewXmlObj->asNiceXml();
112
  }
113
-
114
- /**
115
- * Get text output for specified address
116
- *
117
- * @param $address
118
- * @return string
119
- */
120
- public function renderAddress($address)
121
- {
122
- return preg_replace(
123
- array('@\r@', '@\n+@'),
124
- array('', PHP_EOL),
125
- $address->getFormated(false)
126
- );
127
- }
128
  }
41
  protected function _toHtml()
42
  {
43
  /** @var $reviewXmlObj Mage_XmlConnect_Model_Simplexml_Element */
44
+ $reviewXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<mecl_cart_details></mecl_cart_details>');
 
 
 
45
 
46
  if ($this->getPaypalMessages()) {
47
+ $reviewXmlObj->addChild('paypal_message', implode(PHP_EOL, $this->getPaypalMessages()));
 
 
 
48
  }
49
 
50
  if ($this->getShippingAddress()) {
51
  $reviewXmlObj->addCustomChild(
52
  'shipping_address',
53
+ Mage::helper('xmlconnect')->trimLineBreaks($this->getShippingAddress()->format('text')),
54
  array('label' => $this->__('Shipping Address'))
55
  );
56
  }
57
 
58
  if ($this->_quote->isVirtual()) {
59
+ $reviewXmlObj->addCustomChild('shipping_method', null, array(
60
+ 'label' => $this->__('No shipping method required.')
61
+ ));
 
 
 
 
62
  } elseif ($this->getCanEditShippingMethod() || !$this->getCurrentShippingRate()) {
63
  if ($groups = $this->getShippingRateGroups()) {
64
  $currentRate = $this->getCurrentShippingRate();
65
  foreach ($groups as $code => $rates) {
66
  foreach ($rates as $rate) {
67
  if ($currentRate === $rate) {
68
+ $reviewXmlObj->addCustomChild('shipping_method', null, array(
69
+ 'rate' => strip_tags($this->renderShippingRateOption($rate)),
70
+ 'label' => $this->getCarrierName($code)
71
+ ));
 
 
 
 
72
  break(2);
73
  }
74
  }
75
  }
76
  }
77
  }
78
+ $reviewXmlObj->addCustomChild('payment_method', $this->escapeHtml($this->getPaymentMethodTitle()), array(
79
+ 'label' => $this->__('Payment Method')
80
+ ));
 
 
 
 
81
 
82
  $reviewXmlObj->addCustomChild(
83
  'billing_address',
84
+ Mage::helper('xmlconnect')->trimLineBreaks($this->getBillingAddress()->format('text')),
85
  array(
86
+ 'label' => $this->__('Billing Address'),
87
+ 'payer_email' => $this->__('Payer Email: %s', $this->getBillingAddress()->getEmail())
88
+ ));
 
89
 
90
  $this->getChild('details')->addDetailsToXmlObj($reviewXmlObj);
91
 
92
  return $reviewXmlObj->asNiceXml();
93
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php CHANGED
@@ -50,9 +50,9 @@ class Mage_XmlConnect_Block_Cart_Paypal_Mecl_Shippingmethods
50
  $methodListXmlObj->addAttribute('label', $this->__('Shipping Method'));
51
 
52
  if ($this->getCanEditShippingMethod() || !$this->getCurrentShippingRate()) {
53
- if ($groups = $this->getShippingRateGroups()) {
 
54
  $currentRate = $this->getCurrentShippingRate();
55
-
56
  foreach ($groups as $code => $rates) {
57
  $rateXmlObj = $this->_addRatesToXmlObj($methodListXmlObj, $code);
58
  foreach ($rates as $rate) {
@@ -63,36 +63,20 @@ class Mage_XmlConnect_Block_Cart_Paypal_Mecl_Shippingmethods
63
  if ($currentRate === $rate) {
64
  $rateAttributes += array('selected' => 1);
65
  }
66
- $rateXmlObj->addCustomChild(
67
- 'rate',
68
- null,
69
- $rateAttributes
70
- );
71
  }
72
  }
73
  } else {
74
- $message = $this->_quote->isVirtual()
75
- ? $this->__('No shipping method required.')
76
  : $this->__('Sorry, no quotes are available for this order at this time.');
77
- $methodListXmlObj->addCustomChild(
78
- 'method',
79
- null,
80
- array(
81
- 'label' => $message
82
- )
83
- );
84
  }
85
  } else {
86
  $rateXmlObj = $this->_addRatesToXmlObj($methodListXmlObj);
87
-
88
- $rateXmlObj->addCustomChild(
89
- 'rate',
90
- null,
91
- array(
92
- 'label' => $this->renderShippingRateOption($this->getCurrentShippingRate()),
93
- 'selected' => 1
94
- )
95
- );
96
  }
97
 
98
  return $methodListXmlObj->asNiceXml();
@@ -108,11 +92,6 @@ class Mage_XmlConnect_Block_Cart_Paypal_Mecl_Shippingmethods
108
  protected function _addRatesToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $methodListXmlObj, $code = '')
109
  {
110
  $attributes = $code ? array('label' => $this->getCarrierName($code)) : array();
111
- return $methodListXmlObj->addCustomChild(
112
- 'method',
113
- null,
114
- $attributes
115
- )
116
- ->addCustomChild('rates');
117
  }
118
  }
50
  $methodListXmlObj->addAttribute('label', $this->__('Shipping Method'));
51
 
52
  if ($this->getCanEditShippingMethod() || !$this->getCurrentShippingRate()) {
53
+ $groups = $this->getShippingRateGroups();
54
+ if ($groups) {
55
  $currentRate = $this->getCurrentShippingRate();
 
56
  foreach ($groups as $code => $rates) {
57
  $rateXmlObj = $this->_addRatesToXmlObj($methodListXmlObj, $code);
58
  foreach ($rates as $rate) {
63
  if ($currentRate === $rate) {
64
  $rateAttributes += array('selected' => 1);
65
  }
66
+ $rateXmlObj->addCustomChild('rate', null, $rateAttributes);
 
 
 
 
67
  }
68
  }
69
  } else {
70
+ $message = $this->_quote->isVirtual() ? $this->__('No shipping method required.')
 
71
  : $this->__('Sorry, no quotes are available for this order at this time.');
72
+ $methodListXmlObj->addCustomChild('method', null, array('label' => $message));
 
 
 
 
 
 
73
  }
74
  } else {
75
  $rateXmlObj = $this->_addRatesToXmlObj($methodListXmlObj);
76
+ $rateXmlObj->addCustomChild('rate', null, array(
77
+ 'label' => $this->renderShippingRateOption($this->getCurrentShippingRate()),
78
+ 'selected' => 1
79
+ ));
 
 
 
 
 
80
  }
81
 
82
  return $methodListXmlObj->asNiceXml();
92
  protected function _addRatesToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $methodListXmlObj, $code = '')
93
  {
94
  $attributes = $code ? array('label' => $this->getCarrierName($code)) : array();
95
+ return $methodListXmlObj->addCustomChild('method', null, $attributes)->addCustomChild('rates');
 
 
 
 
 
96
  }
97
  }
app/code/core/Mage/XmlConnect/Block/Cart/Totals.php CHANGED
@@ -42,7 +42,6 @@ class Mage_XmlConnect_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals
42
  {
43
  /** @var $totalsXmlObj Mage_XmlConnect_Model_Simplexml_Element */
44
  $totalsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<totals></totals>');
45
- // $taxConfig = Mage::getSingleton('tax/config');
46
 
47
  foreach ($this->getQuote()->getTotals() as $total) {
48
  $code = $total->getCode();
@@ -74,10 +73,7 @@ class Mage_XmlConnect_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals
74
  if ($renderer->displayBoth()) {
75
  $title = $renderer->getExcludeTaxLabel();
76
  $this->_addTotalDataToXmlObj(
77
- $totalsXmlObj,
78
- $code . '_excl_tax',
79
- $title,
80
- $renderer->getShippingExcludeTax()
81
  );
82
 
83
  $code = $code . '_incl_tax';
@@ -95,10 +91,7 @@ class Mage_XmlConnect_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals
95
  if ($displayBoth) {
96
  $title = $this->__('Grand Total (Excl. Tax)');
97
  $this->_addTotalDataToXmlObj(
98
- $totalsXmlObj,
99
- $code . '_excl_tax',
100
- $title,
101
- $grandTotalExlTax
102
  );
103
  $code = $code . '_incl_tax';
104
  $title = $this->__('Grand Total (Incl. Tax)');
42
  {
43
  /** @var $totalsXmlObj Mage_XmlConnect_Model_Simplexml_Element */
44
  $totalsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<totals></totals>');
 
45
 
46
  foreach ($this->getQuote()->getTotals() as $total) {
47
  $code = $total->getCode();
73
  if ($renderer->displayBoth()) {
74
  $title = $renderer->getExcludeTaxLabel();
75
  $this->_addTotalDataToXmlObj(
76
+ $totalsXmlObj, $code . '_excl_tax', $title, $renderer->getShippingExcludeTax()
 
 
 
77
  );
78
 
79
  $code = $code . '_incl_tax';
91
  if ($displayBoth) {
92
  $title = $this->__('Grand Total (Excl. Tax)');
93
  $this->_addTotalDataToXmlObj(
94
+ $totalsXmlObj, $code . '_excl_tax', $title, $grandTotalExlTax
 
 
 
95
  );
96
  $code = $code . '_incl_tax';
97
  $title = $this->__('Grand Total (Incl. Tax)');
app/code/core/Mage/XmlConnect/Block/Catalog/Category.php CHANGED
@@ -55,16 +55,14 @@ class Mage_XmlConnect_Block_Catalog_Category extends Mage_XmlConnect_Block_Catal
55
  $productListBlock = $this->getChild('product_list');
56
  if ($productListBlock && $categoryModel->getLevel() > 1) {
57
  $layer = Mage::getSingleton('catalog/layer');
58
- $productsXmlObj = $productListBlock->setCategory($categoryModel)
59
- ->setLayer($layer)
60
  ->getProductsXmlObject();
61
  $hasMoreProductItems = (int)$productListBlock->getHasProductItems();
62
  }
63
 
64
  $infoBlock = $this->getChild('category_info');
65
  if ($infoBlock) {
66
- $categoryInfoXmlObj = $infoBlock->setCategory($categoryModel)
67
- ->getCategoryInfoXmlObject();
68
  $categoryInfoXmlObj->addChild('has_more_items', $hasMoreProductItems);
69
  $categoryXmlObj->appendChild($categoryInfoXmlObj);
70
  }
@@ -86,11 +84,8 @@ class Mage_XmlConnect_Block_Catalog_Category extends Mage_XmlConnect_Block_Catal
86
  if (!is_null($categoryId)) {
87
  $itemXmlObj->addChild('parent_id', $item->getParentId());
88
  }
89
- $icon = Mage::helper('xmlconnect/catalog_category_image')
90
- ->initialize($item, 'thumbnail')
91
- ->resize(
92
- Mage::helper('xmlconnect/image')->getImageSizeForContent('category')
93
- );
94
 
95
  $iconXml = $itemXmlObj->addChild('icon', $icon);
96
 
55
  $productListBlock = $this->getChild('product_list');
56
  if ($productListBlock && $categoryModel->getLevel() > 1) {
57
  $layer = Mage::getSingleton('catalog/layer');
58
+ $productsXmlObj = $productListBlock->setCategory($categoryModel)->setLayer($layer)
 
59
  ->getProductsXmlObject();
60
  $hasMoreProductItems = (int)$productListBlock->getHasProductItems();
61
  }
62
 
63
  $infoBlock = $this->getChild('category_info');
64
  if ($infoBlock) {
65
+ $categoryInfoXmlObj = $infoBlock->setCategory($categoryModel)->getCategoryInfoXmlObject();
 
66
  $categoryInfoXmlObj->addChild('has_more_items', $hasMoreProductItems);
67
  $categoryXmlObj->appendChild($categoryInfoXmlObj);
68
  }
84
  if (!is_null($categoryId)) {
85
  $itemXmlObj->addChild('parent_id', $item->getParentId());
86
  }
87
+ $icon = Mage::helper('xmlconnect/catalog_category_image')->initialize($item, 'thumbnail')
88
+ ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('category'));
 
 
 
89
 
90
  $iconXml = $itemXmlObj->addChild('icon', $icon);
91
 
app/code/core/Mage/XmlConnect/Block/Catalog/Product.php CHANGED
@@ -95,14 +95,8 @@ class Mage_XmlConnect_Block_Catalog_Product extends Mage_XmlConnect_Block_Catalo
95
  Mage::getModel('review/review')->getEntitySummary($product, Mage::app()->getStore()->getId());
96
  }
97
 
98
- $item->addChild(
99
- 'rating_summary',
100
- round((int)$product->getRatingSummary()->getRatingSummary() / 10)
101
- );
102
- $item->addChild(
103
- 'reviews_count',
104
- $product->getRatingSummary()->getReviewsCount()
105
- );
106
 
107
  if ($this->getChild('product_price')) {
108
  $this->getChild('product_price')->setProduct($product)->setProductXmlObj($item)
@@ -158,7 +152,8 @@ class Mage_XmlConnect_Block_Catalog_Product extends Mage_XmlConnect_Block_Catalo
158
  }
159
  }
160
 
161
- $productOptions = $this->getChild('xmlconnect.catalog.product.options')->getProductOptionsXmlObject($product);
 
162
  if ($productOptions instanceof Mage_XmlConnect_Model_Simplexml_Element) {
163
  $productXmlObj->appendChild($productOptions);
164
  }
95
  Mage::getModel('review/review')->getEntitySummary($product, Mage::app()->getStore()->getId());
96
  }
97
 
98
+ $item->addChild('rating_summary', round((int)$product->getRatingSummary()->getRatingSummary() / 10));
99
+ $item->addChild('reviews_count', $product->getRatingSummary()->getReviewsCount());
 
 
 
 
 
 
100
 
101
  if ($this->getChild('product_price')) {
102
  $this->getChild('product_price')->setProduct($product)->setProductXmlObj($item)
152
  }
153
  }
154
 
155
+ $productOptions = $this->getChild('xmlconnect.catalog.product.options')
156
+ ->getProductOptionsXmlObject($product);
157
  if ($productOptions instanceof Mage_XmlConnect_Model_Simplexml_Element) {
158
  $productXmlObj->appendChild($productOptions);
159
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Catalog_Product_Attributes
35
- extends Mage_Catalog_Block_Product_View_Attributes
36
  {
37
  /**
38
  * Add additional information (attributes) to current product xml object
@@ -41,10 +40,8 @@ class Mage_XmlConnect_Block_Catalog_Product_Attributes
41
  * @param Mage_XmlConnect_Model_Simplexml_Element $productXmlObject
42
  */
43
  public function addAdditionalData(
44
- Mage_Catalog_Model_Product $product,
45
- Mage_XmlConnect_Model_Simplexml_Element $productXmlObject
46
- )
47
- {
48
  if ($product && $productXmlObject && $product->getId()) {
49
  $this->_product = $product;
50
  $additionalData = $this->getAdditionalData();
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Catalog_Product_Attributes extends Mage_Catalog_Block_Product_View_Attributes
 
35
  {
36
  /**
37
  * Add additional information (attributes) to current product xml object
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $productXmlObject
41
  */
42
  public function addAdditionalData(
43
+ Mage_Catalog_Model_Product $product, Mage_XmlConnect_Model_Simplexml_Element $productXmlObject
44
+ ) {
 
 
45
  if ($product && $productXmlObject && $product->getId()) {
46
  $this->_product = $product;
47
  $additionalData = $this->getAdditionalData();
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php CHANGED
@@ -41,9 +41,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Gallery extends Mage_XmlConnect_Bloc
41
  protected function _toHtml()
42
  {
43
  $productId = $this->getRequest()->getParam('id', null);
44
- $product = Mage::getModel('catalog/product')
45
- ->setStoreId(Mage::app()->getStore()->getId())
46
- ->load($productId);
47
  $collection = $product->getMediaGalleryImages();
48
 
49
  $imagesNode = Mage::getModel('xmlconnect/simplexml_element', '<images></images>');
@@ -55,9 +53,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Gallery extends Mage_XmlConnect_Bloc
55
  /**
56
  * Big image
57
  */
58
- $bigImage = $helper->init($product, 'image', $item->getFile())
59
- ->constrainOnly(true)
60
- ->keepFrame(false)
61
  ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('product_gallery_big'));
62
 
63
  $fileNode = $imageNode->addChild('file');
@@ -72,9 +68,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Gallery extends Mage_XmlConnect_Bloc
72
  /**
73
  * Small image
74
  */
75
- $smallImage = $helper->init($product, 'thumbnail', $item->getFile())
76
- ->constrainOnly(true)
77
- ->keepFrame(false)
78
  ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('product_gallery_small'));
79
 
80
  $fileNode = $imageNode->addChild('file');
41
  protected function _toHtml()
42
  {
43
  $productId = $this->getRequest()->getParam('id', null);
44
+ $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($productId);
 
 
45
  $collection = $product->getMediaGalleryImages();
46
 
47
  $imagesNode = Mage::getModel('xmlconnect/simplexml_element', '<images></images>');
53
  /**
54
  * Big image
55
  */
56
+ $bigImage = $helper->init($product, 'image', $item->getFile())->constrainOnly(true)->keepFrame(false)
 
 
57
  ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('product_gallery_big'));
58
 
59
  $fileNode = $imageNode->addChild('file');
68
  /**
69
  * Small image
70
  */
71
+ $smallImage = $helper->init($product, 'thumbnail', $item->getFile())->constrainOnly(true)->keepFrame(false)
 
 
72
  ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('product_gallery_small'));
73
 
74
  $fileNode = $imageNode->addChild('file');
app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php CHANGED
@@ -108,8 +108,7 @@ class Mage_XmlConnect_Block_Catalog_Product_List extends Mage_XmlConnect_Block_C
108
  $attributeCode = $attributeItem->getAttributeCode();
109
  list($filterModel, $filterBlock) = $this->helper('xmlconnect')->getFilterByKey($attributeCode);
110
 
111
- $filterModel->setLayer($layer)
112
- ->setAttributeModel($attributeItem);
113
 
114
  $filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $attributeCode;
115
  /**
@@ -126,9 +125,8 @@ class Mage_XmlConnect_Block_Catalog_Product_List extends Mage_XmlConnect_Block_C
126
  * Separately apply and save category filter
127
  */
128
  list($categoryFilter, $categoryFilterBlock) = $this->helper('xmlconnect')->getFilterByKey('category');
129
- $filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $categoryFilter->getRequestVar();
130
- $categoryFilter->setLayer($layer)
131
- ->setRequestVar($filterParam)
132
  ->apply($this->getRequest(), $categoryFilterBlock);
133
  $filters[] = $categoryFilter;
134
 
@@ -156,7 +154,6 @@ class Mage_XmlConnect_Block_Catalog_Product_List extends Mage_XmlConnect_Block_C
156
  $this->setHasProductItems(1);
157
  }
158
  $collection->getSelect()->limit($count, $offset);
159
-
160
  $collection->setFlag('require_stock_items', true);
161
 
162
  $this->_productCollection = $collection;
108
  $attributeCode = $attributeItem->getAttributeCode();
109
  list($filterModel, $filterBlock) = $this->helper('xmlconnect')->getFilterByKey($attributeCode);
110
 
111
+ $filterModel->setLayer($layer)->setAttributeModel($attributeItem);
 
112
 
113
  $filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $attributeCode;
114
  /**
125
  * Separately apply and save category filter
126
  */
127
  list($categoryFilter, $categoryFilterBlock) = $this->helper('xmlconnect')->getFilterByKey('category');
128
+ $filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $categoryFilter->getRequestVar();
129
+ $categoryFilter->setLayer($layer)->setRequestVar($filterParam)
 
130
  ->apply($this->getRequest(), $categoryFilterBlock);
131
  $filters[] = $categoryFilter;
132
 
154
  $this->setHasProductItems(1);
155
  }
156
  $collection->getSelect()->limit($count, $offset);
 
157
  $collection->setFlag('require_stock_items', true);
158
 
159
  $this->_productCollection = $collection;
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php CHANGED
@@ -97,18 +97,11 @@ class Mage_XmlConnect_Block_Catalog_Product_Options extends Mage_XmlConnect_Bloc
97
  */
98
  $price = $option->getPrice();
99
  if ($price) {
100
- $optionNode->addAttribute(
101
- 'price',
102
- Mage::helper('xmlconnect')->formatPriceForXml($price)
103
- );
104
- $formattedPrice = Mage::app()->getStore(
105
- $product->getStoreId())->formatPrice($price, false
106
- );
107
  $optionNode->addAttribute('formated_price', $formattedPrice);
108
  }
109
- if ($type == self::OPTION_TYPE_CHECKBOX
110
- || $type == self::OPTION_TYPE_SELECT
111
- ) {
112
  foreach ($option->getValues() as $value) {
113
  $valueNode = $optionNode->addChild('value');
114
  $valueNode->addAttribute('code', $value->getId());
@@ -139,12 +132,9 @@ class Mage_XmlConnect_Block_Catalog_Product_Options extends Mage_XmlConnect_Bloc
139
  $priceIncTax = Mage::helper('tax')->getPrice($product, $price, true);
140
 
141
  if (Mage::helper('tax')->displayBothPrices() && $priceTax != $priceIncTax) {
142
- $formatted = Mage::helper('core')->currency($priceTax, true, false)
143
- . ' (+'
144
- . Mage::helper('core')->currency($priceIncTax, true, false)
145
- . ' '
146
- . Mage::helper('tax')->__('Incl. Tax')
147
- . ')';
148
  } else {
149
  $formatted = $this->helper('core')->currency($priceTax, true, false);
150
  }
@@ -206,8 +196,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options extends Mage_XmlConnect_Bloc
206
  protected function _toHtml()
207
  {
208
  $productId = $this->getRequest()->getParam('id', null);
209
- $product = Mage::getModel('catalog/product')
210
- ->setStoreId(Mage::app()->getStore()->getId());
211
 
212
  if ($productId) {
213
  $product->load($productId);
97
  */
98
  $price = $option->getPrice();
99
  if ($price) {
100
+ $optionNode->addAttribute('price', Mage::helper('xmlconnect')->formatPriceForXml($price));
101
+ $formattedPrice = Mage::app()->getStore($product->getStoreId())->formatPrice($price, false);
 
 
 
 
 
102
  $optionNode->addAttribute('formated_price', $formattedPrice);
103
  }
104
+ if ($type == self::OPTION_TYPE_CHECKBOX || $type == self::OPTION_TYPE_SELECT) {
 
 
105
  foreach ($option->getValues() as $value) {
106
  $valueNode = $optionNode->addChild('value');
107
  $valueNode->addAttribute('code', $value->getId());
132
  $priceIncTax = Mage::helper('tax')->getPrice($product, $price, true);
133
 
134
  if (Mage::helper('tax')->displayBothPrices() && $priceTax != $priceIncTax) {
135
+ $formatted = Mage::helper('core')->currency($priceTax, true, false) . ' (+'
136
+ . Mage::helper('core')->currency($priceIncTax, true, false) . ' '
137
+ . Mage::helper('tax')->__('Incl. Tax') . ')';
 
 
 
138
  } else {
139
  $formatted = $this->helper('core')->currency($priceTax, true, false);
140
  }
196
  protected function _toHtml()
197
  {
198
  $productId = $this->getRequest()->getParam('id', null);
199
+ $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId());
 
200
 
201
  if ($productId) {
202
  $product->load($productId);
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php CHANGED
@@ -42,7 +42,6 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne
42
  */
43
  public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObject = false)
44
  {
45
-
46
  $xmlModel = $this->getProductCustomOptionsXmlObject($product);
47
  $optionsXmlObj = $xmlModel->options;
48
 
@@ -56,8 +55,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne
56
  $product->getTypeInstance(true)->setStoreFilter($product->getStoreId(), $product);
57
  $optionCollection = $product->getTypeInstance(true)->getOptionsCollection($product);
58
  $selectionCollection = $product->getTypeInstance(true)->getSelectionsCollection(
59
- $product->getTypeInstance(true)->getOptionsIds($product),
60
- $product
61
  );
62
  $bundleOptions = $optionCollection->appendSelections($selectionCollection, false, false);
63
  if (!sizeof($bundleOptions)) {
@@ -87,8 +85,6 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne
87
  $optionNode->addAttribute('is_required', 1);
88
  }
89
 
90
- // $_default = $_option->getDefaultSelection();
91
-
92
  foreach ($selections as $_selection) {
93
  if (!$_selection->isSaleable()) {
94
  continue;
@@ -113,7 +109,6 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne
113
  ));
114
  $valueNode->addAttribute('formated_price', $this->_formatPriceString($price, $product));
115
  }
116
- // $_selection->getIsDefault();
117
  }
118
  }
119
 
42
  */
43
  public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObject = false)
44
  {
 
45
  $xmlModel = $this->getProductCustomOptionsXmlObject($product);
46
  $optionsXmlObj = $xmlModel->options;
47
 
55
  $product->getTypeInstance(true)->setStoreFilter($product->getStoreId(), $product);
56
  $optionCollection = $product->getTypeInstance(true)->getOptionsCollection($product);
57
  $selectionCollection = $product->getTypeInstance(true)->getSelectionsCollection(
58
+ $product->getTypeInstance(true)->getOptionsIds($product), $product
 
59
  );
60
  $bundleOptions = $optionCollection->appendSelections($selectionCollection, false, false);
61
  if (!sizeof($bundleOptions)) {
85
  $optionNode->addAttribute('is_required', 1);
86
  }
87
 
 
 
88
  foreach ($selections as $_selection) {
89
  if (!$_selection->isSaleable()) {
90
  continue;
109
  ));
110
  $valueNode->addAttribute('formated_price', $this->_formatPriceString($price, $product));
111
  }
 
112
  }
113
  }
114
 
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php CHANGED
@@ -143,12 +143,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm
143
  $valueNode->addAttribute('formated_price', $option['formated_price']);
144
  }
145
  if (sizeof($_attributes) > 1) {
146
- $this->_prepareRecursivelyRelatedValues(
147
- $valueNode,
148
- $_attributes,
149
- $option['products'],
150
- 1
151
- );
152
  }
153
  }
154
  $isFirst = false;
@@ -204,12 +199,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm
204
  $_attrClone = $attributes;
205
  if (next($_attrClone) != false) {
206
  reset($_attrClone);
207
- $this->_prepareRecursivelyRelatedValues(
208
- $_valueNode,
209
- $_attrClone,
210
- $intersect,
211
- $cycle + 1
212
- );
213
  }
214
  }
215
  }
143
  $valueNode->addAttribute('formated_price', $option['formated_price']);
144
  }
145
  if (sizeof($_attributes) > 1) {
146
+ $this->_prepareRecursivelyRelatedValues($valueNode, $_attributes, $option['products'], 1);
 
 
 
 
 
147
  }
148
  }
149
  $isFirst = false;
199
  $_attrClone = $attributes;
200
  if (next($_attrClone) != false) {
201
  reset($_attrClone);
202
+ $this->_prepareRecursivelyRelatedValues($_valueNode, $_attrClone, $intersect, $cycle + 1);
 
 
 
 
 
203
  }
204
  }
205
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Catalog_Product_Options_Giftcard
35
- extends Mage_XmlConnect_Block_Catalog_Product_Options
36
  {
37
  /**
38
  * Get sender name
@@ -172,12 +171,9 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Giftcard
172
  if ($configValue == $price) {
173
  $amountNode->addAttribute('selected', 1);
174
  }
175
- $amountNode->addAttribute(
176
- 'formatted_price',
177
- $xmlModel->xmlAttribute(
178
- $coreHelper->currency($price, true, false)
179
- )
180
- );
181
  $amountNode->addAttribute('price', $price);
182
  }
183
  }
@@ -186,17 +182,13 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Giftcard
186
  /**
187
  * Render open amount options
188
  */
189
-
190
  /** @var $openAmountNode Mage_XmlConnect_Model_Simplexml_Element */
191
  $openAmountNode = $optionsXmlObj->addChild('open_amount');
192
  if ($product->getAllowOpenAmount()) {
193
  $openAmountNode->addAttribute('enabled', 1);
194
 
195
  if ($configValue == 'custom') {
196
- $openAmountNode->addAttribute(
197
- 'selected_amount',
198
- $this->getDefaultValue('custom_giftcard_amount')
199
- );
200
  }
201
  if ($priceModel->getMinAmount($product)) {
202
  $minPrice = $product->getOpenAmountMin();
@@ -204,10 +196,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Giftcard
204
  } else {
205
  $minAmount = $minPrice = 0;
206
  }
207
- $openAmountNode->addAttribute(
208
- 'formatted_min_amount',
209
- $xmlModel->xmlAttribute($minAmount)
210
- );
211
  $openAmountNode->addAttribute('min_amount', $minPrice);
212
 
213
  if ($priceModel->getMaxAmount($product)) {
@@ -216,10 +205,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Giftcard
216
  } else {
217
  $maxAmount = $maxPrice = 0;
218
  }
219
- $openAmountNode->addAttribute(
220
- 'formatted_max_amount',
221
- $xmlModel->xmlAttribute($maxAmount)
222
- );
223
  $openAmountNode->addAttribute('max_amount', $maxPrice);
224
  } else {
225
  $openAmountNode->addAttribute('enabled', 0);
@@ -228,89 +214,56 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Giftcard
228
  /**
229
  * Render Gift Card form options
230
  */
231
- $form = $optionsXmlObj->addCustomChild(
232
- 'form',
233
- null,
234
- array(
235
- 'name' => 'giftcard-send-form',
236
- 'method' => 'post'
237
- )
238
- );
239
 
240
- $senderFieldset = $form->addCustomChild(
241
- 'fieldset',
242
- null,
243
- array(
244
- 'legend' => $this->__('Sender Information')
245
- )
246
- );
247
 
248
- $senderFieldset->addField(
249
- 'giftcard_sender_name',
250
- 'text',
251
- array(
252
- 'label' => Mage::helper('enterprise_giftcard')->__('Sender Name'),
253
- 'required' => 'true',
254
- 'value' => $this->getSenderName()
255
- )
256
- );
257
 
258
- $recipientFieldset = $form->addCustomChild(
259
- 'fieldset',
260
- null,
261
- array(
262
- 'legend' => $this->__('Recipient Information')
263
- )
264
- );
265
 
266
- $recipientFieldset->addField(
267
- 'giftcard_recipient_name',
268
- 'text',
269
- array(
270
- 'label' => Mage::helper('enterprise_giftcard')->__('Recipient Name'),
271
- 'required' => 'true',
272
- 'value' => $this->getDefaultValue('giftcard_recipient_name')
273
- )
274
- );
275
 
276
  if ($this->isEmailAvailable($product)) {
277
- $senderFieldset->addField(
278
- 'giftcard_sender_email',
279
- 'email',
280
- array(
281
- 'label' => Mage::helper('enterprise_giftcard')->__('Sender Email'),
282
- 'required' => 'true',
283
- 'value' => $this->getSenderEmail()
284
- )
285
- );
286
 
287
- $recipientFieldset->addField(
288
- 'giftcard_recipient_email',
289
- 'email',
290
- array(
291
- 'label' => Mage::helper('enterprise_giftcard')->__('Recipient Email'),
292
- 'required' => 'true',
293
- 'value' => $this->getDefaultValue('giftcard_recipient_email')
294
- )
295
- );
296
  }
297
 
298
  if ($this->isMessageAvailable($product)) {
299
  $messageMaxLength = (int) Mage::getStoreConfig(
300
  Enterprise_GiftCard_Model_Giftcard::XML_PATH_MESSAGE_MAX_LENGTH
301
  );
302
- $recipientFieldset->addField(
303
- 'giftcard_message',
304
- 'textarea',
305
- array(
306
- 'label' => Mage::helper('enterprise_giftcard')->__('Message'),
307
- 'required' => 'false',
308
- 'max_length'=> $messageMaxLength,
309
- 'value' => $this->getDefaultValue('giftcard_message')
310
- )
311
- );
312
  }
313
-
314
  return $isObject ? $xmlModel : $xmlModel->asNiceXml();
315
  }
316
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Catalog_Product_Options_Giftcard extends Mage_XmlConnect_Block_Catalog_Product_Options
 
35
  {
36
  /**
37
  * Get sender name
171
  if ($configValue == $price) {
172
  $amountNode->addAttribute('selected', 1);
173
  }
174
+ $amountNode->addAttribute('formatted_price', $xmlModel->xmlAttribute(
175
+ $coreHelper->currency($price, true, false)
176
+ ));
 
 
 
177
  $amountNode->addAttribute('price', $price);
178
  }
179
  }
182
  /**
183
  * Render open amount options
184
  */
 
185
  /** @var $openAmountNode Mage_XmlConnect_Model_Simplexml_Element */
186
  $openAmountNode = $optionsXmlObj->addChild('open_amount');
187
  if ($product->getAllowOpenAmount()) {
188
  $openAmountNode->addAttribute('enabled', 1);
189
 
190
  if ($configValue == 'custom') {
191
+ $openAmountNode->addAttribute('selected_amount', $this->getDefaultValue('custom_giftcard_amount'));
 
 
 
192
  }
193
  if ($priceModel->getMinAmount($product)) {
194
  $minPrice = $product->getOpenAmountMin();
196
  } else {
197
  $minAmount = $minPrice = 0;
198
  }
199
+ $openAmountNode->addAttribute('formatted_min_amount', $xmlModel->xmlAttribute($minAmount));
 
 
 
200
  $openAmountNode->addAttribute('min_amount', $minPrice);
201
 
202
  if ($priceModel->getMaxAmount($product)) {
205
  } else {
206
  $maxAmount = $maxPrice = 0;
207
  }
208
+ $openAmountNode->addAttribute('formatted_max_amount', $xmlModel->xmlAttribute($maxAmount));
 
 
 
209
  $openAmountNode->addAttribute('max_amount', $maxPrice);
210
  } else {
211
  $openAmountNode->addAttribute('enabled', 0);
214
  /**
215
  * Render Gift Card form options
216
  */
217
+ $form = $optionsXmlObj->addCustomChild('form', null, array(
218
+ 'name' => 'giftcard-send-form',
219
+ 'method' => 'post'
220
+ ));
 
 
 
 
221
 
222
+ $senderFieldset = $form->addCustomChild('fieldset', null, array(
223
+ 'legend' => $this->__('Sender Information')
224
+ ));
 
 
 
 
225
 
226
+ $senderFieldset->addField('giftcard_sender_name', 'text', array(
227
+ 'label' => Mage::helper('enterprise_giftcard')->__('Sender Name'),
228
+ 'required' => 'true',
229
+ 'value' => $this->getSenderName()
230
+ ));
 
 
 
 
231
 
232
+ $recipientFieldset = $form->addCustomChild('fieldset', null, array(
233
+ 'legend' => $this->__('Recipient Information')
234
+ ));
 
 
 
 
235
 
236
+ $recipientFieldset->addField('giftcard_recipient_name', 'text', array(
237
+ 'label' => Mage::helper('enterprise_giftcard')->__('Recipient Name'),
238
+ 'required' => 'true',
239
+ 'value' => $this->getDefaultValue('giftcard_recipient_name')
240
+ ));
 
 
 
 
241
 
242
  if ($this->isEmailAvailable($product)) {
243
+ $senderFieldset->addField('giftcard_sender_email', 'email', array(
244
+ 'label' => Mage::helper('enterprise_giftcard')->__('Sender Email'),
245
+ 'required' => 'true',
246
+ 'value' => $this->getSenderEmail()
247
+ ));
 
 
 
 
248
 
249
+ $recipientFieldset->addField('giftcard_recipient_email', 'email', array(
250
+ 'label' => Mage::helper('enterprise_giftcard')->__('Recipient Email'),
251
+ 'required' => 'true',
252
+ 'value' => $this->getDefaultValue('giftcard_recipient_email')
253
+ ));
 
 
 
 
254
  }
255
 
256
  if ($this->isMessageAvailable($product)) {
257
  $messageMaxLength = (int) Mage::getStoreConfig(
258
  Enterprise_GiftCard_Model_Giftcard::XML_PATH_MESSAGE_MAX_LENGTH
259
  );
260
+ $recipientFieldset->addField('giftcard_message', 'textarea', array(
261
+ 'label' => Mage::helper('enterprise_giftcard')->__('Message'),
262
+ 'required' => 'false',
263
+ 'max_length'=> $messageMaxLength,
264
+ 'value' => $this->getDefaultValue('giftcard_message')
265
+ ));
 
 
 
 
266
  }
 
267
  return $isObject ? $xmlModel : $xmlModel->asNiceXml();
268
  }
269
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php CHANGED
@@ -83,16 +83,10 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Grouped extends Mage_XmlConn
83
 
84
  if ($productPrice != 0) {
85
  $productPrice = Mage::helper('xmlconnect')->formatPriceForXml($productPrice);
86
- $optionNode->addAttribute(
87
- 'price',
88
- Mage::helper('xmlconnect')->formatPriceForXml(
89
- Mage::helper('core')->currency($productPrice, false, false)
90
- )
91
- );
92
- $optionNode->addAttribute(
93
- 'formated_price',
94
- $this->_formatPriceString($productPrice, $product)
95
- );
96
  }
97
  }
98
 
83
 
84
  if ($productPrice != 0) {
85
  $productPrice = Mage::helper('xmlconnect')->formatPriceForXml($productPrice);
86
+ $optionNode->addAttribute('price', Mage::helper('xmlconnect')->formatPriceForXml(
87
+ Mage::helper('core')->currency($productPrice, false, false)
88
+ ));
89
+ $optionNode->addAttribute('formated_price', $this->_formatPriceString($productPrice, $product));
 
 
 
 
 
 
90
  }
91
  }
92
 
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Catalog_Product_Options_Simple
35
- extends Mage_XmlConnect_Block_Catalog_Product_Options
36
  {
37
  /**
38
  * Generate simple product options xml
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Catalog_Product_Options_Simple extends Mage_XmlConnect_Block_Catalog_Product_Options
 
35
  {
36
  /**
37
  * Generate simple product options xml
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Catalog_Product_Options_Virtual
35
- extends Mage_XmlConnect_Block_Catalog_Product_Options
36
  {
37
  /**
38
  * Generate virtual product options xml
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Catalog_Product_Options_Virtual extends Mage_XmlConnect_Block_Catalog_Product_Options
 
35
  {
36
  /**
37
  * Generate virtual product options xml
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
35
- extends Mage_Bundle_Block_Catalog_Product_Price
36
  {
37
  /**
38
  * Collect product prices to specified item xml object
@@ -41,13 +40,9 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
41
  * @param Mage_XmlConnect_Model_Simplexml_Element $item
42
  */
43
  public function collectProductPrices(
44
- Mage_Catalog_Model_Product $product,
45
- Mage_XmlConnect_Model_Simplexml_Element $item
46
- )
47
- {
48
- $this->setProduct($product)
49
- ->setDisplayMinimalPrice(true)
50
- ->setUseLinkForAsLowAs(false);
51
 
52
  $priceXmlObj = $item->addChild('price');
53
 
@@ -93,8 +88,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
93
  if ($product->getPriceView()) {
94
  if ($_taxHelper->displayBothPrices()) {
95
  $priceXmlObj->addAttribute(
96
- 'as_low_as_excluding_tax',
97
- $_coreHelper->currency($_minimalPriceTax, true, false)
98
  );
99
  if ($_weeeTaxAmount && $product->getPriceType() == 1
100
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
@@ -118,13 +112,11 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
118
  }
119
  }
120
  $priceXmlObj->addAttribute(
121
- 'as_low_as_including_tax',
122
- $_coreHelper->currency($_minimalPriceInclTax, true, false)
123
  );
124
  } else {
125
  $priceXmlObj->addAttribute(
126
- 'as_low_as',
127
- $_coreHelper->currency($_minimalPriceTax, true, false)
128
  );
129
  if ($_weeeTaxAmount && $product->getPriceType() == 1
130
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
@@ -142,13 +134,14 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
142
  $weeeItemXmlObj->addAttribute(
143
  'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
144
  );
145
- $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency($amount, true, false));
 
 
146
  }
147
  }
148
  if ($_weeeHelper->typeOfDisplay($product, 2) && $_weeeTaxAmount) {
149
  $priceXmlObj->addAttribute(
150
- 'as_low_as_including_tax',
151
- $_coreHelper->currency($_minimalPriceInclTax, true, false)
152
  );
153
  }
154
  }
@@ -159,8 +152,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
159
  if ($_minimalPrice <> $_maximalPrice) {
160
  if ($_taxHelper->displayBothPrices()) {
161
  $priceXmlObj->addAttribute(
162
- 'from_excluding_tax',
163
- $_coreHelper->currency($_minimalPriceTax, true, false)
164
  );
165
  if ($_weeeTaxAmount && $product->getPriceType() == 1
166
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
@@ -178,18 +170,16 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
178
  $weeeItemXmlObj->addAttribute(
179
  'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
180
  );
181
- $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency($amount, true, false));
 
 
182
  }
183
  }
184
  $priceXmlObj->addAttribute(
185
- 'from_including_tax',
186
- $_coreHelper->currency($_minimalPriceInclTax, true, false)
187
  );
188
  } else {
189
- $priceXmlObj->addAttribute(
190
- 'from',
191
- $_coreHelper->currency($_minimalPriceTax, true, false)
192
- );
193
  if ($_weeeTaxAmount && $product->getPriceType() == 1
194
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
195
  ) {
@@ -211,8 +201,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
211
  }
212
  if ($_weeeHelper->typeOfDisplay($product, 2) && $_weeeTaxAmount) {
213
  $priceXmlObj->addAttribute(
214
- 'from_including_tax',
215
- $_coreHelper->currency($_minimalPriceInclTax, true, false)
216
  );
217
  }
218
  }
@@ -232,8 +221,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
232
 
233
  if ($_taxHelper->displayBothPrices()) {
234
  $priceXmlObj->addAttribute(
235
- 'to_excluding_tax',
236
- $_coreHelper->currency($_maximalPriceTax, true, false)
237
  );
238
  if ($_weeeTaxAmount && $product->getPriceType() == 1
239
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
@@ -251,14 +239,18 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
251
  $weeeItemXmlObj->addAttribute(
252
  'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
253
  );
254
- $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency($amount, true, false));
 
 
255
  }
256
  }
257
  $priceXmlObj->addAttribute(
258
  'to_including_tax', $_coreHelper->currency($_maximalPriceInclTax, true, false)
259
  );
260
  } else {
261
- $priceXmlObj->addAttribute('to', $_coreHelper->currency($_maximalPriceTax, true, false));
 
 
262
  if ($_weeeTaxAmount && $product->getPriceType() == 1
263
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
264
  ) {
@@ -273,19 +265,16 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
273
  }
274
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
275
  $weeeItemXmlObj->addAttribute(
276
- 'name',
277
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
278
  );
279
  $weeeItemXmlObj->addAttribute(
280
- 'amount',
281
- $_coreHelper->currency($amount, true, false)
282
  );
283
  }
284
  }
285
  if ($_weeeHelper->typeOfDisplay($product, 2) && $_weeeTaxAmount) {
286
  $priceXmlObj->addAttribute(
287
- 'to_including_tax',
288
- $_coreHelper->currency($_maximalPriceInclTax, true, false)
289
  );
290
  }
291
  }
@@ -295,8 +284,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
295
  } else {
296
  if ($_taxHelper->displayBothPrices()) {
297
  $priceXmlObj->addAttribute(
298
- 'excluding_tax',
299
- $_coreHelper->currency($_minimalPriceTax, true, false)
300
  );
301
  if ($_weeeTaxAmount && $product->getPriceType() == 1
302
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
@@ -312,23 +300,19 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
312
  }
313
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
314
  $weeeItemXmlObj->addAttribute(
315
- 'name',
316
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
317
  );
318
  $weeeItemXmlObj->addAttribute(
319
- 'amount',
320
- $_coreHelper->currency($amount, true, false)
321
  );
322
  }
323
  }
324
  $priceXmlObj->addAttribute(
325
- 'including_tax',
326
- $_coreHelper->currency($_minimalPriceInclTax, true, false)
327
  );
328
  } else {
329
  $priceXmlObj->addAttribute(
330
- 'regular',
331
- $_coreHelper->currency($_minimalPriceTax, true, false)
332
  );
333
  if ($_weeeTaxAmount && $product->getPriceType() == 1
334
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
@@ -344,19 +328,16 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
344
  }
345
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
346
  $weeeItemXmlObj->addAttribute(
347
- 'name',
348
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
349
  );
350
  $weeeItemXmlObj->addAttribute(
351
- 'amount',
352
- $_coreHelper->currency($amount, true, false)
353
  );
354
  }
355
  }
356
  if ($_weeeHelper->typeOfDisplay($product, 2) && $_weeeTaxAmount) {
357
  $priceXmlObj->addAttribute(
358
- 'including_tax',
359
- $_coreHelper->currency($_minimalPriceInclTax, true, false)
360
  );
361
  }
362
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Block_Catalog_Product_Price
 
35
  {
36
  /**
37
  * Collect product prices to specified item xml object
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $item
41
  */
42
  public function collectProductPrices(
43
+ Mage_Catalog_Model_Product $product, Mage_XmlConnect_Model_Simplexml_Element $item
44
+ ) {
45
+ $this->setProduct($product)->setDisplayMinimalPrice(true) ->setUseLinkForAsLowAs(false);
 
 
 
 
46
 
47
  $priceXmlObj = $item->addChild('price');
48
 
88
  if ($product->getPriceView()) {
89
  if ($_taxHelper->displayBothPrices()) {
90
  $priceXmlObj->addAttribute(
91
+ 'as_low_as_excluding_tax', $_coreHelper->currency($_minimalPriceTax, true, false)
 
92
  );
93
  if ($_weeeTaxAmount && $product->getPriceType() == 1
94
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
112
  }
113
  }
114
  $priceXmlObj->addAttribute(
115
+ 'as_low_as_including_tax', $_coreHelper->currency($_minimalPriceInclTax, true, false)
 
116
  );
117
  } else {
118
  $priceXmlObj->addAttribute(
119
+ 'as_low_as', $_coreHelper->currency($_minimalPriceTax, true, false)
 
120
  );
121
  if ($_weeeTaxAmount && $product->getPriceType() == 1
122
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
134
  $weeeItemXmlObj->addAttribute(
135
  'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
136
  );
137
+ $weeeItemXmlObj->addAttribute(
138
+ 'amount', $_coreHelper->currency($amount, true, false)
139
+ );
140
  }
141
  }
142
  if ($_weeeHelper->typeOfDisplay($product, 2) && $_weeeTaxAmount) {
143
  $priceXmlObj->addAttribute(
144
+ 'as_low_as_including_tax', $_coreHelper->currency($_minimalPriceInclTax, true, false)
 
145
  );
146
  }
147
  }
152
  if ($_minimalPrice <> $_maximalPrice) {
153
  if ($_taxHelper->displayBothPrices()) {
154
  $priceXmlObj->addAttribute(
155
+ 'from_excluding_tax', $_coreHelper->currency($_minimalPriceTax, true, false)
 
156
  );
157
  if ($_weeeTaxAmount && $product->getPriceType() == 1
158
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
170
  $weeeItemXmlObj->addAttribute(
171
  'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
172
  );
173
+ $weeeItemXmlObj->addAttribute(
174
+ 'amount', $_coreHelper->currency($amount, true, false)
175
+ );
176
  }
177
  }
178
  $priceXmlObj->addAttribute(
179
+ 'from_including_tax', $_coreHelper->currency($_minimalPriceInclTax, true, false)
 
180
  );
181
  } else {
182
+ $priceXmlObj->addAttribute('from', $_coreHelper->currency($_minimalPriceTax, true, false));
 
 
 
183
  if ($_weeeTaxAmount && $product->getPriceType() == 1
184
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
185
  ) {
201
  }
202
  if ($_weeeHelper->typeOfDisplay($product, 2) && $_weeeTaxAmount) {
203
  $priceXmlObj->addAttribute(
204
+ 'from_including_tax', $_coreHelper->currency($_minimalPriceInclTax, true, false)
 
205
  );
206
  }
207
  }
221
 
222
  if ($_taxHelper->displayBothPrices()) {
223
  $priceXmlObj->addAttribute(
224
+ 'to_excluding_tax', $_coreHelper->currency($_maximalPriceTax, true, false)
 
225
  );
226
  if ($_weeeTaxAmount && $product->getPriceType() == 1
227
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
239
  $weeeItemXmlObj->addAttribute(
240
  'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
241
  );
242
+ $weeeItemXmlObj->addAttribute(
243
+ 'amount', $_coreHelper->currency($amount, true, false)
244
+ );
245
  }
246
  }
247
  $priceXmlObj->addAttribute(
248
  'to_including_tax', $_coreHelper->currency($_maximalPriceInclTax, true, false)
249
  );
250
  } else {
251
+ $priceXmlObj->addAttribute(
252
+ 'to', $_coreHelper->currency($_maximalPriceTax, true, false)
253
+ );
254
  if ($_weeeTaxAmount && $product->getPriceType() == 1
255
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
256
  ) {
265
  }
266
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
267
  $weeeItemXmlObj->addAttribute(
268
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
269
  );
270
  $weeeItemXmlObj->addAttribute(
271
+ 'amount', $_coreHelper->currency($amount, true, false)
 
272
  );
273
  }
274
  }
275
  if ($_weeeHelper->typeOfDisplay($product, 2) && $_weeeTaxAmount) {
276
  $priceXmlObj->addAttribute(
277
+ 'to_including_tax', $_coreHelper->currency($_maximalPriceInclTax, true, false)
 
278
  );
279
  }
280
  }
284
  } else {
285
  if ($_taxHelper->displayBothPrices()) {
286
  $priceXmlObj->addAttribute(
287
+ 'excluding_tax', $_coreHelper->currency($_minimalPriceTax, true, false)
 
288
  );
289
  if ($_weeeTaxAmount && $product->getPriceType() == 1
290
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
300
  }
301
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
302
  $weeeItemXmlObj->addAttribute(
303
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
304
  );
305
  $weeeItemXmlObj->addAttribute(
306
+ 'amount', $_coreHelper->currency($amount, true, false)
 
307
  );
308
  }
309
  }
310
  $priceXmlObj->addAttribute(
311
+ 'including_tax', $_coreHelper->currency($_minimalPriceInclTax, true, false)
 
312
  );
313
  } else {
314
  $priceXmlObj->addAttribute(
315
+ 'regular', $_coreHelper->currency($_minimalPriceTax, true, false)
 
316
  );
317
  if ($_weeeTaxAmount && $product->getPriceType() == 1
318
  && $_weeeHelper->typeOfDisplay($product, array(2, 1, 4))
328
  }
329
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
330
  $weeeItemXmlObj->addAttribute(
331
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
332
  );
333
  $weeeItemXmlObj->addAttribute(
334
+ 'amount', $_coreHelper->currency($amount, true, false)
 
335
  );
336
  }
337
  }
338
  if ($_weeeHelper->typeOfDisplay($product, 2) && $_weeeTaxAmount) {
339
  $priceXmlObj->addAttribute(
340
+ 'including_tax', $_coreHelper->currency($_minimalPriceInclTax, true, false)
 
341
  );
342
  }
343
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Catalog_Product_Price_Default
35
- extends Mage_Catalog_Block_Product_Price
36
  {
37
  /**
38
  * Collect product prices to specified item xml object
@@ -41,13 +40,9 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
41
  * @param Mage_XmlConnect_Model_Simplexml_Element $item
42
  */
43
  public function collectProductPrices(
44
- Mage_Catalog_Model_Product $product,
45
- Mage_XmlConnect_Model_Simplexml_Element $item
46
- )
47
- {
48
- $this->setProduct($product)
49
- ->setDisplayMinimalPrice(true)
50
- ->setUseLinkForAsLowAs(false);
51
 
52
  $priceXmlObj = $item->addChild('price');
53
  $_tierPrices = $this->_getTierPrices($product);
@@ -86,24 +81,20 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
86
  */
87
  if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 0)) {
88
  $priceXmlObj->addAttribute(
89
- 'excluding_tax',
90
- $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
91
  );
92
  $priceXmlObj->addAttribute(
93
- 'including_tax',
94
- $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmount, true, false)
95
  );
96
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 1)) {
97
  /**
98
  * Including + Weee
99
  */
100
  $priceXmlObj->addAttribute(
101
- 'excluding_tax',
102
- $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
103
  );
104
  $priceXmlObj->addAttribute(
105
- 'including_tax',
106
- $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmount, true, false)
107
  );
108
  $weeeXmlObj = $priceXmlObj->addChild('weee');
109
  $_weeeSeparator = ' + ';
@@ -111,12 +102,10 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
111
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
112
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
113
  $weeeItemXmlObj->addAttribute(
114
- 'name',
115
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
116
  );
117
  $weeeItemXmlObj->addAttribute(
118
- 'amount',
119
- $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
120
  );
121
  }
122
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 4)) {
@@ -124,12 +113,10 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
124
  * Including + Weee
125
  */
126
  $priceXmlObj->addAttribute(
127
- 'excluding_tax',
128
- $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
129
  );
130
  $priceXmlObj->addAttribute(
131
- 'including_tax',
132
- $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmount, true, false)
133
  );
134
  $weeeXmlObj = $priceXmlObj->addChild('weee');
135
  $_weeeSeparator = ' + ';
@@ -137,54 +124,34 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
137
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
138
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
139
  $weeeItemXmlObj->addAttribute(
140
- 'name',
141
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
142
- );
143
- $weeeItemXmlObj->addAttribute(
144
- 'amount',
145
- $_coreHelper->currency(
146
- $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(),
147
- true,
148
- false
149
- )
150
  );
 
 
 
151
  }
152
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 2)) {
153
  /**
154
  * Excluding + Weee + Final
155
  */
156
- $priceXmlObj->addAttribute(
157
- 'excluding_tax',
158
- $_coreHelper->currency($_price, true, false)
159
- );
160
  $weeeXmlObj = $priceXmlObj->addChild('weee');
161
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
162
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
163
  $weeeItemXmlObj->addAttribute(
164
- 'name',
165
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
166
  );
167
  $weeeItemXmlObj->addAttribute(
168
- 'amount',
169
- $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
170
  );
171
  }
172
- $priceXmlObj->addAttribute(
173
- 'including_tax',
174
- $_coreHelper->currency(
175
- $_finalPriceInclTax + $_weeeTaxAmount,
176
- true,
177
- false
178
- )
179
- );
180
  } else {
 
181
  $priceXmlObj->addAttribute(
182
- 'excluding_tax',
183
- $_coreHelper->currency($_price, true, false)
184
- );
185
- $priceXmlObj->addAttribute(
186
- 'including_tax',
187
- $_coreHelper->currency($_finalPriceInclTax, true, false)
188
  );
189
  }
190
  /**
@@ -195,100 +162,69 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
195
  * Including
196
  */
197
  if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 0)) {
198
- $priceXmlObj->addAttribute(
199
- 'regular',
200
- $_coreHelper->currency(
201
- $_price + $_weeeTaxAmount,
202
- true,
203
- false
204
- )
205
- );
206
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 1)) {
207
  /**
208
  * Including + Weee
209
  */
210
-
211
- $priceXmlObj->addAttribute(
212
- 'regular',
213
- $_coreHelper->currency(
214
- $_price + $_weeeTaxAmount,
215
- true,
216
- false
217
- )
218
- );
219
  $weeeXmlObj = $priceXmlObj->addChild('weee');
220
  $_weeeSeparator = ' + ';
221
  $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
222
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
223
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
224
  $weeeItemXmlObj->addAttribute(
225
- 'name',
226
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
227
  );
228
  $weeeItemXmlObj->addAttribute(
229
- 'amount',
230
- $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
231
  );
232
  }
233
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 4)) {
234
  /**
235
  * Including + Weee
236
  */
237
- $priceXmlObj->addAttribute(
238
- 'regular',
239
- $_coreHelper->currency(
240
- $_price + $_weeeTaxAmount,
241
- true,
242
- false
243
- )
244
- );
245
  $weeeXmlObj = $priceXmlObj->addChild('weee');
246
  $_weeeSeparator = ' + ';
247
  $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
248
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
249
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
250
  $weeeItemXmlObj->addAttribute(
251
- 'name',
252
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
253
- );
254
- $weeeItemXmlObj->addAttribute(
255
- 'amount',
256
- $_coreHelper->currency(
257
- $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(),
258
- true,
259
- false
260
- )
261
  );
 
 
 
262
  }
263
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 2)) {
264
  /**
265
  * Excluding + Weee + Final
266
  */
267
  $priceXmlObj->addAttribute(
268
- 'regular',
269
- $_coreHelper->currency($_price, true, false)
270
  );
271
  $weeeXmlObj = $priceXmlObj->addChild('weee');
272
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
273
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
274
  $weeeItemXmlObj->addAttribute(
275
- 'name',
276
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
277
  );
278
  $weeeItemXmlObj->addAttribute(
279
- 'amount',
280
- $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
281
  );
282
  }
283
  $priceXmlObj->addAttribute(
284
- 'including_tax',
285
- $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
286
  );
287
  } else {
288
- $priceXmlObj->addAttribute(
289
- 'regular',
290
- $_coreHelper->currency($_price, true, false)
291
- );
292
  }
293
  }
294
  /**
@@ -300,190 +236,107 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
300
  * Including
301
  */
302
  if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 0)) {
303
- $priceXmlObj->addAttribute(
304
- 'regular',
305
- $_coreHelper->currency(
306
- $_regularPrice + $_originalWeeeTaxAmount,
307
- true,
308
- false
309
- )
310
- );
311
  if ($_taxHelper->displayBothPrices()) {
312
- $priceXmlObj->addAttribute(
313
- 'special_excluding_tax',
314
- $_coreHelper->currency(
315
- $_finalPrice + $_weeeTaxAmount,
316
- true,
317
- false
318
- )
319
- );
320
- $priceXmlObj->addAttribute(
321
- 'special_including_tax',
322
- $_coreHelper->currency(
323
- $_finalPriceInclTax + $_weeeTaxAmount,
324
- true,
325
- false
326
- )
327
- );
328
  } else {
329
- $priceXmlObj->addAttribute(
330
- 'special',
331
- $_coreHelper->currency(
332
- $_finalPrice + $_weeeTaxAmount,
333
- true,
334
- false
335
- )
336
- );
337
  }
338
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 1)) {
339
  /**
340
  * Including + Weee
341
  */
342
- $priceXmlObj->addAttribute(
343
- 'regular',
344
- $_coreHelper->currency(
345
- $_regularPrice + $_originalWeeeTaxAmount,
346
- true,
347
- false
348
- )
349
- );
350
- $priceXmlObj->addAttribute(
351
- 'special_excluding_tax',
352
- $_coreHelper->currency(
353
- $_finalPrice + $_weeeTaxAmount,
354
- true,
355
- false
356
- )
357
- );
358
  $weeeXmlObj = $priceXmlObj->addChild('weee');
359
  $_weeeSeparator = ' + ';
360
  $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
361
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
362
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
363
  $weeeItemXmlObj->addAttribute(
364
- 'name',
365
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
366
- );
367
- $weeeItemXmlObj->addAttribute(
368
- 'amount',
369
- $_coreHelper->currency(
370
- $_weeeTaxAttribute->getAmount(),
371
- true,
372
- false
373
- )
374
  );
 
 
 
375
  }
376
- $priceXmlObj->addAttribute(
377
- 'special_including_tax',
378
- $_coreHelper->currency(
379
- $_finalPriceInclTax + $_weeeTaxAmount,
380
- true,
381
- false
382
- )
383
- );
384
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 4)) {
385
  /**
386
  * Including + Weee
387
  */
388
- $priceXmlObj->addAttribute(
389
- 'regular',
390
- $_coreHelper->currency(
391
- $_regularPrice + $_originalWeeeTaxAmount,
392
- true,
393
- false
394
- )
395
- );
396
- $priceXmlObj->addAttribute(
397
- 'special_excluding_tax',
398
- $_coreHelper->currency(
399
- $_finalPrice + $_weeeTaxAmount,
400
- true,
401
- false
402
- )
403
- );
404
  $weeeXmlObj = $priceXmlObj->addChild('weee');
405
  $_weeeSeparator = ' + ';
406
  $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
407
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
408
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
409
  $weeeItemXmlObj->addAttribute(
410
- 'name',
411
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
412
- );
413
- $weeeItemXmlObj->addAttribute(
414
- 'amount',
415
- $_coreHelper->currency(
416
- $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(),
417
- true,
418
- false
419
- )
420
  );
 
 
 
421
  }
422
- $priceXmlObj->addAttribute(
423
- 'special_including_tax',
424
- $_coreHelper->currency(
425
- $_finalPriceInclTax + $_weeeTaxAmount,
426
- true,
427
- false
428
- )
429
- );
430
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 2)) {
431
  /**
432
  * Excluding + Weee + Final
433
  */
 
434
  $priceXmlObj->addAttribute(
435
- 'regular',
436
- $_coreHelper->currency($_regularPrice, true, false)
437
- );
438
- $priceXmlObj->addAttribute(
439
- 'special_excluding_tax',
440
- $_coreHelper->currency($_finalPrice, true, false)
441
  );
442
  $weeeXmlObj = $priceXmlObj->addChild('weee');
443
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
444
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
445
  $weeeItemXmlObj->addAttribute(
446
- 'name',
447
- $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
448
- );
449
- $weeeItemXmlObj->addAttribute(
450
- 'amount',
451
- $_coreHelper->currency(
452
- $_weeeTaxAttribute->getAmount(),
453
- true,
454
- false
455
- )
456
  );
 
 
 
457
  }
458
- $priceXmlObj->addAttribute(
459
- 'special_including_tax',
460
- $_coreHelper->currency(
461
- $_finalPriceInclTax + $_weeeTaxAmount,
462
- true,
463
- false
464
- )
465
- );
466
  } else {
467
  /**
468
  * Excluding
469
  */
470
- $priceXmlObj->addAttribute(
471
- 'regular',
472
- $_coreHelper->currency($_regularPrice, true, false)
473
- );
474
  if ($_taxHelper->displayBothPrices()) {
475
  $priceXmlObj->addAttribute(
476
- 'special_excluding_tax',
477
- $_coreHelper->currency($_finalPrice, true, false)
478
  );
479
  $priceXmlObj->addAttribute(
480
- 'special_including_tax',
481
- $_coreHelper->currency($_finalPriceInclTax, true, false)
482
  );
483
  } else {
484
  $priceXmlObj->addAttribute(
485
- 'special',
486
- $_coreHelper->currency($_finalPrice, true, false)
487
  );
488
  }
489
  }
@@ -500,14 +353,9 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
500
  }
501
 
502
  if (!$this->getUseLinkForAsLowAs()) {
503
- $priceXmlObj->addAttribute(
504
- 'as_low_as',
505
- $_coreHelper->currency(
506
- $_minimalPriceDisplayValue,
507
- true,
508
- false
509
- )
510
- );
511
  }
512
  }
513
  /**
@@ -519,35 +367,18 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
519
 
520
  if ($this->getDisplayMinimalPrice() && $_minimalPriceValue) {
521
  if ($_taxHelper->displayBothPrices()) {
522
- $priceXmlObj->addAttribute(
523
- 'starting_at_excluding_tax',
524
- $_coreHelper->currency(
525
- $_exclTax,
526
- true,
527
- false
528
- )
529
- );
530
- $priceXmlObj->addAttribute(
531
- 'starting_at_including_tax',
532
- $_coreHelper->currency(
533
- $_inclTax,
534
- true,
535
- false
536
- )
537
- );
538
  } else {
539
  $_showPrice = $_inclTax;
540
  if (!$_taxHelper->displayPriceIncludingTax()) {
541
  $_showPrice = $_exclTax;
542
  }
543
- $priceXmlObj->addAttribute(
544
- 'starting_at',
545
- $_coreHelper->currency(
546
- $_showPrice,
547
- true,
548
- false
549
- )
550
- );
551
  }
552
  }
553
  }
@@ -575,20 +406,13 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
575
  $price['savePercent'] = ceil(100 - ((100 / $product->getFinalPrice()) * $price['price']));
576
  $price['formated_price'] = Mage::app()->getStore()->formatPrice(
577
  Mage::app()->getStore()->convertPrice(
578
- Mage::helper('tax')->getPrice(
579
- $product,
580
- $price['website_price']
581
- )
582
  ),
583
  false
584
  );
585
  $price['formated_price_incl_tax'] = Mage::app()->getStore()->formatPrice(
586
  Mage::app()->getStore()->convertPrice(
587
- Mage::helper('tax')->getPrice(
588
- $product,
589
- $price['website_price'],
590
- true
591
- )
592
  ),
593
  false
594
  );
@@ -599,20 +423,13 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
599
  $price['savePercent'] = ceil(100 - ((100 / $product->getPrice()) * $price['price']));
600
  $price['formated_price'] = Mage::app()->getStore()->formatPrice(
601
  Mage::app()->getStore()->convertPrice(
602
- Mage::helper('tax')->getPrice(
603
- $product,
604
- $price['website_price']
605
- )
606
  ),
607
  false
608
  );
609
  $price['formated_price_incl_tax'] = Mage::app()->getStore()->formatPrice(
610
  Mage::app()->getStore()->convertPrice(
611
- Mage::helper('tax')->getPrice(
612
- $product,
613
- $price['website_price'],
614
- true
615
- )
616
  ),
617
  false
618
  );
@@ -621,7 +438,6 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
621
  }
622
  }
623
  }
624
-
625
  return $res;
626
  }
627
 
@@ -635,7 +451,6 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
635
  */
636
  protected function _getTierPricesTextArray($_tierPrices, $_product)
637
  {
638
-
639
  $pricesArray = array();
640
  if (Mage::helper('weee')->typeOfDisplay($_product, array(1, 2, 4))) {
641
  $_weeeTaxAttributes = Mage::helper('weee')->getProductWeeeAttributesForDisplay($_product);
@@ -654,13 +469,10 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
654
  } else if (Mage::helper('weee')->typeOfDisplay($_product, 1)) {
655
  $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']);
656
  if ($_weeeTaxAttributes) {
657
- $s .= '(';
658
- $s .= $this->__('%1$s incl tax.', $_price['formated_price_incl_weee']);
659
  $separator = ' + ';
660
  foreach ($_weeeTaxAttributes as $_attribute) {
661
- $s .= $separator;
662
- $s .= $_attribute->getName();
663
- $s .= ': ';
664
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
665
  }
666
  $s .= ')';
@@ -669,13 +481,10 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
669
  } else if (Mage::helper('weee')->typeOfDisplay($_product, 4)) {
670
  $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']);
671
  if ($_weeeTaxAttributes) {
672
- $s .= '(';
673
- $s .= $this->__('%1$s incl tax.', $_price['formated_price_incl_weee']);
674
  $separator = ' + ';
675
  foreach ($_weeeTaxAttributes as $_attribute) {
676
- $s .= $separator;
677
- $s .= $_attribute->getName();
678
- $s .= ': ';
679
  $s .= Mage::helper('core')->currency(
680
  $_attribute->getAmount() + $_attribute->getTaxAmount()
681
  );
@@ -688,12 +497,10 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
688
  if ($_weeeTaxAttributes) {
689
  $s .= '(';
690
  foreach ($_weeeTaxAttributes as $_attribute) {
691
- $s .= $_attribute->getName();
692
- $s .= ': ';
693
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
694
  }
695
- $s .= $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee']);
696
- $s .= ')';
697
  }
698
  $s .= $this->__('each');
699
  } else {
@@ -709,9 +516,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
709
  $s .= '(';
710
  $separator = '';
711
  foreach ($_weeeTaxAttributes as $_attribute) {
712
- $s .= $separator;
713
- $s .= $_attribute->getName();
714
- $s .= ': ';
715
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
716
  $separator = ' + ';
717
  }
@@ -724,9 +529,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
724
  $s .= '(';
725
  $separator = '';
726
  foreach ($_weeeTaxAttributes as $_attribute) {
727
- $s .= $separator;
728
- $s .= $_attribute->getName();
729
- $s .= ': ';
730
  $s .= Mage::helper('core')->currency(
731
  $_attribute->getAmount() + $_attribute->getTaxAmount()
732
  );
@@ -740,12 +543,10 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
740
  if ($_weeeTaxAttributes) {
741
  $s .= '(';
742
  foreach ($_weeeTaxAttributes as $_attribute) {
743
- $s .= $_attribute->getName();
744
- $s .= ': ';
745
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
746
  }
747
- $s .= $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee']);
748
- $s .= ')';
749
  }
750
  $s .= $this->__('each');
751
  } else {
@@ -760,9 +561,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
760
  $s .= '(';
761
  $separator = '';
762
  foreach ($_weeeTaxAttributes as $_attribute) {
763
- $s .= $separator;
764
- $s .= $_attribute->getName();
765
- $s .= ': ';
766
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
767
  $separator = ' + ';
768
  }
@@ -775,9 +574,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
775
  $s .= '(';
776
  $separator = '';
777
  foreach ($_weeeTaxAttributes as $_attribute) {
778
- $s .= $separator;
779
- $s .= $_attribute->getName();
780
- $s .= ': ';
781
  $s .= Mage::helper('core')->currency(
782
  $_attribute->getAmount() + $_attribute->getTaxAmount()
783
  );
@@ -791,12 +588,10 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
791
  if ($_weeeTaxAttributes) {
792
  $s .= '(';
793
  foreach ($_weeeTaxAttributes as $_attribute) {
794
- $s .= $_attribute->getName();
795
- $s .= ': ';
796
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
797
  }
798
- $s .= $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee_only']);
799
- $s .= ')';
800
  }
801
  $s .= $this->__('each');
802
  } else {
@@ -812,13 +607,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default
812
  && $_product->getFinalPrice() > $_price['price']);
813
 
814
  if ($condition1 || $condition2) {
815
- $s .= ' ';
816
- $s .= $this->__('and');
817
- $s .= ' ';
818
- $s .= $this->__('save');
819
- $s .= ' ';
820
- $s .= $_price['savePercent'];
821
- $s .= '%';
822
  }
823
  }
824
  $pricesArray[] = $s;
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_Block_Product_Price
 
35
  {
36
  /**
37
  * Collect product prices to specified item xml object
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $item
41
  */
42
  public function collectProductPrices(
43
+ Mage_Catalog_Model_Product $product, Mage_XmlConnect_Model_Simplexml_Element $item
44
+ ) {
45
+ $this->setProduct($product)->setDisplayMinimalPrice(true)->setUseLinkForAsLowAs(false);
 
 
 
 
46
 
47
  $priceXmlObj = $item->addChild('price');
48
  $_tierPrices = $this->_getTierPrices($product);
81
  */
82
  if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 0)) {
83
  $priceXmlObj->addAttribute(
84
+ 'excluding_tax', $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
 
85
  );
86
  $priceXmlObj->addAttribute(
87
+ 'including_tax', $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmount, true, false)
 
88
  );
89
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 1)) {
90
  /**
91
  * Including + Weee
92
  */
93
  $priceXmlObj->addAttribute(
94
+ 'excluding_tax', $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
 
95
  );
96
  $priceXmlObj->addAttribute(
97
+ 'including_tax', $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmount, true, false)
 
98
  );
99
  $weeeXmlObj = $priceXmlObj->addChild('weee');
100
  $_weeeSeparator = ' + ';
102
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
103
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
104
  $weeeItemXmlObj->addAttribute(
105
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
106
  );
107
  $weeeItemXmlObj->addAttribute(
108
+ 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
 
109
  );
110
  }
111
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 4)) {
113
  * Including + Weee
114
  */
115
  $priceXmlObj->addAttribute(
116
+ 'excluding_tax', $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
 
117
  );
118
  $priceXmlObj->addAttribute(
119
+ 'including_tax', $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmount, true, false)
 
120
  );
121
  $weeeXmlObj = $priceXmlObj->addChild('weee');
122
  $_weeeSeparator = ' + ';
124
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
125
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
126
  $weeeItemXmlObj->addAttribute(
127
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
 
 
 
 
 
 
 
 
128
  );
129
+ $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency(
130
+ $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false
131
+ ));
132
  }
133
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 2)) {
134
  /**
135
  * Excluding + Weee + Final
136
  */
137
+ $priceXmlObj->addAttribute('excluding_tax', $_coreHelper->currency($_price, true, false));
 
 
 
138
  $weeeXmlObj = $priceXmlObj->addChild('weee');
139
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
140
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
141
  $weeeItemXmlObj->addAttribute(
142
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
143
  );
144
  $weeeItemXmlObj->addAttribute(
145
+ 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
 
146
  );
147
  }
148
+ $priceXmlObj->addAttribute('including_tax', $_coreHelper->currency(
149
+ $_finalPriceInclTax + $_weeeTaxAmount, true, false
150
+ ));
 
 
 
 
 
151
  } else {
152
+ $priceXmlObj->addAttribute('excluding_tax', $_coreHelper->currency($_price, true, false));
153
  $priceXmlObj->addAttribute(
154
+ 'including_tax', $_coreHelper->currency($_finalPriceInclTax, true, false)
 
 
 
 
 
155
  );
156
  }
157
  /**
162
  * Including
163
  */
164
  if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 0)) {
165
+ $priceXmlObj->addAttribute('regular', $_coreHelper->currency(
166
+ $_price + $_weeeTaxAmount, true, false
167
+ ));
 
 
 
 
 
168
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 1)) {
169
  /**
170
  * Including + Weee
171
  */
172
+ $priceXmlObj->addAttribute('regular', $_coreHelper->currency(
173
+ $_price + $_weeeTaxAmount, true, false
174
+ ));
 
 
 
 
 
 
175
  $weeeXmlObj = $priceXmlObj->addChild('weee');
176
  $_weeeSeparator = ' + ';
177
  $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
178
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
179
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
180
  $weeeItemXmlObj->addAttribute(
181
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
182
  );
183
  $weeeItemXmlObj->addAttribute(
184
+ 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
 
185
  );
186
  }
187
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 4)) {
188
  /**
189
  * Including + Weee
190
  */
191
+ $priceXmlObj->addAttribute('regular', $_coreHelper->currency(
192
+ $_price + $_weeeTaxAmount, true, false
193
+ ));
 
 
 
 
 
194
  $weeeXmlObj = $priceXmlObj->addChild('weee');
195
  $_weeeSeparator = ' + ';
196
  $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
197
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
198
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
199
  $weeeItemXmlObj->addAttribute(
200
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
 
 
 
 
 
 
 
 
201
  );
202
+ $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency(
203
+ $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false
204
+ ));
205
  }
206
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 2)) {
207
  /**
208
  * Excluding + Weee + Final
209
  */
210
  $priceXmlObj->addAttribute(
211
+ 'regular', $_coreHelper->currency($_price, true, false)
 
212
  );
213
  $weeeXmlObj = $priceXmlObj->addChild('weee');
214
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
215
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
216
  $weeeItemXmlObj->addAttribute(
217
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
218
  );
219
  $weeeItemXmlObj->addAttribute(
220
+ 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
 
221
  );
222
  }
223
  $priceXmlObj->addAttribute(
224
+ 'including_tax', $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
 
225
  );
226
  } else {
227
+ $priceXmlObj->addAttribute('regular', $_coreHelper->currency($_price, true, false));
 
 
 
228
  }
229
  }
230
  /**
236
  * Including
237
  */
238
  if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 0)) {
239
+ $priceXmlObj->addAttribute('regular', $_coreHelper->currency(
240
+ $_regularPrice + $_originalWeeeTaxAmount, true, false
241
+ ));
 
 
 
 
 
242
  if ($_taxHelper->displayBothPrices()) {
243
+ $priceXmlObj->addAttribute('special_excluding_tax', $_coreHelper->currency(
244
+ $_finalPrice + $_weeeTaxAmount, true, false
245
+ ));
246
+ $priceXmlObj->addAttribute('special_including_tax', $_coreHelper->currency(
247
+ $_finalPriceInclTax + $_weeeTaxAmount, true, false
248
+ ));
 
 
 
 
 
 
 
 
 
 
249
  } else {
250
+ $priceXmlObj->addAttribute('special', $_coreHelper->currency(
251
+ $_finalPrice + $_weeeTaxAmount, true, false
252
+ ));
 
 
 
 
 
253
  }
254
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 1)) {
255
  /**
256
  * Including + Weee
257
  */
258
+ $priceXmlObj->addAttribute('regular', $_coreHelper->currency(
259
+ $_regularPrice + $_originalWeeeTaxAmount, true, false
260
+ ));
261
+ $priceXmlObj->addAttribute('special_excluding_tax', $_coreHelper->currency(
262
+ $_finalPrice + $_weeeTaxAmount, true, false
263
+ ));
 
 
 
 
 
 
 
 
 
 
264
  $weeeXmlObj = $priceXmlObj->addChild('weee');
265
  $_weeeSeparator = ' + ';
266
  $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
267
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
268
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
269
  $weeeItemXmlObj->addAttribute(
270
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
 
 
 
 
 
 
 
 
271
  );
272
+ $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency(
273
+ $_weeeTaxAttribute->getAmount(), true, false
274
+ ));
275
  }
276
+ $priceXmlObj->addAttribute('special_including_tax', $_coreHelper->currency(
277
+ $_finalPriceInclTax + $_weeeTaxAmount, true, false
278
+ ));
 
 
 
 
 
279
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 4)) {
280
  /**
281
  * Including + Weee
282
  */
283
+ $priceXmlObj->addAttribute('regular', $_coreHelper->currency(
284
+ $_regularPrice + $_originalWeeeTaxAmount, true, false
285
+ ));
286
+ $priceXmlObj->addAttribute('special_excluding_tax', $_coreHelper->currency(
287
+ $_finalPrice + $_weeeTaxAmount, true, false
288
+ ));
 
 
 
 
 
 
 
 
 
 
289
  $weeeXmlObj = $priceXmlObj->addChild('weee');
290
  $_weeeSeparator = ' + ';
291
  $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
292
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
293
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
294
  $weeeItemXmlObj->addAttribute(
295
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
 
 
 
 
 
 
 
 
296
  );
297
+ $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency(
298
+ $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false
299
+ ));
300
  }
301
+ $priceXmlObj->addAttribute('special_including_tax', $_coreHelper->currency(
302
+ $_finalPriceInclTax + $_weeeTaxAmount, true, false
303
+ ));
 
 
 
 
 
304
  } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 2)) {
305
  /**
306
  * Excluding + Weee + Final
307
  */
308
+ $priceXmlObj->addAttribute('regular', $_coreHelper->currency($_regularPrice, true, false));
309
  $priceXmlObj->addAttribute(
310
+ 'special_excluding_tax', $_coreHelper->currency($_finalPrice, true, false)
 
 
 
 
 
311
  );
312
  $weeeXmlObj = $priceXmlObj->addChild('weee');
313
  foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
314
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
315
  $weeeItemXmlObj->addAttribute(
316
+ 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
 
 
 
 
 
 
 
 
 
317
  );
318
+ $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency(
319
+ $_weeeTaxAttribute->getAmount(), true, false
320
+ ));
321
  }
322
+ $priceXmlObj->addAttribute('special_including_tax', $_coreHelper->currency(
323
+ $_finalPriceInclTax + $_weeeTaxAmount, true, false
324
+ ));
 
 
 
 
 
325
  } else {
326
  /**
327
  * Excluding
328
  */
329
+ $priceXmlObj->addAttribute('regular', $_coreHelper->currency($_regularPrice, true, false));
 
 
 
330
  if ($_taxHelper->displayBothPrices()) {
331
  $priceXmlObj->addAttribute(
332
+ 'special_excluding_tax', $_coreHelper->currency($_finalPrice, true, false)
 
333
  );
334
  $priceXmlObj->addAttribute(
335
+ 'special_including_tax', $_coreHelper->currency($_finalPriceInclTax, true, false)
 
336
  );
337
  } else {
338
  $priceXmlObj->addAttribute(
339
+ 'special', $_coreHelper->currency($_finalPrice, true, false)
 
340
  );
341
  }
342
  }
353
  }
354
 
355
  if (!$this->getUseLinkForAsLowAs()) {
356
+ $priceXmlObj->addAttribute('as_low_as', $_coreHelper->currency(
357
+ $_minimalPriceDisplayValue, true, false
358
+ ));
 
 
 
 
 
359
  }
360
  }
361
  /**
367
 
368
  if ($this->getDisplayMinimalPrice() && $_minimalPriceValue) {
369
  if ($_taxHelper->displayBothPrices()) {
370
+ $priceXmlObj->addAttribute('starting_at_excluding_tax', $_coreHelper->currency(
371
+ $_exclTax, true, false
372
+ ));
373
+ $priceXmlObj->addAttribute('starting_at_including_tax', $_coreHelper->currency(
374
+ $_inclTax, true, false
375
+ ));
 
 
 
 
 
 
 
 
 
 
376
  } else {
377
  $_showPrice = $_inclTax;
378
  if (!$_taxHelper->displayPriceIncludingTax()) {
379
  $_showPrice = $_exclTax;
380
  }
381
+ $priceXmlObj->addAttribute('starting_at', $_coreHelper->currency($_showPrice, true, false));
 
 
 
 
 
 
 
382
  }
383
  }
384
  }
406
  $price['savePercent'] = ceil(100 - ((100 / $product->getFinalPrice()) * $price['price']));
407
  $price['formated_price'] = Mage::app()->getStore()->formatPrice(
408
  Mage::app()->getStore()->convertPrice(
409
+ Mage::helper('tax')->getPrice($product, $price['website_price'])
 
 
 
410
  ),
411
  false
412
  );
413
  $price['formated_price_incl_tax'] = Mage::app()->getStore()->formatPrice(
414
  Mage::app()->getStore()->convertPrice(
415
+ Mage::helper('tax')->getPrice($product, $price['website_price'], true)
 
 
 
 
416
  ),
417
  false
418
  );
423
  $price['savePercent'] = ceil(100 - ((100 / $product->getPrice()) * $price['price']));
424
  $price['formated_price'] = Mage::app()->getStore()->formatPrice(
425
  Mage::app()->getStore()->convertPrice(
426
+ Mage::helper('tax')->getPrice($product, $price['website_price'])
 
 
 
427
  ),
428
  false
429
  );
430
  $price['formated_price_incl_tax'] = Mage::app()->getStore()->formatPrice(
431
  Mage::app()->getStore()->convertPrice(
432
+ Mage::helper('tax')->getPrice($product, $price['website_price'], true)
 
 
 
 
433
  ),
434
  false
435
  );
438
  }
439
  }
440
  }
 
441
  return $res;
442
  }
443
 
451
  */
452
  protected function _getTierPricesTextArray($_tierPrices, $_product)
453
  {
 
454
  $pricesArray = array();
455
  if (Mage::helper('weee')->typeOfDisplay($_product, array(1, 2, 4))) {
456
  $_weeeTaxAttributes = Mage::helper('weee')->getProductWeeeAttributesForDisplay($_product);
469
  } else if (Mage::helper('weee')->typeOfDisplay($_product, 1)) {
470
  $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']);
471
  if ($_weeeTaxAttributes) {
472
+ $s .= '(' . $this->__('%1$s incl tax.', $_price['formated_price_incl_weee']);
 
473
  $separator = ' + ';
474
  foreach ($_weeeTaxAttributes as $_attribute) {
475
+ $s .= $separator . $_attribute->getName() . ': ';
 
 
476
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
477
  }
478
  $s .= ')';
481
  } else if (Mage::helper('weee')->typeOfDisplay($_product, 4)) {
482
  $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']);
483
  if ($_weeeTaxAttributes) {
484
+ $s .= '(' . $this->__('%1$s incl tax.', $_price['formated_price_incl_weee']);
 
485
  $separator = ' + ';
486
  foreach ($_weeeTaxAttributes as $_attribute) {
487
+ $s .= $separator . $_attribute->getName() . ': ';
 
 
488
  $s .= Mage::helper('core')->currency(
489
  $_attribute->getAmount() + $_attribute->getTaxAmount()
490
  );
497
  if ($_weeeTaxAttributes) {
498
  $s .= '(';
499
  foreach ($_weeeTaxAttributes as $_attribute) {
500
+ $s .= $_attribute->getName() . ': ';
 
501
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
502
  }
503
+ $s .= $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee']) . ')';
 
504
  }
505
  $s .= $this->__('each');
506
  } else {
516
  $s .= '(';
517
  $separator = '';
518
  foreach ($_weeeTaxAttributes as $_attribute) {
519
+ $s .= $separator . $_attribute->getName() . ': ';
 
 
520
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
521
  $separator = ' + ';
522
  }
529
  $s .= '(';
530
  $separator = '';
531
  foreach ($_weeeTaxAttributes as $_attribute) {
532
+ $s .= $separator . $_attribute->getName() . ': ';
 
 
533
  $s .= Mage::helper('core')->currency(
534
  $_attribute->getAmount() + $_attribute->getTaxAmount()
535
  );
543
  if ($_weeeTaxAttributes) {
544
  $s .= '(';
545
  foreach ($_weeeTaxAttributes as $_attribute) {
546
+ $s .= $_attribute->getName() . ': ';
 
547
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
548
  }
549
+ $s .= $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee']) . ')';
 
550
  }
551
  $s .= $this->__('each');
552
  } else {
561
  $s .= '(';
562
  $separator = '';
563
  foreach ($_weeeTaxAttributes as $_attribute) {
564
+ $s .= $separator . $_attribute->getName() . ': ';
 
 
565
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
566
  $separator = ' + ';
567
  }
574
  $s .= '(';
575
  $separator = '';
576
  foreach ($_weeeTaxAttributes as $_attribute) {
577
+ $s .= $separator . $_attribute->getName() . ': ';
 
 
578
  $s .= Mage::helper('core')->currency(
579
  $_attribute->getAmount() + $_attribute->getTaxAmount()
580
  );
588
  if ($_weeeTaxAttributes) {
589
  $s .= '(';
590
  foreach ($_weeeTaxAttributes as $_attribute) {
591
+ $s .= $_attribute->getName() . ': ';
 
592
  $s .= Mage::helper('core')->currency($_attribute->getAmount());
593
  }
594
+ $s .= $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee_only']) . ')';
 
595
  }
596
  $s .= $this->__('each');
597
  } else {
607
  && $_product->getFinalPrice() > $_price['price']);
608
 
609
  if ($condition1 || $condition2) {
610
+ $s .= ' ' . $this->__('and') . ' ' . $this->__('save') . ' ' . $_price['savePercent'] . '%';
 
 
 
 
 
 
611
  }
612
  }
613
  $pricesArray[] = $s;
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Catalog_Product_Price_Giftcard
35
- extends Mage_Bundle_Block_Catalog_Product_Price
36
  {
37
  /**
38
  * Return minimal amount for Giftcard product using price model
@@ -71,24 +70,19 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Giftcard
71
  public function collectProductPrices(
72
  Mage_Catalog_Model_Product $product,
73
  Mage_XmlConnect_Model_Simplexml_Element $item
74
- )
75
- {
76
  $this->setProduct($product);
77
 
78
  if ($product->getCanShowPrice() !== false) {
79
  $priceXmlObj = $item->addChild('price');
80
 
81
  if (($_min = $this->getMinAmount()) && ($_max = $this->getMaxAmount()) && ($_min == $_max)) {
82
- $priceXmlObj->addAttribute(
83
- 'regular',
84
- Mage::helper('core')->currency($_min, true, false)
85
- );
86
  } elseif (($_min = $this->getMinAmount()) && $_min != 0) {
87
  $priceXmlObj->addAttribute(
88
  'regular',
89
- Mage::helper('enterprise_giftcard')->__('From')
90
- . ': '
91
- . Mage::helper('core')->currency($_min, true, false)
92
  );
93
  }
94
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Catalog_Product_Price_Giftcard extends Mage_Bundle_Block_Catalog_Product_Price
 
35
  {
36
  /**
37
  * Return minimal amount for Giftcard product using price model
70
  public function collectProductPrices(
71
  Mage_Catalog_Model_Product $product,
72
  Mage_XmlConnect_Model_Simplexml_Element $item
73
+ ) {
 
74
  $this->setProduct($product);
75
 
76
  if ($product->getCanShowPrice() !== false) {
77
  $priceXmlObj = $item->addChild('price');
78
 
79
  if (($_min = $this->getMinAmount()) && ($_max = $this->getMaxAmount()) && ($_min == $_max)) {
80
+ $priceXmlObj->addAttribute('regular', Mage::helper('core')->currency($_min, true, false));
 
 
 
81
  } elseif (($_min = $this->getMinAmount()) && $_min != 0) {
82
  $priceXmlObj->addAttribute(
83
  'regular',
84
+ Mage::helper('enterprise_giftcard')->__('From') . ': '
85
+ . Mage::helper('core')->currency($_min, true, false)
 
86
  );
87
  }
88
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php CHANGED
@@ -42,20 +42,15 @@ class Mage_XmlConnect_Block_Catalog_Product_Related extends Mage_XmlConnect_Bloc
42
  public function getRelatedProductsXmlObj()
43
  {
44
  /** @var $relatedXmlObj Mage_XmlConnect_Model_Simplexml_Element */
45
- $relatedXmlObj = Mage::getModel(
46
- 'xmlconnect/simplexml_element',
47
- '<related_products></related_products>'
48
- );
49
 
50
  $productObj = $this->getParentBlock()->getProduct();
51
 
52
  if (is_object(Mage::getConfig()->getNode('modules/Enterprise_TargetRule'))) {
53
  Mage::register('product', $productObj);
54
 
55
- $productBlock = $this->getLayout()
56
- ->addBlock(
57
- 'enterprise_targetrule/catalog_product_list_related',
58
- 'relatedProducts'
59
  );
60
 
61
  $collection = $productBlock->getItemCollection();
@@ -85,15 +80,16 @@ class Mage_XmlConnect_Block_Catalog_Product_Related extends Mage_XmlConnect_Bloc
85
  {
86
  foreach ($collection as $product) {
87
  $productXmlObj = $this->productToXmlObject($product);
88
- if ($productXmlObj) {
89
- if ($this->getParentBlock()->getChild('product_price')) {
90
- $this->getParentBlock()->getChild('product_price')
91
- ->setProduct($product)
92
- ->setProductXmlObj($productXmlObj)
93
- ->collectProductPrices();
94
- }
95
- $relatedXmlObj->appendChild($productXmlObj);
96
  }
 
 
 
 
 
 
97
  }
98
  return $relatedXmlObj;
99
  }
@@ -116,15 +112,12 @@ class Mage_XmlConnect_Block_Catalog_Product_Related extends Mage_XmlConnect_Bloc
116
  protected function _getProductCollection()
117
  {
118
  if (is_null($this->_productCollection)) {
119
- $collection = $this->getParentBlock()
120
- ->getProduct()
121
- ->getRelatedProductCollection();
122
  Mage::getSingleton('catalog/layer')->prepareProductCollection($collection);
123
  /**
124
  * Add rating and review summary, image attribute, apply sort params
125
  */
126
  $this->_prepareCollection($collection);
127
-
128
  $this->_productCollection = $collection;
129
  }
130
  return $this->_productCollection;
42
  public function getRelatedProductsXmlObj()
43
  {
44
  /** @var $relatedXmlObj Mage_XmlConnect_Model_Simplexml_Element */
45
+ $relatedXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<related_products></related_products>');
 
 
 
46
 
47
  $productObj = $this->getParentBlock()->getProduct();
48
 
49
  if (is_object(Mage::getConfig()->getNode('modules/Enterprise_TargetRule'))) {
50
  Mage::register('product', $productObj);
51
 
52
+ $productBlock = $this->getLayout()->addBlock(
53
+ 'enterprise_targetrule/catalog_product_list_related', 'relatedProducts'
 
 
54
  );
55
 
56
  $collection = $productBlock->getItemCollection();
80
  {
81
  foreach ($collection as $product) {
82
  $productXmlObj = $this->productToXmlObject($product);
83
+
84
+ if (!$productXmlObj) {
85
+ continue;
 
 
 
 
 
86
  }
87
+
88
+ if ($this->getParentBlock()->getChild('product_price')) {
89
+ $this->getParentBlock()->getChild('product_price')->setProduct($product)
90
+ ->setProductXmlObj($productXmlObj)->collectProductPrices();
91
+ }
92
+ $relatedXmlObj->appendChild($productXmlObj);
93
  }
94
  return $relatedXmlObj;
95
  }
112
  protected function _getProductCollection()
113
  {
114
  if (is_null($this->_productCollection)) {
115
+ $collection = $this->getParentBlock()->getProduct()->getRelatedProductCollection();
 
 
116
  Mage::getSingleton('catalog/layer')->prepareProductCollection($collection);
117
  /**
118
  * Add rating and review summary, image attribute, apply sort params
119
  */
120
  $this->_prepareCollection($collection);
 
121
  $this->_productCollection = $collection;
122
  }
123
  return $this->_productCollection;
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php CHANGED
@@ -83,8 +83,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Review extends Mage_XmlConnect_Block
83
  */
84
  protected function _toHtml()
85
  {
86
- $review = Mage::getModel('review/review')
87
- ->load((int)$this->getRequest()->getParam('id', 0));
88
  return $this->reviewToXmlObject($review, 'review')->asNiceXml();
89
  }
90
  }
83
  */
84
  protected function _toHtml()
85
  {
86
+ $review = Mage::getModel('review/review')->load((int)$this->getRequest()->getParam('id', 0));
 
87
  return $this->reviewToXmlObject($review, 'review')->asNiceXml();
88
  }
89
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Catalog_Product_Review_List
35
- extends Mage_XmlConnect_Block_Catalog_Product_Review
36
  {
37
  /**
38
  * Store reviews collection
@@ -49,7 +48,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Review_List
49
  public function getReviewsXmlObject()
50
  {
51
  $reviewsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<reviews></reviews>');
52
- $collection = $this->_getReviewCollection();
53
 
54
  if (!$collection) {
55
  return $reviewsXmlObj;
@@ -79,10 +78,8 @@ class Mage_XmlConnect_Block_Catalog_Product_Review_List
79
  }
80
  /** @var $collection Mage_Review_Model_Mysql4_Review_Collection */
81
  $collection = Mage::getResourceModel('review/review_collection')
82
- ->addEntityFilter('product', $product->getId())
83
- ->addStoreFilter(Mage::app()->getStore()->getId())
84
- ->addStatusFilter('approved')
85
- ->setDateOrder();
86
 
87
  /**
88
  * Apply offset and count
@@ -104,8 +101,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Review_List
104
  */
105
  protected function _toHtml()
106
  {
107
- $product = Mage::getModel('catalog/product')
108
- ->load((int)$this->getRequest()->getParam('id', 0));
109
  if ($product->getId()) {
110
  $this->setProduct($product);
111
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Catalog_Product_Review_List extends Mage_XmlConnect_Block_Catalog_Product_Review
 
35
  {
36
  /**
37
  * Store reviews collection
48
  public function getReviewsXmlObject()
49
  {
50
  $reviewsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<reviews></reviews>');
51
+ $collection = $this->_getReviewCollection();
52
 
53
  if (!$collection) {
54
  return $reviewsXmlObj;
78
  }
79
  /** @var $collection Mage_Review_Model_Mysql4_Review_Collection */
80
  $collection = Mage::getResourceModel('review/review_collection')
81
+ ->addEntityFilter('product', $product->getId())->addStoreFilter(Mage::app()->getStore()->getId())
82
+ ->addStatusFilter('approved')->setDateOrder();
 
 
83
 
84
  /**
85
  * Apply offset and count
101
  */
102
  protected function _toHtml()
103
  {
104
+ $product = Mage::getModel('catalog/product')->load((int)$this->getRequest()->getParam('id', 0));
 
105
  if ($product->getId()) {
106
  $this->setProduct($product);
107
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Search.php CHANGED
@@ -48,9 +48,11 @@ class Mage_XmlConnect_Block_Catalog_Search extends Mage_XmlConnect_Block_Catalog
48
  $helper = Mage::helper('catalogsearch');
49
  if (method_exists($helper, 'getEngine')) {
50
  $engine = Mage::helper('catalogsearch')->getEngine();
51
- $isLayeredNavigationAllowed = ($engine instanceof Varien_Object)
52
- ? $engine->isLeyeredNavigationAllowed()
53
- : true;
 
 
54
  } else {
55
  $isLayeredNavigationAllowed = true;
56
  }
@@ -64,8 +66,7 @@ class Mage_XmlConnect_Block_Catalog_Search extends Mage_XmlConnect_Block_Catalog
64
  if ($productListBlock) {
65
  $layer = Mage::getSingleton('catalogsearch/layer');
66
  $productsXmlObj = $productListBlock->setLayer($layer)
67
- ->setNeedBlockApplyingFilters(!$isLayeredNavigationAllowed)
68
- ->getProductsXmlObject();
69
  $searchXmlObject->appendChild($productsXmlObj);
70
  $hasMoreProductItems = (int)$productListBlock->getHasProductItems();
71
  }
48
  $helper = Mage::helper('catalogsearch');
49
  if (method_exists($helper, 'getEngine')) {
50
  $engine = Mage::helper('catalogsearch')->getEngine();
51
+ if ($engine instanceof Varien_Object) {
52
+ $isLayeredNavigationAllowed = $engine->isLeyeredNavigationAllowed();
53
+ } else {
54
+ $isLayeredNavigationAllowed = true;
55
+ }
56
  } else {
57
  $isLayeredNavigationAllowed = true;
58
  }
66
  if ($productListBlock) {
67
  $layer = Mage::getSingleton('catalogsearch/layer');
68
  $productsXmlObj = $productListBlock->setLayer($layer)
69
+ ->setNeedBlockApplyingFilters(!$isLayeredNavigationAllowed)->getProductsXmlObject();
 
70
  $searchXmlObject->appendChild($productsXmlObj);
71
  $hasMoreProductItems = (int)$productListBlock->getHasProductItems();
72
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php CHANGED
@@ -54,7 +54,9 @@ class Mage_XmlConnect_Block_Checkout_Address_Billing extends Mage_Checkout_Block
54
  $item->addAttribute('selected', 1);
55
  }
56
  $this->getChild('address_list')->prepareAddressData($address, $item);
57
- $item->addChild('address_line', $billingXmlObj->escapeXml($address->format('oneline')));
 
 
58
  }
59
 
60
  return $billingXmlObj->asNiceXml();
54
  $item->addAttribute('selected', 1);
55
  }
56
  $this->getChild('address_list')->prepareAddressData($address, $item);
57
+ $item->addChild(
58
+ 'address_line', $billingXmlObj->escapeXml($address->format('oneline'))
59
+ );
60
  }
61
 
62
  return $billingXmlObj->asNiceXml();
app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php CHANGED
@@ -50,75 +50,63 @@ class Mage_XmlConnect_Block_Checkout_Address_Form extends Mage_Core_Block_Templa
50
  $addressType = 'billing';
51
  }
52
 
53
- $isAllowedGuestCheckout = Mage::getSingleton('checkout/session')
54
- ->getQuote()
55
- ->isAllowedGuestCheckout();
56
 
57
  $countries = $this->_getCountryOptions();
58
 
59
  $xmlModel->addField($addressType . '[firstname]', 'text', array(
60
- 'label' => $this->__('First Name'),
61
- 'required' => 'true',
62
- 'value' => ''
63
- )
64
- );
65
 
66
  $xmlModel->addField($addressType . '[lastname]', 'text', array(
67
- 'label' => $this->__('Last Name'),
68
- 'required' => 'true',
69
- 'value' => ''
70
- )
71
- );
72
 
73
  $xmlModel->addField($addressType . '[company]', 'text', array(
74
- 'label' => $this->__('Company'),
75
- 'required' => 'true',
76
- 'value' => ''
77
- )
78
- );
79
 
80
- if ($isAllowedGuestCheckout
81
- && !Mage::getSingleton('customer/session')->isLoggedIn()
82
  && $addressType == 'billing'
83
  ) {
84
  $emailField = $xmlModel->addField($addressType . '[email]', 'text', array(
85
- 'label' => $this->__('Email Address'),
86
- 'required' => 'true',
87
- 'value' => ''
88
- )
89
- );
90
  $emailValidator = $emailField->addChild('validators')->addChild('validator');
91
  $emailValidator->addAttribute('type', 'email');
92
  $emailValidator->addAttribute('message', $this->__('Wrong email format'));
93
  }
94
 
95
  $xmlModel->addField($addressType . '[street][]', 'text', array(
96
- 'label' => $this->__('Address'),
97
- 'required' => 'true',
98
- 'value' => ''
99
- )
100
- );
101
 
102
  $xmlModel->addField($addressType . '[street][]', 'text', array(
103
- 'label' => $this->__('Address 2'),
104
- 'value' => ''
105
- )
106
- );
107
 
108
  $xmlModel->addField($addressType . '[city]', 'text', array(
109
- 'label' => $this->__('City'),
110
- 'required' => 'true',
111
- 'value' => ''
112
- )
113
- );
114
 
115
  $countryOptionsXml = $xmlModel->addField($addressType . '[country_id]', 'select', array(
116
- 'label' => $this->__('Country'),
117
- 'required' => 'true',
118
- 'value' => ''
119
- )
120
- )
121
- ->addChild('values');
122
 
123
  foreach ($countries as $data) {
124
  $regions = array();
@@ -129,15 +117,11 @@ class Mage_XmlConnect_Block_Checkout_Address_Form extends Mage_Core_Block_Templa
129
 
130
  $regionStr = (!empty($regions) ? 'region_id' : 'region');
131
 
132
- $countryXml = $countryOptionsXml->addCustomChild('item', null, array(
133
- 'relation' => $regionStr
134
- )
135
- );
136
  $countryXml->addCustomChild('label', (string)$data['label']);
137
  $countryXml->addCustomChild('value', (string)$data['value']);
138
  if (!empty($regions)) {
139
  $regionXml = $countryXml->addChild('regions');
140
-
141
  foreach ($regions as $_data) {
142
  $regionItemXml = $regionXml->addChild('region_item');
143
  $regionItemXml->addCustomChild('label', (string)$_data['label']);
@@ -147,42 +131,36 @@ class Mage_XmlConnect_Block_Checkout_Address_Form extends Mage_Core_Block_Templa
147
  }
148
 
149
  $xmlModel->addField($addressType . '[region]', 'text', array(
150
- 'label' => $this->__('State/Province'),
151
- 'value' => ''
152
- )
153
- );
154
 
155
  $xmlModel->addField($addressType . '[region_id]', 'select', array(
156
- 'label' => $this->__('State/Province'),
157
- 'required' => 'true',
158
- 'value' => ''
159
- )
160
- );
161
 
162
  $xmlModel->addField($addressType . '[postcode]', 'text', array(
163
- 'label' => $this->__('Zip/Postal Code'),
164
- 'required' => 'true',
165
- 'value' => ''
166
- )
167
- );
168
 
169
  $xmlModel->addField($addressType . '[telephone]', 'text', array(
170
- 'label' => $this->__('Telephone'),
171
- 'required' => 'true',
172
- 'value' => ''
173
- )
174
- );
175
 
176
  $xmlModel->addField($addressType . '[fax]', 'text', array(
177
- 'label' => $this->__('Fax'),
178
- 'value' => ''
179
- )
180
- );
181
 
182
  $xmlModel->addField($addressType . '[save_in_address_book]', 'checkbox', array(
183
- 'label' => $this->__('Save in address book'),
184
- )
185
- );
186
 
187
  return $xmlModel->asNiceXml();
188
  }
@@ -196,11 +174,11 @@ class Mage_XmlConnect_Block_Checkout_Address_Form extends Mage_Core_Block_Templa
196
  protected function _getRegionOptions($countryId)
197
  {
198
  $cacheKey = 'DIRECTORY_REGION_SELECT_STORE' . Mage::app()->getStore()->getId() . $countryId;
199
- if (Mage::app()->useCache('config') && $cache = Mage::app()->loadCache($cacheKey)) {
 
200
  $options = unserialize($cache);
201
  } else {
202
- $collection = Mage::getModel('directory/region')->getResourceCollection()
203
- ->addCountryFilter($countryId)
204
  ->load();
205
  $options = $collection->toOptionArray();
206
  if (Mage::app()->useCache('config')) {
@@ -218,12 +196,12 @@ class Mage_XmlConnect_Block_Checkout_Address_Form extends Mage_Core_Block_Templa
218
  protected function _getCountryOptions()
219
  {
220
  $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_' . Mage::app()->getStore()->getCode();
221
- if (Mage::app()->useCache('config') && $cache = Mage::app()->loadCache($cacheKey)) {
 
222
  $options = unserialize($cache);
223
  } else {
224
  /** @var $collection Mage_Directory_Model_Mysql4_Country_Collection */
225
- $collection = Mage::getModel('directory/country')->getResourceCollection()
226
- ->loadByStore();
227
  $options = $collection->toOptionArray(false);
228
  if (Mage::app()->useCache('config')) {
229
  Mage::app()->saveCache(serialize($options), $cacheKey, array('config'));
50
  $addressType = 'billing';
51
  }
52
 
53
+ $isAllowedGuestCheckout = Mage::getSingleton('checkout/session')->getQuote()->isAllowedGuestCheckout();
 
 
54
 
55
  $countries = $this->_getCountryOptions();
56
 
57
  $xmlModel->addField($addressType . '[firstname]', 'text', array(
58
+ 'label' => $this->__('First Name'),
59
+ 'required' => 'true',
60
+ 'value' => ''
61
+ ));
 
62
 
63
  $xmlModel->addField($addressType . '[lastname]', 'text', array(
64
+ 'label' => $this->__('Last Name'),
65
+ 'required' => 'true',
66
+ 'value' => ''
67
+ ));
 
68
 
69
  $xmlModel->addField($addressType . '[company]', 'text', array(
70
+ 'label' => $this->__('Company'),
71
+ 'required' => 'true',
72
+ 'value' => ''
73
+ ));
 
74
 
75
+ if ($isAllowedGuestCheckout && !Mage::getSingleton('customer/session')->isLoggedIn()
 
76
  && $addressType == 'billing'
77
  ) {
78
  $emailField = $xmlModel->addField($addressType . '[email]', 'text', array(
79
+ 'label' => $this->__('Email Address'),
80
+ 'required' => 'true',
81
+ 'value' => ''
82
+ ));
 
83
  $emailValidator = $emailField->addChild('validators')->addChild('validator');
84
  $emailValidator->addAttribute('type', 'email');
85
  $emailValidator->addAttribute('message', $this->__('Wrong email format'));
86
  }
87
 
88
  $xmlModel->addField($addressType . '[street][]', 'text', array(
89
+ 'label' => $this->__('Address'),
90
+ 'required' => 'true',
91
+ 'value' => ''
92
+ ));
 
93
 
94
  $xmlModel->addField($addressType . '[street][]', 'text', array(
95
+ 'label' => $this->__('Address 2'),
96
+ 'value' => ''
97
+ ));
 
98
 
99
  $xmlModel->addField($addressType . '[city]', 'text', array(
100
+ 'label' => $this->__('City'),
101
+ 'required' => 'true',
102
+ 'value' => ''
103
+ ));
 
104
 
105
  $countryOptionsXml = $xmlModel->addField($addressType . '[country_id]', 'select', array(
106
+ 'label' => $this->__('Country'),
107
+ 'required' => 'true',
108
+ 'value' => ''
109
+ ))->addChild('values');
 
 
110
 
111
  foreach ($countries as $data) {
112
  $regions = array();
117
 
118
  $regionStr = (!empty($regions) ? 'region_id' : 'region');
119
 
120
+ $countryXml = $countryOptionsXml->addCustomChild('item', null, array('relation' => $regionStr));
 
 
 
121
  $countryXml->addCustomChild('label', (string)$data['label']);
122
  $countryXml->addCustomChild('value', (string)$data['value']);
123
  if (!empty($regions)) {
124
  $regionXml = $countryXml->addChild('regions');
 
125
  foreach ($regions as $_data) {
126
  $regionItemXml = $regionXml->addChild('region_item');
127
  $regionItemXml->addCustomChild('label', (string)$_data['label']);
131
  }
132
 
133
  $xmlModel->addField($addressType . '[region]', 'text', array(
134
+ 'label' => $this->__('State/Province'),
135
+ 'value' => ''
136
+ ));
 
137
 
138
  $xmlModel->addField($addressType . '[region_id]', 'select', array(
139
+ 'label' => $this->__('State/Province'),
140
+ 'required' => 'true',
141
+ 'value' => ''
142
+ ));
 
143
 
144
  $xmlModel->addField($addressType . '[postcode]', 'text', array(
145
+ 'label' => $this->__('Zip/Postal Code'),
146
+ 'required' => 'true',
147
+ 'value' => ''
148
+ ));
 
149
 
150
  $xmlModel->addField($addressType . '[telephone]', 'text', array(
151
+ 'label' => $this->__('Telephone'),
152
+ 'required' => 'true',
153
+ 'value' => ''
154
+ ));
 
155
 
156
  $xmlModel->addField($addressType . '[fax]', 'text', array(
157
+ 'label' => $this->__('Fax'),
158
+ 'value' => ''
159
+ ));
 
160
 
161
  $xmlModel->addField($addressType . '[save_in_address_book]', 'checkbox', array(
162
+ 'label' => $this->__('Save in address book'),
163
+ ));
 
164
 
165
  return $xmlModel->asNiceXml();
166
  }
174
  protected function _getRegionOptions($countryId)
175
  {
176
  $cacheKey = 'DIRECTORY_REGION_SELECT_STORE' . Mage::app()->getStore()->getId() . $countryId;
177
+ $cache = Mage::app()->loadCache($cacheKey);
178
+ if (Mage::app()->useCache('config') && $cache) {
179
  $options = unserialize($cache);
180
  } else {
181
+ $collection = Mage::getModel('directory/region')->getResourceCollection()->addCountryFilter($countryId)
 
182
  ->load();
183
  $options = $collection->toOptionArray();
184
  if (Mage::app()->useCache('config')) {
196
  protected function _getCountryOptions()
197
  {
198
  $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_' . Mage::app()->getStore()->getCode();
199
+ $cache = Mage::app()->loadCache($cacheKey);
200
+ if (Mage::app()->useCache('config') && $cache) {
201
  $options = unserialize($cache);
202
  } else {
203
  /** @var $collection Mage_Directory_Model_Mysql4_Country_Collection */
204
+ $collection = Mage::getModel('directory/country')->getResourceCollection()->loadByStore();
 
205
  $options = $collection->toOptionArray(false);
206
  if (Mage::app()->useCache('config')) {
207
  Mage::app()->saveCache(serialize($options), $cacheKey, array('config'));
app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php CHANGED
@@ -40,6 +40,7 @@ class Mage_XmlConnect_Block_Checkout_Agreements extends Mage_Checkout_Block_Agre
40
  */
41
  protected function _toHtml()
42
  {
 
43
  $agreementsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<agreements></agreements>');
44
  if ($this->getAgreements()) {
45
  foreach ($this->getAgreements() as $agreement) {
40
  */
41
  protected function _toHtml()
42
  {
43
+ /** @var $agreementsXmlObj Mage_XmlConnect_Model_Simplexml_Element */
44
  $agreementsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<agreements></agreements>');
45
  if ($this->getAgreements()) {
46
  foreach ($this->getAgreements() as $agreement) {
app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php CHANGED
@@ -123,8 +123,7 @@ class Mage_XmlConnect_Block_Checkout_Order_Review_Info extends Mage_Checkout_Blo
123
  if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) {
124
  $typeOfDisplay = Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales');
125
  if ($typeOfDisplay && $item->getWeeeTaxAppliedAmount()) {
126
- $exclPrice = $item->getRowTotal()
127
- + $item->getWeeeTaxAppliedRowAmount()
128
  + $item->getWeeeTaxRowDisposition();
129
  } else {
130
  $exclPrice = $item->getRowTotal();
123
  if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) {
124
  $typeOfDisplay = Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales');
125
  if ($typeOfDisplay && $item->getWeeeTaxAppliedAmount()) {
126
+ $exclPrice = $item->getRowTotal() + $item->getWeeeTaxAppliedRowAmount()
 
127
  + $item->getWeeeTaxRowDisposition();
128
  } else {
129
  $exclPrice = $item->getRowTotal();
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Payment_Method_Ccsave
35
- extends Mage_Payment_Block_Form_Ccsave
36
  {
37
  /**
38
  * Prevent any rendering
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Payment_Method_Ccsave extends Mage_Payment_Block_Form_Ccsave
 
35
  {
36
  /**
37
  * Prevent any rendering
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Payment_Method_Checkmo
35
- extends Mage_Payment_Block_Form_Checkmo
36
  {
37
  /**
38
  * Prevent any rendering
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Payment_Method_Checkmo extends Mage_Payment_Block_Form_Checkmo
 
35
  {
36
  /**
37
  * Prevent any rendering
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Authorizenet
35
- extends Mage_Paygate_Block_Authorizenet_Info_Cc
36
  {
37
  /**
38
  * Add Authorizenet info to order XML object
@@ -44,31 +43,20 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Authorizenet
44
  {
45
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
46
  if (!$this->getHideTitle()) {
47
- $orderItemXmlObj->addAttribute(
48
- 'title',
49
- $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
50
- );
51
  }
52
 
53
  $cards = $this->getCards();
54
  $showCount = count($cards) > 1;
55
 
56
  foreach ($cards as $key => $card) {
57
- $creditCard = $orderItemXmlObj->addCustomChild(
58
- 'item',
59
- null,
60
- array(
61
- 'label' => $showCount ? $this->__('Credit Card %s', $key + 1) : $this->__('Credit Card')
62
- )
63
- );
64
  foreach ($card as $label => $value) {
65
- $creditCard->addCustomChild(
66
- 'item',
67
- implode($this->getValueAsArray($value, true), PHP_EOL),
68
- array(
69
- 'label' => $label
70
- )
71
- );
72
  }
73
  }
74
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Authorizenet extends Mage_Paygate_Block_Authorizenet_Info_Cc
 
35
  {
36
  /**
37
  * Add Authorizenet info to order XML object
43
  {
44
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
45
  if (!$this->getHideTitle()) {
46
+ $orderItemXmlObj->addAttribute('title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle()));
 
 
 
47
  }
48
 
49
  $cards = $this->getCards();
50
  $showCount = count($cards) > 1;
51
 
52
  foreach ($cards as $key => $card) {
53
+ $creditCard = $orderItemXmlObj->addCustomChild('item', null, array(
54
+ 'label' => $showCount ? $this->__('Credit Card %s', $key + 1) : $this->__('Credit Card')
55
+ ));
 
 
 
 
56
  foreach ($card as $label => $value) {
57
+ $creditCard->addCustomChild('item', implode($this->getValueAsArray($value, true), '\n'), array(
58
+ 'label' => $label
59
+ ));
 
 
 
 
60
  }
61
  }
62
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php CHANGED
@@ -42,20 +42,13 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Ccsave extends Mage_Pay
42
  public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
43
  {
44
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
45
- $orderItemXmlObj->addAttribute(
46
- 'title',
47
- $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
48
- );
49
 
50
  if ($_specificInfo = $this->getSpecificInformation()) {
51
  foreach ($_specificInfo as $label => $value) {
52
- $orderItemXmlObj->addCustomChild(
53
- 'item',
54
- implode($this->getValueAsArray($value, true), PHP_EOL),
55
- array(
56
- 'label' => $label
57
- )
58
- );
59
  }
60
  }
61
  }
42
  public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
43
  {
44
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
45
+ $orderItemXmlObj->addAttribute('title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle()));
 
 
 
46
 
47
  if ($_specificInfo = $this->getSpecificInformation()) {
48
  foreach ($_specificInfo as $label => $value) {
49
+ $orderItemXmlObj->addCustomChild('item', implode($this->getValueAsArray($value, true), '\n'), array(
50
+ 'label' => $label
51
+ ));
 
 
 
 
52
  }
53
  }
54
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php CHANGED
@@ -43,28 +43,19 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Checkmo extends Mage_Pa
43
  {
44
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
45
  $orderItemXmlObj->addAttribute(
46
- 'title',
47
- $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
48
  );
49
 
50
  if ($this->getInfo()->getAdditionalData()) {
51
  if ($this->getPayableTo()) {
52
- $orderItemXmlObj->addCustomChild(
53
- 'item',
54
- $this->getPayableTo(),
55
- array(
56
- 'label' => Mage::helper('sales')->__('Make Check payable to:')
57
- )
58
- );
59
  }
60
  if ($this->getMailingAddress()) {
61
- $orderItemXmlObj->addCustomChild(
62
- 'item',
63
- $this->getMailingAddress(),
64
- array(
65
- 'label' => Mage::helper('payment')->__('Send Check to:')
66
- )
67
- );
68
  }
69
  }
70
  }
43
  {
44
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
45
  $orderItemXmlObj->addAttribute(
46
+ 'title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
 
47
  );
48
 
49
  if ($this->getInfo()->getAdditionalData()) {
50
  if ($this->getPayableTo()) {
51
+ $orderItemXmlObj->addCustomChild('item', $this->getPayableTo(), array(
52
+ 'label' => Mage::helper('sales')->__('Make Check payable to:')
53
+ ));
 
 
 
 
54
  }
55
  if ($this->getMailingAddress()) {
56
+ $orderItemXmlObj->addCustomChild('item', $this->getMailingAddress(), array(
57
+ 'label' => Mage::helper('payment')->__('Send Check to:')
58
+ ));
 
 
 
 
59
  }
60
  }
61
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php CHANGED
@@ -42,9 +42,6 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Free extends Mage_Payme
42
  public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
43
  {
44
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
45
- $orderItemXmlObj->addAttribute(
46
- 'title',
47
- $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
48
- );
49
  }
50
  }
42
  public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
43
  {
44
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
45
+ $orderItemXmlObj->addAttribute('title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle()));
 
 
 
46
  }
47
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php CHANGED
@@ -44,19 +44,14 @@ abstract class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Paypal_Abstrac
44
  {
45
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
46
  $orderItemXmlObj->addAttribute(
47
- 'title',
48
- $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
49
  );
50
 
51
  if ($_specificInfo = $this->getSpecificInformation()) {
52
  foreach ($_specificInfo as $label => $value) {
53
- $orderItemXmlObj->addCustomChild(
54
- 'item',
55
- implode($this->getValueAsArray($value, true), PHP_EOL),
56
- array(
57
- 'label' => $label
58
- )
59
- );
60
  }
61
  }
62
  }
44
  {
45
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
46
  $orderItemXmlObj->addAttribute(
47
+ 'title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
 
48
  );
49
 
50
  if ($_specificInfo = $this->getSpecificInformation()) {
51
  foreach ($_specificInfo as $label => $value) {
52
+ $orderItemXmlObj->addCustomChild('item', implode($this->getValueAsArray($value, true), '\n'), array(
53
+ 'label' => $label
54
+ ));
 
 
 
 
55
  }
56
  }
57
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Verisign
35
- extends Mage_Payment_Block_Info_Cc
36
  {
37
  /**
38
  * Add CC Save Payment info to order XML object
@@ -44,19 +43,14 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Verisign
44
  {
45
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
46
  $orderItemXmlObj->addAttribute(
47
- 'title',
48
- $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
49
  );
50
 
51
  if ($_specificInfo = $this->getSpecificInformation()) {
52
  foreach ($_specificInfo as $label => $value) {
53
- $orderItemXmlObj->addCustomChild(
54
- 'item',
55
- implode($this->getValueAsArray($value, true), PHP_EOL),
56
- array(
57
- 'label' => $label
58
- )
59
- );
60
  }
61
  }
62
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Verisign extends Mage_Payment_Block_Info_Cc
 
35
  {
36
  /**
37
  * Add CC Save Payment info to order XML object
43
  {
44
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
45
  $orderItemXmlObj->addAttribute(
46
+ 'title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
 
47
  );
48
 
49
  if ($_specificInfo = $this->getSpecificInformation()) {
50
  foreach ($_specificInfo as $label => $value) {
51
+ $orderItemXmlObj->addCustomChild('item', implode($this->getValueAsArray($value, true), '\n'), array(
52
+ 'label' => $label
53
+ ));
 
 
 
 
54
  }
55
  }
56
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Purchaseorder
35
- extends Mage_Payment_Block_Info_Purchaseorder
36
  {
37
  /**
38
  * Add Purchase Order Payment info to order XML object
@@ -43,17 +42,10 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Purchaseorder
43
  public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
44
  {
45
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
46
- $orderItemXmlObj->addAttribute(
47
- 'title',
48
- $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle())
49
- );
50
 
51
- $orderItemXmlObj->addCustomChild(
52
- 'item',
53
- $this->getInfo()->getPoNumber(),
54
- array(
55
- 'label' => Mage::helper('sales')->__('Purchase Order Number:')
56
- )
57
- );
58
  }
59
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Purchaseorder extends Mage_Payment_Block_Info_Purchaseorder
 
35
  {
36
  /**
37
  * Add Purchase Order Payment info to order XML object
42
  public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
43
  {
44
  $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
45
+ $orderItemXmlObj->addAttribute('title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle()));
 
 
 
46
 
47
+ $orderItemXmlObj->addCustomChild('item', $this->getInfo()->getPoNumber(), array(
48
+ 'label' => Mage::helper('sales')->__('Purchase Order Number:')
49
+ ));
 
 
 
 
50
  }
51
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Payment_Method_List
35
- extends Mage_Payment_Block_Form_Container
36
  {
37
  /**
38
  * Pre-defined array of methods that we are going to render
@@ -57,10 +56,7 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_List
57
  * @var array
58
  */
59
  protected $_pbridgeMethodArray = array(
60
- 'pbridge_authorizenet',
61
- 'pbridge_paypal',
62
- 'pbridge_verisign',
63
- 'pbridge_paypaluk',
64
  );
65
 
66
  /**
@@ -96,17 +92,13 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_List
96
  $storeCreditFlag = (int) Mage::getStoreConfig(Enterprise_CustomerBalance_Helper_Data::XML_PATH_ENABLED);
97
  if ($storeCreditFlag && $customerBalanceBlock->isDisplayContainer()) {
98
  $balance = $this->getQuote()->getStore()->formatPrice($customerBalanceBlock->getBalance(), false);
99
- $methodsXmlObj->addCustomChild(
100
- 'customer_balance',
101
- null,
102
- array(
103
- 'post_name' => 'payment[use_customer_balance]',
104
- 'code' => 1,
105
- 'label' => $this->__('Use Store Credit (%s available)', $balance),
106
- 'is_cover_a_quote' => intval($customerBalanceBlock->isFullyPaidAfterApplication()),
107
- 'selected' => intval($customerBalanceBlock->isCustomerBalanceUsed())
108
- )
109
- );
110
  }
111
  }
112
 
@@ -118,37 +110,23 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_List
118
  public function addGiftcardToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $methodsXmlObj)
119
  {
120
  $giftcardInfoBlock = $this->getLayout()->addBlock(
121
- 'enterprise_giftcardaccount/checkout_onepage_payment_additional',
122
- 'giftcard_info'
123
  );
124
 
125
  if (intval($giftcardInfoBlock->getAppliedGiftCardAmount())) {
126
- $amount = $this->getQuote()
127
- ->getStore()
128
- ->formatPrice($giftcardInfoBlock->getAppliedGiftCardAmount(), false);
129
  $amount = $this->__('Gift Card amount applied to order: %s', $amount);
130
 
131
- $methodsXmlObj->addCustomChild(
132
- 'information',
133
- null,
134
- array(
135
- 'label' => $amount,
136
- 'disabled' => '1'
137
- )
138
- );
139
 
140
  if ($this->_isPaymentRequired()) {
141
- $methodsXmlObj->addCustomChild(
142
- 'method',
143
- null,
144
- array(
145
- 'post_name' => 'payment[method]',
146
- 'code' => 'free',
147
- 'label' => $this->__('No Payment Information Required'),
148
- 'selected' => '1',
149
- 'disabled' => '1'
150
- )
151
- );
152
  }
153
  $this->setIsUsedGiftCard(true);
154
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Payment_Method_List extends Mage_Payment_Block_Form_Container
 
35
  {
36
  /**
37
  * Pre-defined array of methods that we are going to render
56
  * @var array
57
  */
58
  protected $_pbridgeMethodArray = array(
59
+ 'pbridge_authorizenet', 'pbridge_paypal', 'pbridge_verisign', 'pbridge_paypaluk'
 
 
 
60
  );
61
 
62
  /**
92
  $storeCreditFlag = (int) Mage::getStoreConfig(Enterprise_CustomerBalance_Helper_Data::XML_PATH_ENABLED);
93
  if ($storeCreditFlag && $customerBalanceBlock->isDisplayContainer()) {
94
  $balance = $this->getQuote()->getStore()->formatPrice($customerBalanceBlock->getBalance(), false);
95
+ $methodsXmlObj->addCustomChild('customer_balance', null, array(
96
+ 'post_name' => 'payment[use_customer_balance]',
97
+ 'code' => 1,
98
+ 'label' => $this->__('Use Store Credit (%s available)', $balance),
99
+ 'is_cover_a_quote' => intval($customerBalanceBlock->isFullyPaidAfterApplication()),
100
+ 'selected' => intval($customerBalanceBlock->isCustomerBalanceUsed())
101
+ ));
 
 
 
 
102
  }
103
  }
104
 
110
  public function addGiftcardToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $methodsXmlObj)
111
  {
112
  $giftcardInfoBlock = $this->getLayout()->addBlock(
113
+ 'enterprise_giftcardaccount/checkout_onepage_payment_additional', 'giftcard_info'
 
114
  );
115
 
116
  if (intval($giftcardInfoBlock->getAppliedGiftCardAmount())) {
117
+ $amount = $this->getQuote()->getStore()->formatPrice($giftcardInfoBlock->getAppliedGiftCardAmount(), false);
 
 
118
  $amount = $this->__('Gift Card amount applied to order: %s', $amount);
119
 
120
+ $methodsXmlObj->addCustomChild('information', null, array('label' => $amount, 'disabled' => '1'));
 
 
 
 
 
 
 
121
 
122
  if ($this->_isPaymentRequired()) {
123
+ $methodsXmlObj->addCustomChild('method', null, array(
124
+ 'post_name' => 'payment[method]',
125
+ 'code' => 'free',
126
+ 'label' => $this->__('No Payment Information Required'),
127
+ 'selected' => '1',
128
+ 'disabled' => '1'
129
+ ));
 
 
 
 
130
  }
131
  $this->setIsUsedGiftCard(true);
132
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Payment_Method_Paypal_Payflow
35
- extends Mage_Payment_Block_Form_Ccsave
36
  {
37
  /**
38
  * Prevent any rendering
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Payment_Method_Paypal_Payflow extends Mage_Payment_Block_Form_Ccsave
 
35
  {
36
  /**
37
  * Prevent any rendering
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Payment_Method_Purchaseorder
35
- extends Mage_Payment_Block_Form_Purchaseorder
36
  {
37
  /**
38
  * Prevent any rendering
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Payment_Method_Purchaseorder extends Mage_Payment_Block_Form_Purchaseorder
 
35
  {
36
  /**
37
  * Prevent any rendering
app/code/core/Mage/XmlConnect/Block/Configuration.php CHANGED
@@ -99,7 +99,7 @@ class Mage_XmlConnect_Block_Configuration extends Mage_Core_Block_Template
99
  } else {
100
  $value = (string)$value;
101
  if ($value != '') {
102
- $section->addChild($key, Mage::helper('core')->htmlEscape($value));
103
  }
104
  }
105
  }
@@ -113,13 +113,7 @@ class Mage_XmlConnect_Block_Configuration extends Mage_Core_Block_Template
113
  protected function _toHtml()
114
  {
115
  $xml = Mage::getModel('xmlconnect/simplexml_element', '<configuration></configuration>');
116
- $this->_buildRecursive(
117
- $xml,
118
- Mage::helper('xmlconnect')
119
- ->excludeXmlConfigKeys(
120
- $this->_app->getRenderConf()
121
- )
122
- );
123
  return $xml->asNiceXml();
124
  }
125
  }
99
  } else {
100
  $value = (string)$value;
101
  if ($value != '') {
102
+ $section->addChild($key, Mage::helper('core')->escapeHtml($value));
103
  }
104
  }
105
  }
113
  protected function _toHtml()
114
  {
115
  $xml = Mage::getModel('xmlconnect/simplexml_element', '<configuration></configuration>');
116
+ $this->_buildRecursive($xml, Mage::helper('xmlconnect')->excludeXmlConfigKeys($this->_app->getRenderConf()));
 
 
 
 
 
 
117
  return $xml->asNiceXml();
118
  }
119
  }
app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php CHANGED
@@ -51,7 +51,7 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
51
  * - 'select' => 'enterprise_customer/form_renderer_select',
52
  * - 'multiselect' => 'enterprise_customer/form_renderer_multiselect',
53
  * - 'boolean' => 'enterprise_customer/form_renderer_boolean',
54
- * - 'file' => 'enterprise_customer/form_renderer_file'
55
  * - 'image' => 'enterprise_customer/form_renderer_image'
56
  *
57
  * @see customer.xml layout customer_form_template_handle node
@@ -85,12 +85,8 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
85
  $billingChecked = $shippingChecked = false;
86
 
87
  if ($addressId && $address && $address->getId()) {
88
- $defaultBillingAddressId = Mage::getSingleton('customer/session')
89
- ->getCustomer()
90
- ->getDefaultBilling();
91
- $defaultShippingAddressId = Mage::getSingleton('customer/session')
92
- ->getCustomer()
93
- ->getDefaultShipping();
94
 
95
  $billingChecked = (int)$addressId == $defaultBillingAddressId;
96
  $shippingChecked = (int)$addressId == $defaultShippingAddressId;
@@ -107,8 +103,7 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
107
  $fax = $address->getFax();
108
  }
109
 
110
- $action = Mage::helper('xmlconnect')
111
- ->getActionUrl('xmlconnect/customer/saveaddress');
112
 
113
  /** @var Mage_XmlConnect_Model_Simplexml_Form $fromXmlObj */
114
  $fromXmlObj = Mage::getModel('xmlconnect/simplexml_form', array(
@@ -117,13 +112,9 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
117
  'use_container' => true
118
  ));
119
 
120
- $contactInfoFieldset = $fromXmlObj->addFieldset(
121
- 'contact_info',
122
- array('legend' => $this->__('Contact Information'))
123
- )
124
- ->setCustomAttributes(
125
- array('legend')
126
- );
127
 
128
  $this->_addCustomerContactInfo($contactInfoFieldset);
129
 
@@ -141,13 +132,8 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
141
  'value' => isset($fax) ? $fax : ''
142
  ));
143
 
144
- $addressFieldset = $fromXmlObj->addFieldset(
145
- 'address_info',
146
- array('legend' => $this->__('Address'))
147
- )
148
- ->setCustomAttributes(
149
- array('legend')
150
- );
151
 
152
  $addressFieldset->addField('street', 'text', array(
153
  'name' => 'street[]',
@@ -171,9 +157,9 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
171
  $region = isset($region) ? $region : null;
172
 
173
  $addressFieldset->addField('country_id', 'countryListSelect', array(
174
- 'label' => $this->__('Country'),
175
- 'required' => 'true',
176
- 'value' => array(
177
  'country_id' => $countryId,
178
  'region_id' => $regionId,
179
  'region' => $region
@@ -216,13 +202,12 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
216
  */
217
  protected function _addCustomerContactInfo(
218
  Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
219
- )
220
- {
221
  if (is_object(Mage::getConfig()->getNode('modules/Enterprise_Customer'))) {
222
- $this->setNameWidgetBlock($this->getLayout()
223
- ->createBlock('customer/widget_name')
224
- ->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getCustomer())
225
- );
226
 
227
  if ($this->getNameWidgetBlock()->showPrefix()) {
228
  $this->_addPrefix($contactInfoFieldset);
@@ -252,34 +237,28 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
252
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
253
  * @return Mage_XmlConnect_Block_Customer_Address_Form
254
  */
255
- protected function _addPrefix(
256
- Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
257
- )
258
  {
259
  $attributes = array();
260
  $attributes += $contactInfoFieldset->checkAttribute(
261
- 'value',
262
- $this->getNameWidgetBlock()->getObject()->getPrefix()
263
  );
264
 
265
  $attributes += $contactInfoFieldset->checkAttribute(
266
- 'required',
267
- (int)$this->getNameWidgetBlock()->isPrefixRequired()
268
  );
269
 
270
  if ($this->getNameWidgetBlock()->getPrefixOptions() === false) {
271
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'text', array(
272
- 'label' => $this->getNameWidgetBlock()->__('Prefix'),
273
- 'name' => $this->getNameWidgetBlock()->getFieldName('prefix')
274
- ) + $attributes
275
- );
276
  } else {
277
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'select', array(
278
- 'label' => $this->getNameWidgetBlock()->__('Prefix'),
279
- 'name' => $this->getNameWidgetBlock()->getFieldName('prefix'),
280
- 'options' => $this->getNameWidgetBlock()->getPrefixOptions()
281
- ) + $attributes
282
- );
283
  }
284
  return $this;
285
  }
@@ -296,28 +275,24 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
296
  {
297
  $attributes = array();
298
  $attributes += $contactInfoFieldset->checkAttribute(
299
- 'value',
300
- $this->getNameWidgetBlock()->getObject()->getSuffix()
301
  );
302
 
303
  $attributes += $contactInfoFieldset->checkAttribute(
304
- 'required',
305
- (int)$this->getNameWidgetBlock()->isSuffixRequired()
306
  );
307
 
308
  if ($this->getNameWidgetBlock()->getSuffixOptions() === false) {
309
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'text', array(
310
- 'label' => $this->getNameWidgetBlock()->__('Suffix'),
311
- 'name' => $this->getNameWidgetBlock()->getFieldName('suffix')
312
- ) + $attributes
313
- );
314
  } else {
315
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'select', array(
316
- 'label' => $this->getNameWidgetBlock()->__('Suffix'),
317
- 'name' => $this->getNameWidgetBlock()->getFieldName('suffix'),
318
- 'options' => $this->getNameWidgetBlock()->getSuffixOptions()
319
- ) + $attributes
320
- );
321
  }
322
  return $this;
323
  }
@@ -339,10 +314,10 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
339
  );
340
 
341
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('middlename'), 'text', array(
342
- 'label' => $this->getNameWidgetBlock()->__('M.I.'),
343
- 'name' => $this->getNameWidgetBlock()->getFieldName('middlename')
344
- ) + $attributes
345
- );
346
  return $this;
347
  }
348
 
@@ -354,10 +329,9 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
354
  */
355
  protected function _addFirstName(
356
  Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
357
- )
358
- {
359
  $firstName = $this->getAddress()->getFirstname();
360
- $contactInfoFieldset->addField('firstname', 'text',array(
361
  'label' => $this->__('First Name'),
362
  'required' => 'true',
363
  'value' => isset($firstName) ? $firstName : ''
@@ -373,8 +347,7 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
373
  */
374
  protected function _addLastName(
375
  Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
376
- )
377
- {
378
  $lastName = $this->getAddress()->getLastname();
379
  $contactInfoFieldset->addField('lastname', 'text', array(
380
  'label' => $this->__('Last Name'),
@@ -392,8 +365,7 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
392
  */
393
  protected function _addCustomAddressAttributes(
394
  Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $addressFieldset
395
- )
396
- {
397
  if (is_object(Mage::getConfig()->getNode('modules/Enterprise_Customer'))) {
398
  /** @var $addressAttrBlock Enterprise_Customer_Block_Form */
399
  $addressAttrBlock = $this->getLayout()
@@ -406,12 +378,11 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad
406
  }
407
 
408
  if ($addressAttrBlock->hasUserDefinedAttributes()) {
409
- foreach ($addressAttrBlock->getUserDefinedAttributes() as $code => $attribute) {
410
  $type = $attribute->getFrontendInput();
411
  $block = $addressAttrBlock->getRenderer($type);
412
  if ($block) {
413
- $block->setAttributeObject($attribute)
414
- ->setEntity($addressAttrBlock->getEntity())
415
  ->addFieldToXmlObj($addressFieldset);
416
  }
417
  }
51
  * - 'select' => 'enterprise_customer/form_renderer_select',
52
  * - 'multiselect' => 'enterprise_customer/form_renderer_multiselect',
53
  * - 'boolean' => 'enterprise_customer/form_renderer_boolean',
54
+ * - 'file' => 'enterprise_customer/form_renderer_file'
55
  * - 'image' => 'enterprise_customer/form_renderer_image'
56
  *
57
  * @see customer.xml layout customer_form_template_handle node
85
  $billingChecked = $shippingChecked = false;
86
 
87
  if ($addressId && $address && $address->getId()) {
88
+ $defaultBillingAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
89
+ $defaultShippingAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping();
 
 
 
 
90
 
91
  $billingChecked = (int)$addressId == $defaultBillingAddressId;
92
  $shippingChecked = (int)$addressId == $defaultShippingAddressId;
103
  $fax = $address->getFax();
104
  }
105
 
106
+ $action = Mage::helper('xmlconnect')->getActionUrl('xmlconnect/customer/saveaddress');
 
107
 
108
  /** @var Mage_XmlConnect_Model_Simplexml_Form $fromXmlObj */
109
  $fromXmlObj = Mage::getModel('xmlconnect/simplexml_form', array(
112
  'use_container' => true
113
  ));
114
 
115
+ $contactInfoFieldset = $fromXmlObj->addFieldset('contact_info', array(
116
+ 'legend' => $this->__('Contact Information')
117
+ ))->setCustomAttributes(array('legend'));
 
 
 
 
118
 
119
  $this->_addCustomerContactInfo($contactInfoFieldset);
120
 
132
  'value' => isset($fax) ? $fax : ''
133
  ));
134
 
135
+ $addressFieldset = $fromXmlObj->addFieldset('address_info', array('legend' => $this->__('Address')))
136
+ ->setCustomAttributes(array('legend'));
 
 
 
 
 
137
 
138
  $addressFieldset->addField('street', 'text', array(
139
  'name' => 'street[]',
157
  $region = isset($region) ? $region : null;
158
 
159
  $addressFieldset->addField('country_id', 'countryListSelect', array(
160
+ 'label' => $this->__('Country'),
161
+ 'required' => 'true',
162
+ 'value' => array(
163
  'country_id' => $countryId,
164
  'region_id' => $regionId,
165
  'region' => $region
202
  */
203
  protected function _addCustomerContactInfo(
204
  Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
205
+ ) {
 
206
  if (is_object(Mage::getConfig()->getNode('modules/Enterprise_Customer'))) {
207
+ $this->setNameWidgetBlock(
208
+ $this->getLayout()->createBlock('customer/widget_name')->setObject(
209
+ $this->getAddress()->getFirstname() ? $this->getAddress() : $this->getCustomer()
210
+ ));
211
 
212
  if ($this->getNameWidgetBlock()->showPrefix()) {
213
  $this->_addPrefix($contactInfoFieldset);
237
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
238
  * @return Mage_XmlConnect_Block_Customer_Address_Form
239
  */
240
+ protected function _addPrefix(Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset)
 
 
241
  {
242
  $attributes = array();
243
  $attributes += $contactInfoFieldset->checkAttribute(
244
+ 'value', $this->getNameWidgetBlock()->getObject()->getPrefix()
 
245
  );
246
 
247
  $attributes += $contactInfoFieldset->checkAttribute(
248
+ 'required', (int)$this->getNameWidgetBlock()->isPrefixRequired()
 
249
  );
250
 
251
  if ($this->getNameWidgetBlock()->getPrefixOptions() === false) {
252
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'text', array(
253
+ 'label' => $this->__('Prefix'),
254
+ 'name' => $this->getNameWidgetBlock()->getFieldName('prefix')
255
+ ) + $attributes);
 
256
  } else {
257
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'select', array(
258
+ 'label' => $this->__('Prefix'),
259
+ 'name' => $this->getNameWidgetBlock()->getFieldName('prefix'),
260
+ 'options' => $this->getNameWidgetBlock()->getPrefixOptions()
261
+ ) + $attributes);
 
262
  }
263
  return $this;
264
  }
275
  {
276
  $attributes = array();
277
  $attributes += $contactInfoFieldset->checkAttribute(
278
+ 'value', $this->getNameWidgetBlock()->getObject()->getSuffix()
 
279
  );
280
 
281
  $attributes += $contactInfoFieldset->checkAttribute(
282
+ 'required', (int)$this->getNameWidgetBlock()->isSuffixRequired()
 
283
  );
284
 
285
  if ($this->getNameWidgetBlock()->getSuffixOptions() === false) {
286
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'text', array(
287
+ 'label' => $this->__('Suffix'),
288
+ 'name' => $this->getNameWidgetBlock()->getFieldName('suffix')
289
+ ) + $attributes);
 
290
  } else {
291
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'select', array(
292
+ 'label' => $this->__('Suffix'),
293
+ 'name' => $this->getNameWidgetBlock()->getFieldName('suffix'),
294
+ 'options' => $this->getNameWidgetBlock()->getSuffixOptions()
295
+ ) + $attributes);
 
296
  }
297
  return $this;
298
  }
314
  );
315
 
316
  $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('middlename'), 'text', array(
317
+ 'label' => $this->__('M.I.'),
318
+ 'name' => $this->getNameWidgetBlock()->getFieldName('middlename')
319
+ ) + $attributes);
320
+
321
  return $this;
322
  }
323
 
329
  */
330
  protected function _addFirstName(
331
  Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
332
+ ) {
 
333
  $firstName = $this->getAddress()->getFirstname();
334
+ $contactInfoFieldset->addField('firstname', 'text', array(
335
  'label' => $this->__('First Name'),
336
  'required' => 'true',
337
  'value' => isset($firstName) ? $firstName : ''
347
  */
348
  protected function _addLastName(
349
  Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $contactInfoFieldset
350
+ ) {
 
351
  $lastName = $this->getAddress()->getLastname();
352
  $contactInfoFieldset->addField('lastname', 'text', array(
353
  'label' => $this->__('Last Name'),
365
  */
366
  protected function _addCustomAddressAttributes(
367
  Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $addressFieldset
368
+ ) {
 
369
  if (is_object(Mage::getConfig()->getNode('modules/Enterprise_Customer'))) {
370
  /** @var $addressAttrBlock Enterprise_Customer_Block_Form */
371
  $addressAttrBlock = $this->getLayout()
378
  }
379
 
380
  if ($addressAttrBlock->hasUserDefinedAttributes()) {
381
+ foreach ($addressAttrBlock->getUserDefinedAttributes() as $attribute) {
382
  $type = $attribute->getFrontendInput();
383
  $block = $addressAttrBlock->getRenderer($type);
384
  if ($block) {
385
+ $block->setAttributeObject($attribute)->setEntity($addressAttrBlock->getEntity())
 
386
  ->addFieldToXmlObj($addressFieldset);
387
  }
388
  }
app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php CHANGED
@@ -82,19 +82,15 @@ class Mage_XmlConnect_Block_Customer_Address_List extends Mage_Core_Block_Templa
82
  * @return array
83
  */
84
  public function prepareAddressData(
85
- Mage_Customer_Model_Address $address,
86
- Mage_XmlConnect_Model_Simplexml_Element $item
87
- )
88
- {
89
  if (!$address) {
90
  return array();
91
  }
92
 
93
  $attributes = Mage::helper('customer/address')->getAttributes();
94
 
95
- $data = array(
96
- 'entity_id' => $address->getId()
97
- );
98
 
99
  foreach ($attributes as $attribute) {
100
  /* @var $attribute Mage_Customer_Model_Attribute */
@@ -110,7 +106,7 @@ class Mage_XmlConnect_Block_Customer_Address_List extends Mage_Core_Block_Templa
110
  $dataModel = Mage_Customer_Model_Attribute_Data::factory($attribute, $address);
111
  $value = $dataModel->outputValue(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ONELINE);
112
  if ($attribute->getFrontendInput() == 'multiline') {
113
- $values = $dataModel->outputValue(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ARRAY);
114
  // explode lines
115
  foreach ($values as $k => $v) {
116
  $key = sprintf('%s%d', $attribute->getAttributeCode(), $k + 1);
@@ -122,9 +118,10 @@ class Mage_XmlConnect_Block_Customer_Address_List extends Mage_Core_Block_Templa
122
  }
123
 
124
  foreach ($data as $key => $value) {
125
- if (!empty($value)) {
126
- $item->addChild($key, $item->escapeXml($value));
127
  }
 
128
  }
129
  }
130
  }
82
  * @return array
83
  */
84
  public function prepareAddressData(
85
+ Mage_Customer_Model_Address $address, Mage_XmlConnect_Model_Simplexml_Element $item
86
+ ) {
 
 
87
  if (!$address) {
88
  return array();
89
  }
90
 
91
  $attributes = Mage::helper('customer/address')->getAttributes();
92
 
93
+ $data = array('entity_id' => $address->getId());
 
 
94
 
95
  foreach ($attributes as $attribute) {
96
  /* @var $attribute Mage_Customer_Model_Attribute */
106
  $dataModel = Mage_Customer_Model_Attribute_Data::factory($attribute, $address);
107
  $value = $dataModel->outputValue(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ONELINE);
108
  if ($attribute->getFrontendInput() == 'multiline') {
109
+ $values = $dataModel->outputValue(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ARRAY);
110
  // explode lines
111
  foreach ($values as $k => $v) {
112
  $key = sprintf('%s%d', $attribute->getAttributeCode(), $k + 1);
118
  }
119
 
120
  foreach ($data as $key => $value) {
121
+ if (empty($value)) {
122
+ continue;
123
  }
124
+ $item->addChild($key, $item->escapeXml($value));
125
  }
126
  }
127
  }
app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Boolean.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Form_Renderer_Boolean
35
- extends Mage_XmlConnect_Block_Customer_Form_Renderer_Select
36
  {
37
  /**
38
  * Return array of select options
@@ -42,18 +41,9 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_Boolean
42
  public function getOptions()
43
  {
44
  return array(
45
- array(
46
- 'value' => '',
47
- 'label' => ''
48
- ),
49
- array(
50
- 'value' => '0',
51
- 'label' => Mage::helper('enterprise_customer')->__('No')
52
- ),
53
- array(
54
- 'value' => '1',
55
- 'label' => Mage::helper('enterprise_customer')->__('Yes')
56
- ),
57
  );
58
  }
59
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Form_Renderer_Boolean extends Mage_XmlConnect_Block_Customer_Form_Renderer_Select
 
35
  {
36
  /**
37
  * Return array of select options
41
  public function getOptions()
42
  {
43
  return array(
44
+ array('value' => '', 'label' => ''),
45
+ array('value' => '0', 'label' => Mage::helper('enterprise_customer')->__('No')),
46
+ array('value' => '1', 'label' => Mage::helper('enterprise_customer')->__('Yes'))
 
 
 
 
 
 
 
 
 
47
  );
48
  }
49
  }
app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Date.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Form_Renderer_Date
35
- extends Enterprise_Customer_Block_Form_Renderer_Date
36
  {
37
  /**
38
  * Field type
@@ -48,26 +47,22 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_Date
48
  */
49
  protected function _prepareValues()
50
  {
51
- return array(
52
- 'day' => array(
53
- 'id' => $this->getHtmlId('day'),
54
- 'title' => $this->__('Day'),
55
- 'label' => $this->__('DD'),
56
- 'value' => $this->getDay()
57
- ),
58
- 'month' => array(
59
- 'id' => $this->getHtmlId('month'),
60
- 'title' => $this->__('Month'),
61
- 'label' => $this->__('MM'),
62
- 'value' => $this->getMonth()
63
- ),
64
- 'year' => array(
65
- 'id' => $this->getHtmlId('year'),
66
- 'title' => $this->__('Year'),
67
- 'label' => $this->__('YYYY'),
68
- 'value' => $this->getYear()
69
- )
70
- );
71
  }
72
 
73
  /**
@@ -81,27 +76,19 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_Date
81
  $attributes = array(
82
  'label' => $this->getLabel(),
83
  'name' => $this->getFieldName(),
84
- 'format' => $this->getDateFormat(),
85
  'value' => $this->_prepareValues()
86
  );
87
 
88
  $attributes += Mage::helper('xmlconnect/customer_form_renderer')
89
  ->addTitleAndRequiredAttr($fieldsetXmlObj, $this);
90
-
91
- $fieldXmlObj = $fieldsetXmlObj->addField(
92
- $this->getHtmlId('full'),
93
- $this->_filedType,
94
- $attributes
95
- );
96
-
97
  $validateRules = $this->getAttributeObject()->getValidateRules();
98
 
99
  if (!empty($validateRules)) {
100
  $validatorXmlObj = $fieldXmlObj->addValidator();
101
  if (!empty($validateRules['input_validation'])) {
102
- $validatorXmlObj->addRule(array (
103
- 'type' => $validateRules['input_validation']
104
- ));
105
  }
106
  }
107
 
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Form_Renderer_Date extends Enterprise_Customer_Block_Form_Renderer_Date
 
35
  {
36
  /**
37
  * Field type
47
  */
48
  protected function _prepareValues()
49
  {
50
+ return array('day' => array(
51
+ 'id' => $this->getHtmlId('day'),
52
+ 'title' => $this->__('Day'),
53
+ 'label' => $this->__('DD'),
54
+ 'value' => $this->getDay()
55
+ ), 'month' => array(
56
+ 'id' => $this->getHtmlId('month'),
57
+ 'title' => $this->__('Month'),
58
+ 'label' => $this->__('MM'),
59
+ 'value' => $this->getMonth()
60
+ ), 'year' => array(
61
+ 'id' => $this->getHtmlId('year'),
62
+ 'title' => $this->__('Year'),
63
+ 'label' => $this->__('YYYY'),
64
+ 'value' => $this->getYear()
65
+ ));
 
 
 
 
66
  }
67
 
68
  /**
76
  $attributes = array(
77
  'label' => $this->getLabel(),
78
  'name' => $this->getFieldName(),
79
+ 'format'=> $this->getDateFormat(),
80
  'value' => $this->_prepareValues()
81
  );
82
 
83
  $attributes += Mage::helper('xmlconnect/customer_form_renderer')
84
  ->addTitleAndRequiredAttr($fieldsetXmlObj, $this);
85
+ $fieldXmlObj = $fieldsetXmlObj->addField($this->getHtmlId('full'), $this->_filedType, $attributes);
 
 
 
 
 
 
86
  $validateRules = $this->getAttributeObject()->getValidateRules();
87
 
88
  if (!empty($validateRules)) {
89
  $validatorXmlObj = $fieldXmlObj->addValidator();
90
  if (!empty($validateRules['input_validation'])) {
91
+ $validatorXmlObj->addRule(array('type' => $validateRules['input_validation']));
 
 
92
  }
93
  }
94
 
app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/File.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Form_Renderer_File
35
- extends Enterprise_Customer_Block_Form_Renderer_File
36
  {
37
  /**
38
  * Field type
@@ -65,19 +64,13 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_File
65
  $this->_setFormPostParams($fieldsetXmlObj);
66
 
67
  $attributes = array(
68
- 'label' => $this->getLabel(),
69
- 'name' => $this->getFieldName(),
70
- 'value' => $this->getEscapedValue()
71
  );
72
 
73
  $attributes += Mage::helper('xmlconnect/customer_form_renderer')
74
  ->addTitleAndRequiredAttr($fieldsetXmlObj, $this);
75
 
76
- $fieldXmlObj = $fieldsetXmlObj->addField(
77
- $this->getHtmlId(),
78
- $this->_filedType,
79
- $attributes
80
- );
81
  $this->_addValidator($fieldXmlObj);
82
 
83
  return $this;
@@ -98,19 +91,19 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_File
98
 
99
  if (!empty($validateRules['max_file_size'])) {
100
  $minTextLength = (int) $validateRules['max_file_size'];
101
- $validatorXmlObj->addRule(array (
102
- 'type' => 'max_file_size',
103
- 'value' => $minTextLength,
104
- 'field_label' => $this->getLabel()
105
  ));
106
  }
107
 
108
  if (!empty($validateRules['file_extensions'])) {
109
  $maxTextLength = $validateRules['file_extensions'];
110
- $validatorXmlObj->addRule(array (
111
- 'type' => 'file_extensions',
112
- 'value' => $maxTextLength,
113
- 'field_label' => $this->getLabel()
114
  ));
115
  }
116
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Form_Renderer_File extends Enterprise_Customer_Block_Form_Renderer_File
 
35
  {
36
  /**
37
  * Field type
64
  $this->_setFormPostParams($fieldsetXmlObj);
65
 
66
  $attributes = array(
67
+ 'label' => $this->getLabel(), 'name' => $this->getFieldName(), 'value' => $this->getEscapedValue()
 
 
68
  );
69
 
70
  $attributes += Mage::helper('xmlconnect/customer_form_renderer')
71
  ->addTitleAndRequiredAttr($fieldsetXmlObj, $this);
72
 
73
+ $fieldXmlObj = $fieldsetXmlObj->addField($this->getHtmlId(), $this->_filedType, $attributes);
 
 
 
 
74
  $this->_addValidator($fieldXmlObj);
75
 
76
  return $this;
91
 
92
  if (!empty($validateRules['max_file_size'])) {
93
  $minTextLength = (int) $validateRules['max_file_size'];
94
+ $validatorXmlObj->addRule(array(
95
+ 'type' => 'max_file_size',
96
+ 'value' => $minTextLength,
97
+ 'field_label' => $this->getLabel()
98
  ));
99
  }
100
 
101
  if (!empty($validateRules['file_extensions'])) {
102
  $maxTextLength = $validateRules['file_extensions'];
103
+ $validatorXmlObj->addRule(array(
104
+ 'type' => 'file_extensions',
105
+ 'value' => $maxTextLength,
106
+ 'field_label' => $this->getLabel()
107
  ));
108
  }
109
  }
app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Image.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Form_Renderer_Image
35
- extends Mage_XmlConnect_Block_Customer_Form_Renderer_File
36
  {
37
  /**
38
  * Field type
@@ -67,19 +66,15 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_Image
67
 
68
  if (!empty($validateRules['max_image_width'])) {
69
  $minTextLength = (int) $validateRules['max_image_width'];
70
- $validatorXmlObj->addRule(array (
71
- 'type' => 'max_image_width',
72
- 'value' => $minTextLength,
73
- 'field_label' => $this->getLabel()
74
  ));
75
  }
76
 
77
  if (!empty($validateRules['max_image_heght'])) {
78
  $maxTextLength = $validateRules['max_image_heght'];
79
- $validatorXmlObj->addRule(array (
80
- 'type' => 'max_image_height',
81
- 'value' => $maxTextLength,
82
- 'field_label' => $this->getLabel()
83
  ));
84
  }
85
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Form_Renderer_Image extends Mage_XmlConnect_Block_Customer_Form_Renderer_File
 
35
  {
36
  /**
37
  * Field type
66
 
67
  if (!empty($validateRules['max_image_width'])) {
68
  $minTextLength = (int) $validateRules['max_image_width'];
69
+ $validatorXmlObj->addRule(array(
70
+ 'type' => 'max_image_width', 'value' => $minTextLength, 'field_label' => $this->getLabel()
 
 
71
  ));
72
  }
73
 
74
  if (!empty($validateRules['max_image_heght'])) {
75
  $maxTextLength = $validateRules['max_image_heght'];
76
+ $validatorXmlObj->addRule(array(
77
+ 'type' => 'max_image_height', 'value' => $maxTextLength, 'field_label' => $this->getLabel()
 
 
78
  ));
79
  }
80
  }
app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Multiline.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Form_Renderer_Multiline
35
- extends Enterprise_Customer_Block_Form_Renderer_Multiline
36
  {
37
  /**
38
  * Field type
@@ -61,9 +60,7 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_Multiline
61
  ->addTitleAndRequiredAttr($fieldsetXmlObj, $this);
62
 
63
  $fieldXmlObj = $fieldsetXmlObj->addField(
64
- $this->_filedType . '_' . $this->getHtmlId(),
65
- $this->_filedType,
66
- $attributes
67
  );
68
 
69
  $validateRules = $this->getAttributeObject()->getValidateRules();
@@ -73,24 +70,16 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_Multiline
73
 
74
  if (!empty($validateRules['min_text_length'])) {
75
  $minTextLength = (int) $validateRules['min_text_length'];
76
- $validatorXmlObj->addRule(array (
77
- 'type' => 'min_length',
78
- 'value' => $minTextLength,
79
- ));
80
  }
81
 
82
  if (!empty($validateRules['max_text_length'])) {
83
  $maxTextLength = (int) $validateRules['max_text_length'];
84
- $validatorXmlObj->addRule(array (
85
- 'type' => 'max_length',
86
- 'value' => $maxTextLength
87
- ));
88
  }
89
 
90
  if (!empty($validateRules['input_validation'])) {
91
- $validatorXmlObj->addRule(array (
92
- 'type' => $validateRules['input_validation']
93
- ));
94
  }
95
  }
96
 
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Form_Renderer_Multiline extends Enterprise_Customer_Block_Form_Renderer_Multiline
 
35
  {
36
  /**
37
  * Field type
60
  ->addTitleAndRequiredAttr($fieldsetXmlObj, $this);
61
 
62
  $fieldXmlObj = $fieldsetXmlObj->addField(
63
+ $this->_filedType . '_' . $this->getHtmlId(), $this->_filedType, $attributes
 
 
64
  );
65
 
66
  $validateRules = $this->getAttributeObject()->getValidateRules();
70
 
71
  if (!empty($validateRules['min_text_length'])) {
72
  $minTextLength = (int) $validateRules['min_text_length'];
73
+ $validatorXmlObj->addRule(array('type' => 'min_length', 'value' => $minTextLength));
 
 
 
74
  }
75
 
76
  if (!empty($validateRules['max_text_length'])) {
77
  $maxTextLength = (int) $validateRules['max_text_length'];
78
+ $validatorXmlObj->addRule(array('type' => 'max_length', 'value' => $maxTextLength));
 
 
 
79
  }
80
 
81
  if (!empty($validateRules['input_validation'])) {
82
+ $validatorXmlObj->addRule(array('type' => $validateRules['input_validation']));
 
 
83
  }
84
  }
85
 
app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Select.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Form_Renderer_Select
35
- extends Enterprise_Customer_Block_Form_Renderer_Select
36
  {
37
  /**
38
  * Field type
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Form_Renderer_Select extends Enterprise_Customer_Block_Form_Renderer_Select
 
35
  {
36
  /**
37
  * Field type
app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Text.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Form_Renderer_Text
35
- extends Enterprise_Customer_Block_Form_Renderer_Text
36
  {
37
  /**
38
  * Field type
@@ -47,24 +46,16 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_Text
47
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $fieldsetXmlObj
48
  * @return Mage_XmlConnect_Block_Customer_Form_Renderer_Text
49
  */
50
- public function addFieldToXmlObj(
51
- Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $fieldsetXmlObj
52
- )
53
  {
54
  $attributes = array(
55
- 'label' => $this->getLabel(),
56
- 'name' => $this->getFieldName(),
57
- 'value' => $this->getEscapedValue()
58
  );
59
 
60
  $attributes += Mage::helper('xmlconnect/customer_form_renderer')
61
  ->addTitleAndRequiredAttr($fieldsetXmlObj, $this);
62
 
63
- $fieldXmlObj = $fieldsetXmlObj->addField(
64
- $this->getHtmlId(),
65
- $this->_filedType,
66
- $attributes
67
- );
68
 
69
  $validateRules = $this->getAttributeObject()->getValidateRules();
70
 
@@ -73,24 +64,16 @@ class Mage_XmlConnect_Block_Customer_Form_Renderer_Text
73
 
74
  if (!empty($validateRules['min_text_length'])) {
75
  $minTextLength = (int) $validateRules['min_text_length'];
76
- $validatorXmlObj->addRule(array (
77
- 'type' => 'min_length',
78
- 'value' => $minTextLength,
79
- ));
80
  }
81
 
82
  if (!empty($validateRules['max_text_length'])) {
83
  $maxTextLength = (int) $validateRules['max_text_length'];
84
- $validatorXmlObj->addRule(array (
85
- 'type' => 'max_length',
86
- 'value' => $maxTextLength
87
- ));
88
  }
89
 
90
  if (!empty($validateRules['input_validation'])) {
91
- $validatorXmlObj->addRule(array (
92
- 'type' => $validateRules['input_validation']
93
- ));
94
  }
95
  }
96
 
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Form_Renderer_Text extends Enterprise_Customer_Block_Form_Renderer_Text
 
35
  {
36
  /**
37
  * Field type
46
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $fieldsetXmlObj
47
  * @return Mage_XmlConnect_Block_Customer_Form_Renderer_Text
48
  */
49
+ public function addFieldToXmlObj(Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset $fieldsetXmlObj)
 
 
50
  {
51
  $attributes = array(
52
+ 'label' => $this->getLabel(), 'name' => $this->getFieldName(), 'value' => $this->getEscapedValue()
 
 
53
  );
54
 
55
  $attributes += Mage::helper('xmlconnect/customer_form_renderer')
56
  ->addTitleAndRequiredAttr($fieldsetXmlObj, $this);
57
 
58
+ $fieldXmlObj = $fieldsetXmlObj->addField($this->getHtmlId(), $this->_filedType, $attributes);
 
 
 
 
59
 
60
  $validateRules = $this->getAttributeObject()->getValidateRules();
61
 
64
 
65
  if (!empty($validateRules['min_text_length'])) {
66
  $minTextLength = (int) $validateRules['min_text_length'];
67
+ $validatorXmlObj->addRule(array('type' => 'min_length', 'value' => $minTextLength));
 
 
 
68
  }
69
 
70
  if (!empty($validateRules['max_text_length'])) {
71
  $maxTextLength = (int) $validateRules['max_text_length'];
72
+ $validatorXmlObj->addRule(array('type' => 'max_length', 'value' => $maxTextLength));
 
 
 
73
  }
74
 
75
  if (!empty($validateRules['input_validation'])) {
76
+ $validatorXmlObj->addRule(array('type' => $validateRules['input_validation']));
 
 
77
  }
78
  }
79
 
app/code/core/Mage/XmlConnect/Block/Customer/Form/Renderer/Textarea.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Form_Renderer_Textarea
35
- extends Mage_XmlConnect_Block_Customer_Form_Renderer_Text
36
  {
37
  /**
38
  * Field type
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Form_Renderer_Textarea extends Mage_XmlConnect_Block_Customer_Form_Renderer_Text
 
35
  {
36
  /**
37
  * Field type
app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php CHANGED
@@ -43,10 +43,7 @@ class Mage_XmlConnect_Block_Customer_GiftcardCheck extends Enterprise_GiftCardAc
43
  $card = $this->getCard();
44
  if ($card->getId()) {
45
  /** @var $xmlModel Mage_XmlConnect_Model_Simplexml_Element */
46
- $xmlModel = Mage::getModel(
47
- 'xmlconnect/simplexml_element',
48
- '<gift_card_account></gift_card_account>'
49
- );
50
 
51
  $balance = Mage::helper('core')->currency($card->getBalance(), true, false);
52
 
@@ -58,20 +55,9 @@ class Mage_XmlConnect_Block_Customer_GiftcardCheck extends Enterprise_GiftCardAc
58
  }
59
  $xmlModel->addCustomChild('info', implode(PHP_EOL, $result));
60
  } else {
61
- $xmlModel = Mage::getModel(
62
- 'xmlconnect/simplexml_element',
63
- '<message></message>'
64
- );
65
-
66
- $xmlModel->addCustomChild(
67
- 'status',
68
- Mage_XmlConnect_Controller_Action::MESSAGE_STATUS_ERROR
69
- );
70
-
71
- $xmlModel->addCustomChild(
72
- 'text',
73
- $this->__('Wrong or expired Gift Card Code.')
74
- );
75
  }
76
 
77
  return $xmlModel->asNiceXml();
43
  $card = $this->getCard();
44
  if ($card->getId()) {
45
  /** @var $xmlModel Mage_XmlConnect_Model_Simplexml_Element */
46
+ $xmlModel = Mage::getModel('xmlconnect/simplexml_element', '<gift_card_account></gift_card_account>');
 
 
 
47
 
48
  $balance = Mage::helper('core')->currency($card->getBalance(), true, false);
49
 
55
  }
56
  $xmlModel->addCustomChild('info', implode(PHP_EOL, $result));
57
  } else {
58
+ $xmlModel = Mage::getModel('xmlconnect/simplexml_element', '<message></message>');
59
+ $xmlModel->addCustomChild('status', Mage_XmlConnect_Controller_Action::MESSAGE_STATUS_ERROR);
60
+ $xmlModel->addCustomChild('text', $this->__('Wrong or expired Gift Card Code.'));
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  return $xmlModel->asNiceXml();
app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php CHANGED
@@ -50,17 +50,8 @@ class Mage_XmlConnect_Block_Customer_Order_Details extends Mage_Payment_Block_In
50
  * - 'free' => Mage_Payment_Block_Info
51
  */
52
  protected $_methodArray = array(
53
- 'ccsave',
54
- 'checkmo',
55
- 'purchaseorder',
56
- 'authorizenet',
57
- 'pbridge_authorizenet',
58
- 'pbridge_verisign',
59
- 'paypal_express',
60
- 'paypal_mecl',
61
- 'pbridge_paypal_direct',
62
- 'pbridge_paypaluk_direct',
63
- 'free'
64
  );
65
 
66
  /**
@@ -76,17 +67,13 @@ class Mage_XmlConnect_Block_Customer_Order_Details extends Mage_Payment_Block_In
76
  $order = $this->_getOrder();
77
 
78
  $orderDate = $this->formatDate($order->getCreatedAtStoreDate(), 'long');
79
- $orderXmlObj->addCustomChild(
80
- 'order',
81
- null,
82
- array(
83
- 'label' => $this->__('Order #%s - %s', $order->getRealOrderId(), $order->getStatusLabel()),
84
- 'order_date' => $this->__('Order Date: %s', $orderDate)
85
- )
86
- );
87
  if (!$order->getIsVirtual()) {
88
- $shipping = $this->_formatAddress($order->getShippingAddress()->format('text'));
89
- $billing = $this->_formatAddress($order->getBillingAddress()->format('text'));
90
 
91
  $orderXmlObj->addCustomChild('shipping_address', $shipping);
92
  $orderXmlObj->addCustomChild('billing_address', $billing);
@@ -154,9 +141,7 @@ class Mage_XmlConnect_Block_Customer_Order_Details extends Mage_Payment_Block_In
154
  if (!empty($specificInfo)) {
155
  foreach ($specificInfo as $label => $value) {
156
  if ($value) {
157
- $paymentNode->addCustomChild(
158
- 'item',
159
- implode($this->getValueAsArray($value, true), PHP_EOL),
160
  array('label' => $label)
161
  );
162
  }
@@ -185,6 +170,7 @@ class Mage_XmlConnect_Block_Customer_Order_Details extends Mage_Payment_Block_In
185
  /**
186
  * Format address string
187
  *
 
188
  * @param string $address
189
  * @return string
190
  */
@@ -192,7 +178,7 @@ class Mage_XmlConnect_Block_Customer_Order_Details extends Mage_Payment_Block_In
192
  {
193
  return preg_replace(
194
  array('@\r@', '@\n+@'),
195
- array('', PHP_EOL),
196
  $address
197
  );
198
  }
50
  * - 'free' => Mage_Payment_Block_Info
51
  */
52
  protected $_methodArray = array(
53
+ 'ccsave', 'checkmo', 'purchaseorder', 'authorizenet', 'pbridge_authorizenet', 'pbridge_verisign',
54
+ 'paypal_express', 'paypal_mecl', 'pbridge_paypal_direct', 'pbridge_paypaluk_direct', 'free'
 
 
 
 
 
 
 
 
 
55
  );
56
 
57
  /**
67
  $order = $this->_getOrder();
68
 
69
  $orderDate = $this->formatDate($order->getCreatedAtStoreDate(), 'long');
70
+ $orderXmlObj->addCustomChild('order', null, array(
71
+ 'label' => $this->__('Order #%s - %s', $order->getRealOrderId(), $order->getStatusLabel()),
72
+ 'order_date' => $this->__('Order Date: %s', $orderDate)
73
+ ));
 
 
 
 
74
  if (!$order->getIsVirtual()) {
75
+ $shipping = Mage::helper('xmlconnect')->trimLineBreaks($order->getShippingAddress()->format('text'));
76
+ $billing = Mage::helper('xmlconnect')->trimLineBreaks($order->getBillingAddress()->format('text'));
77
 
78
  $orderXmlObj->addCustomChild('shipping_address', $shipping);
79
  $orderXmlObj->addCustomChild('billing_address', $billing);
141
  if (!empty($specificInfo)) {
142
  foreach ($specificInfo as $label => $value) {
143
  if ($value) {
144
+ $paymentNode->addCustomChild('item', implode($this->getValueAsArray($value, true), '\n'),
 
 
145
  array('label' => $label)
146
  );
147
  }
170
  /**
171
  * Format address string
172
  *
173
+ * @deprecated after 1.6.0.0
174
  * @param string $address
175
  * @return string
176
  */
178
  {
179
  return preg_replace(
180
  array('@\r@', '@\n+@'),
181
+ array('', '\n'),
182
  $address
183
  );
184
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php CHANGED
@@ -31,21 +31,19 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Bundle
35
- extends Mage_Bundle_Block_Sales_Order_Items_Renderer
36
  {
37
  /**
38
  * Add item to XML object
39
  * (get from template: bundle/sales/order/items/renderer.phtml)
40
  *
41
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
42
- * @return void
43
  */
44
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
45
  {
46
  /** @var $parentItem Mage_Sales_Model_Order_Item */
47
  $parentItem = $this->getItem();
48
-
49
  $items = array_merge(array($parentItem), $parentItem->getChildrenItems());
50
  $_prevOptionId = '';
51
 
@@ -72,10 +70,10 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Bundle
72
  && $this->getWeeeTaxAppliedAmount();
73
 
74
  $this->setTypesOfDisplay(array(
75
- 1 => $typeOfDisplay1,
76
- 2 => $typeOfDisplay2,
77
- 4 => $typeOfDisplay4,
78
- 14 => $typeOfDisplay014,
79
  ));
80
  $this->setWeeeTaxes($weeeHelper->getApplied($parentItem));
81
 
@@ -129,11 +127,7 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Bundle
129
  // Price including tax
130
  if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceInclTax()) {
131
  Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
132
- $this,
133
- $parentItem,
134
- $priceXml,
135
- $subtotalXml,
136
- true
137
  );
138
  }
139
  }
@@ -145,54 +139,38 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Bundle
145
  ) {
146
  $qtyXml = $objectXml->addChild('qty');
147
  if ($item->getQtyOrdered() > 0) {
148
- $qtyXml->addCustomChild(
149
- 'value',
150
- $item->getQtyOrdered() * 1,
151
- array('label' => Mage::helper('sales')->__('Ordered'))
152
- );
153
  }
154
  if ($item->getQtyShipped() > 0 && !$this->isShipmentSeparately()) {
155
- $qtyXml->addCustomChild(
156
- 'value',
157
- $item->getQtyShipped() * 1,
158
- array('label' => Mage::helper('sales')->__('Shipped'))
159
- );
160
  }
161
  if ($item->getQtyCanceled() > 0) {
162
- $qtyXml->addCustomChild(
163
- 'value',
164
- $item->getQtyCanceled() * 1,
165
- array('label' => Mage::helper('sales')->__('Canceled'))
166
- );
167
  }
168
  if ($item->getQtyRefunded() > 0) {
169
- $qtyXml->addCustomChild(
170
- 'value',
171
- $item->getQtyRefunded() * 1,
172
- array('label' => Mage::helper('sales')->__('Refunded'))
173
- );
174
  }
175
  } elseif ($item->getQtyShipped() > 0 && $isOption && $this->isShipmentSeparately()) {
176
  $qtyXml = $objectXml->addChild('qty');
177
- $qtyXml->addCustomChild(
178
- 'value',
179
- $item->getQtyShipped() * 1,
180
- array('label' => Mage::helper('sales')->__('Shipped'))
181
- );
182
  }
183
  }
184
 
185
  if ($parentItem->getDescription()) {
186
- $itemXml->addCustomChild(
187
- 'description',
188
- $parentItem->getDescription()
189
- );
190
  }
191
 
192
- Mage::helper('xmlconnect/customer_order')->addItemOptionsToXml(
193
- $this,
194
- $itemXml
195
- );
196
  }
197
 
198
  /**
@@ -205,9 +183,8 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Bundle
205
  {
206
  $attributes = $this->getSelectionAttributes($item);
207
  if ($attributes) {
208
- return sprintf('%d', $attributes['qty']) . ' x '
209
- . $item->getName()
210
- . ' - ' . $this->_formatPrice($attributes['price']);
211
  } else {
212
  return $item->getName();
213
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Bundle extends Mage_Bundle_Block_Sales_Order_Items_Renderer
 
35
  {
36
  /**
37
  * Add item to XML object
38
  * (get from template: bundle/sales/order/items/renderer.phtml)
39
  *
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
41
+ * @return null
42
  */
43
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
44
  {
45
  /** @var $parentItem Mage_Sales_Model_Order_Item */
46
  $parentItem = $this->getItem();
 
47
  $items = array_merge(array($parentItem), $parentItem->getChildrenItems());
48
  $_prevOptionId = '';
49
 
70
  && $this->getWeeeTaxAppliedAmount();
71
 
72
  $this->setTypesOfDisplay(array(
73
+ Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_1 => $typeOfDisplay1,
74
+ Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_2 => $typeOfDisplay2,
75
+ Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_4 => $typeOfDisplay4,
76
+ Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_14 => $typeOfDisplay014,
77
  ));
78
  $this->setWeeeTaxes($weeeHelper->getApplied($parentItem));
79
 
127
  // Price including tax
128
  if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceInclTax()) {
129
  Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
130
+ $this, $parentItem, $priceXml, $subtotalXml, true
 
 
 
 
131
  );
132
  }
133
  }
139
  ) {
140
  $qtyXml = $objectXml->addChild('qty');
141
  if ($item->getQtyOrdered() > 0) {
142
+ $qtyXml->addCustomChild('value', $item->getQtyOrdered() * 1, array(
143
+ 'label' => Mage::helper('sales')->__('Ordered')
144
+ ));
 
 
145
  }
146
  if ($item->getQtyShipped() > 0 && !$this->isShipmentSeparately()) {
147
+ $qtyXml->addCustomChild('value', $item->getQtyShipped() * 1, array(
148
+ 'label' => Mage::helper('sales')->__('Shipped')
149
+ ));
 
 
150
  }
151
  if ($item->getQtyCanceled() > 0) {
152
+ $qtyXml->addCustomChild('value', $item->getQtyCanceled() * 1, array(
153
+ 'label' => Mage::helper('sales')->__('Canceled')
154
+ ));
 
 
155
  }
156
  if ($item->getQtyRefunded() > 0) {
157
+ $qtyXml->addCustomChild('value', $item->getQtyRefunded() * 1, array(
158
+ 'label' => Mage::helper('sales')->__('Refunded')
159
+ ));
 
 
160
  }
161
  } elseif ($item->getQtyShipped() > 0 && $isOption && $this->isShipmentSeparately()) {
162
  $qtyXml = $objectXml->addChild('qty');
163
+ $qtyXml->addCustomChild('value', $item->getQtyShipped() * 1, array(
164
+ 'label' => Mage::helper('sales')->__('Shipped')
165
+ ));
 
 
166
  }
167
  }
168
 
169
  if ($parentItem->getDescription()) {
170
+ $itemXml->addCustomChild('description', $parentItem->getDescription());
 
 
 
171
  }
172
 
173
+ Mage::helper('xmlconnect/customer_order')->addItemOptionsToXml($this, $itemXml);
 
 
 
174
  }
175
 
176
  /**
183
  {
184
  $attributes = $this->getSelectionAttributes($item);
185
  if ($attributes) {
186
+ return sprintf('%d', $attributes['qty']) . ' x ' . $item->getName() . ' - '
187
+ . $this->_formatPrice($attributes['price']);
 
188
  } else {
189
  return $item->getName();
190
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php CHANGED
@@ -31,15 +31,14 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Default
35
- extends Mage_Sales_Block_Order_Item_Renderer_Default
36
  {
37
  /**
38
  * Add item to XML object
39
  * (get from template: sales/order/items/renderer/default.phtml)
40
  *
41
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
42
- * @return void
43
  */
44
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
45
  {
@@ -47,13 +46,9 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Default
47
  $item = $this->getItem();
48
 
49
  /** @var $itemXml Mage_XmlConnect_Model_Simplexml_Element */
50
- $itemXml = $orderItemXmlObj->addCustomChild(
51
- 'item',
52
- null,
53
- array(
54
- 'product_id' => $item->getProductId()
55
- )
56
- );
57
  $itemXml->addCustomChild('name', $item->getName());
58
 
59
  /** @var $weeeHelper Mage_Weee_Helper_Data */
@@ -61,10 +56,7 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Default
61
  /** @var $taxHelper Mage_Tax_Helper_Data */
62
  $taxHelper = $this->helper('tax');
63
 
64
- Mage::helper('xmlconnect/customer_order')->addItemOptionsToXml(
65
- $this,
66
- $itemXml
67
- );
68
 
69
  $addtInfoBlock = $this->getProductAdditionalInformationBlock();
70
  if ($addtInfoBlock) {
@@ -89,10 +81,10 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Default
89
  && $this->getWeeeTaxAppliedAmount();
90
 
91
  $this->setTypesOfDisplay(array(
92
- 1 => $typeOfDisplay1,
93
- 2 => $typeOfDisplay2,
94
- 4 => $typeOfDisplay4,
95
- 14 => $typeOfDisplay014,
96
  ));
97
  $this->setWeeeTaxes($weeeHelper->getApplied($item));
98
 
@@ -100,33 +92,20 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Default
100
  $priceXml = $itemXml->addChild('price');
101
 
102
  // Quantity: Ordered, Shipped, Cancelled, Refunded
103
- Mage::helper('xmlconnect/customer_order')->addQuantityToXml(
104
- $this,
105
- $itemXml->addChild('qty'),
106
- $item
107
- );
108
 
109
  /** @var $subtotalXml Mage_XmlConnect_Model_Simplexml_Element */
110
  $subtotalXml = $itemXml->addChild('subtotal');
111
 
112
  // Price & subtotal - excluding tax
113
  if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceExclTax()) {
114
- Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
115
- $this,
116
- $item,
117
- $priceXml,
118
- $subtotalXml
119
- );
120
  }
121
 
122
  // Price & subtotal - including tax
123
  if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceInclTax()) {
124
  Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
125
- $this,
126
- $item,
127
- $priceXml,
128
- $subtotalXml,
129
- true
130
  );
131
  }
132
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Default extends Mage_Sales_Block_Order_Item_Renderer_Default
 
35
  {
36
  /**
37
  * Add item to XML object
38
  * (get from template: sales/order/items/renderer/default.phtml)
39
  *
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
41
+ * @return null
42
  */
43
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
44
  {
46
  $item = $this->getItem();
47
 
48
  /** @var $itemXml Mage_XmlConnect_Model_Simplexml_Element */
49
+ $itemXml = $orderItemXmlObj->addCustomChild('item', null, array(
50
+ 'product_id' => $item->getProductId()
51
+ ));
 
 
 
 
52
  $itemXml->addCustomChild('name', $item->getName());
53
 
54
  /** @var $weeeHelper Mage_Weee_Helper_Data */
56
  /** @var $taxHelper Mage_Tax_Helper_Data */
57
  $taxHelper = $this->helper('tax');
58
 
59
+ Mage::helper('xmlconnect/customer_order')->addItemOptionsToXml($this, $itemXml);
 
 
 
60
 
61
  $addtInfoBlock = $this->getProductAdditionalInformationBlock();
62
  if ($addtInfoBlock) {
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
 
92
  $priceXml = $itemXml->addChild('price');
93
 
94
  // Quantity: Ordered, Shipped, Cancelled, Refunded
95
+ Mage::helper('xmlconnect/customer_order')->addQuantityToXml($this, $itemXml->addChild('qty'), $item);
 
 
 
 
96
 
97
  /** @var $subtotalXml Mage_XmlConnect_Model_Simplexml_Element */
98
  $subtotalXml = $itemXml->addChild('subtotal');
99
 
100
  // Price & subtotal - excluding tax
101
  if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceExclTax()) {
102
+ Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml($this, $item, $priceXml, $subtotalXml);
 
 
 
 
 
103
  }
104
 
105
  // Price & subtotal - including tax
106
  if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceInclTax()) {
107
  Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
108
+ $this, $item, $priceXml, $subtotalXml, true
 
 
 
 
109
  );
110
  }
111
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php CHANGED
@@ -39,7 +39,7 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Downloadable
39
  * (get from template: downloadable/sales/order/items/renderer/downloadable.phtml)
40
  *
41
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
42
- * @return void
43
  */
44
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
45
  {
@@ -47,13 +47,9 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Downloadable
47
  $item = $this->getItem();
48
 
49
  /** @var $itemXml Mage_XmlConnect_Model_Simplexml_Element */
50
- $itemXml = $orderItemXmlObj->addCustomChild(
51
- 'item',
52
- null,
53
- array(
54
- 'product_id' => $item->getProductId()
55
- )
56
- );
57
  $itemXml->addCustomChild('name', $item->getName());
58
 
59
  /** @var $weeeHelper Mage_Weee_Helper_Data */
@@ -61,10 +57,7 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Downloadable
61
  /** @var $taxHelper Mage_Tax_Helper_Data */
62
  $taxHelper = $this->helper('tax');
63
 
64
- Mage::helper('xmlconnect/customer_order')->addItemOptionsToXml(
65
- $this,
66
- $itemXml
67
- );
68
 
69
  $addtInfoBlock = $this->getProductAdditionalInformationBlock();
70
  if ($addtInfoBlock) {
@@ -74,16 +67,9 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Downloadable
74
 
75
  $links = $this->getLinks();
76
  if ($links) {
77
- $linksXml = $itemXml->addCustomChild(
78
- 'links',
79
- null,
80
- array('label' => $this->getLinksTitle())
81
- );
82
  foreach ($links->getPurchasedItems() as $link) {
83
- $linksXml->addCustomChild(
84
- 'link',
85
- $link->getLinkTitle()
86
- );
87
  }
88
  }
89
 
@@ -95,11 +81,7 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Downloadable
95
  $priceXml = $itemXml->addChild('price');
96
 
97
  // Quantity: Ordered, Shipped, Cancelled, Refunded
98
- Mage::helper('xmlconnect/customer_order')->addQuantityToXml(
99
- $this,
100
- $itemXml->addChild('qty'),
101
- $item
102
- );
103
 
104
  /** @var $subtotalXml Mage_XmlConnect_Model_Simplexml_Element */
105
  $subtotalXml = $itemXml->addChild('subtotal');
@@ -117,10 +99,10 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Downloadable
117
  && $this->getWeeeTaxAppliedAmount();
118
 
119
  $this->setTypesOfDisplay(array(
120
- 1 => $typeOfDisplay1,
121
- 2 => $typeOfDisplay2,
122
- 4 => $typeOfDisplay4,
123
- 14 => $typeOfDisplay014,
124
  ));
125
  $this->setWeeeTaxes($weeeHelper->getApplied($item));
126
 
@@ -137,11 +119,7 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Downloadable
137
  // Price & subtotal - including tax
138
  if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceInclTax()) {
139
  Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
140
- $this,
141
- $item,
142
- $priceXml,
143
- $subtotalXml,
144
- true
145
  );
146
  }
147
  }
39
  * (get from template: downloadable/sales/order/items/renderer/downloadable.phtml)
40
  *
41
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
42
+ * @return null
43
  */
44
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
45
  {
47
  $item = $this->getItem();
48
 
49
  /** @var $itemXml Mage_XmlConnect_Model_Simplexml_Element */
50
+ $itemXml = $orderItemXmlObj->addCustomChild('item', null, array(
51
+ 'product_id' => $item->getProductId()
52
+ ));
 
 
 
 
53
  $itemXml->addCustomChild('name', $item->getName());
54
 
55
  /** @var $weeeHelper Mage_Weee_Helper_Data */
57
  /** @var $taxHelper Mage_Tax_Helper_Data */
58
  $taxHelper = $this->helper('tax');
59
 
60
+ Mage::helper('xmlconnect/customer_order')->addItemOptionsToXml($this, $itemXml);
 
 
 
61
 
62
  $addtInfoBlock = $this->getProductAdditionalInformationBlock();
63
  if ($addtInfoBlock) {
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
 
81
  $priceXml = $itemXml->addChild('price');
82
 
83
  // Quantity: Ordered, Shipped, Cancelled, Refunded
84
+ Mage::helper('xmlconnect/customer_order')->addQuantityToXml($this, $itemXml->addChild('qty'), $item);
 
 
 
 
85
 
86
  /** @var $subtotalXml Mage_XmlConnect_Model_Simplexml_Element */
87
  $subtotalXml = $itemXml->addChild('subtotal');
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
 
119
  // Price & subtotal - including tax
120
  if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceInclTax()) {
121
  Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml(
122
+ $this, $item, $priceXml, $subtotalXml, true
 
 
 
 
123
  );
124
  }
125
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Giftcard.php CHANGED
@@ -65,7 +65,7 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Giftcard
65
  * (get from template: sales/order/items/renderer/default.phtml)
66
  *
67
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
68
- * @return void
69
  */
70
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
71
  {
65
  * (get from template: sales/order/items/renderer/default.phtml)
66
  *
67
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
68
+ * @return null
69
  */
70
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
71
  {
app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Grouped
35
- extends Mage_Sales_Block_Order_Item_Renderer_Grouped
36
  {
37
  /**
38
  * Default product type
@@ -44,7 +43,7 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Grouped
44
  * (get from template: sales/order/items/renderer/default.phtml)
45
  *
46
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
47
- * @return void
48
  */
49
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
50
  {
@@ -56,7 +55,6 @@ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Grouped
56
  }
57
  $renderer = $this->getRenderedBlock()->getItemRenderer($productType);
58
  $renderer->setItem($this->getItem());
59
-
60
  $renderer->addItemToXmlObject($orderItemXmlObj);
61
  }
62
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Grouped extends Mage_Sales_Block_Order_Item_Renderer_Grouped
 
35
  {
36
  /**
37
  * Default product type
43
  * (get from template: sales/order/items/renderer/default.phtml)
44
  *
45
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
46
+ * @return null
47
  */
48
  public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
49
  {
55
  }
56
  $renderer = $this->getRenderedBlock()->getItemRenderer($productType);
57
  $renderer->setItem($this->getItem());
 
58
  $renderer->addItemToXmlObject($orderItemXmlObj);
59
  }
60
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php CHANGED
@@ -56,8 +56,7 @@ class Mage_XmlConnect_Block_Customer_Order_Items extends Mage_Sales_Block_Order_
56
 
57
  if (is_null($this->_itemRenders[$type]['renderer'])) {
58
  $this->_itemRenders[$type]['renderer'] = $this->getLayout()
59
- ->createBlock($this->_itemRenders[$type]['block'])
60
- ->setRenderedBlock($this);
61
  }
62
  return $this->_itemRenders[$type]['renderer'];
63
  }
@@ -67,7 +66,7 @@ class Mage_XmlConnect_Block_Customer_Order_Items extends Mage_Sales_Block_Order_
67
  * (get from template: sales/order/items.phtml)
68
  *
69
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj
70
- * @return void
71
  */
72
  public function addItemsToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj)
73
  {
56
 
57
  if (is_null($this->_itemRenders[$type]['renderer'])) {
58
  $this->_itemRenders[$type]['renderer'] = $this->getLayout()
59
+ ->createBlock($this->_itemRenders[$type]['block'])->setRenderedBlock($this);
 
60
  }
61
  return $this->_itemRenders[$type]['renderer'];
62
  }
66
  * (get from template: sales/order/items.phtml)
67
  *
68
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj
69
+ * @return null
70
  */
71
  public function addItemsToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj)
72
  {
app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php CHANGED
@@ -47,19 +47,13 @@ class Mage_XmlConnect_Block_Customer_Order_List extends Mage_Core_Block_Template
47
  {
48
  $ordersXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<orders></orders>');
49
 
50
- $orders = Mage::getResourceModel('sales/order_collection')
51
- ->addFieldToSelect('*')
52
- ->addFieldToFilter(
53
- 'customer_id',
54
- Mage::getSingleton('customer/session')->getCustomer()->getId()
55
- )
56
- ->addFieldToFilter(
57
- 'state',
58
- array(
59
- 'in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()
60
- )
61
- )
62
- ->setOrder('created_at', 'desc');
63
 
64
  $orders->getSelect()->limit(self::ORDERS_LIST_LIMIT, 0);
65
  $orders->load();
@@ -73,16 +67,9 @@ class Mage_XmlConnect_Block_Customer_Order_List extends Mage_Core_Block_Template
73
  if ($_order->getShippingAddress()) {
74
  $item->addChild('ship_to', $ordersXmlObj->escapeXml($_order->getShippingAddress()->getName()));
75
  }
76
- $item->addChild(
77
- 'total',
78
- $_order->getOrderCurrency()->formatPrecision(
79
- $_order->getGrandTotal(),
80
- 2,
81
- array(),
82
- false,
83
- false
84
- )
85
- );
86
  $item->addChild('status', $_order->getStatusLabel());
87
  }
88
  }
47
  {
48
  $ordersXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<orders></orders>');
49
 
50
+ $orders = Mage::getResourceModel('sales/order_collection')->addFieldToSelect('*')->addFieldToFilter(
51
+ 'customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId()
52
+ )
53
+ ->addFieldToFilter(
54
+ 'state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates())
55
+ )
56
+ ->setOrder('created_at', 'desc');
 
 
 
 
 
 
57
 
58
  $orders->getSelect()->limit(self::ORDERS_LIST_LIMIT, 0);
59
  $orders->load();
67
  if ($_order->getShippingAddress()) {
68
  $item->addChild('ship_to', $ordersXmlObj->escapeXml($_order->getShippingAddress()->getName()));
69
  }
70
+ $item->addChild('total', $_order->getOrderCurrency()->formatPrecision(
71
+ $_order->getGrandTotal(), 2, array(), false, false
72
+ ));
 
 
 
 
 
 
 
73
  $item->addChild('status', $_order->getStatusLabel());
74
  }
75
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php CHANGED
@@ -38,7 +38,7 @@ class Mage_XmlConnect_Block_Customer_Order_Totals extends Mage_Sales_Block_Order
38
  * (get from template: sales/order/totals.phtml)
39
  *
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj
41
- * @return void
42
  */
43
  public function addTotalsToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj)
44
  {
@@ -113,20 +113,13 @@ class Mage_XmlConnect_Block_Customer_Order_Totals extends Mage_Sales_Block_Order
113
  *
114
  * @param Varien_Object $total
115
  * @param Mage_XmlConnect_Model_Simplexml_Element $totalsXml
116
- * @return void
117
  */
118
  private function _addTotalToXml($total, Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
119
  {
120
- if (
121
- $total instanceof Varien_Object
122
- && $total->getCode()
123
- && $total->getLabel()
124
- && $total->hasData('value')
125
- ) {
126
- $totalsXml->addCustomChild(
127
- preg_replace('@[\W]+@', '_', trim($total->getCode())),
128
- $this->_formatPrice($total),
129
- array('label' => strip_tags($total->getLabel()))
130
  );
131
  }
132
  }
38
  * (get from template: sales/order/totals.phtml)
39
  *
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj
41
+ * @return null
42
  */
43
  public function addTotalsToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj)
44
  {
113
  *
114
  * @param Varien_Object $total
115
  * @param Mage_XmlConnect_Model_Simplexml_Element $totalsXml
116
+ * @return null
117
  */
118
  private function _addTotalToXml($total, Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
119
  {
120
+ if ($total instanceof Varien_Object && $total->getCode() && $total->getLabel() && $total->hasData('value')) {
121
+ $totalsXml->addCustomChild(preg_replace('@[\W]+@', '_', trim($total->getCode())),
122
+ $this->_formatPrice($total), array('label' => strip_tags($total->getLabel()))
 
 
 
 
 
 
 
123
  );
124
  }
125
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance.php CHANGED
@@ -36,18 +36,15 @@ class Mage_XmlConnect_Block_Customer_Order_Totals_Customerbalance
36
  {
37
  /**
38
  * Add order total rendered to XML object
39
- * (get from template: )
40
  *
41
  * @param $totalsXml Mage_XmlConnect_Model_Simplexml_Element
42
- * @return void
43
  */
44
  public function addToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
45
  {
46
  $balance = $this->getSource()->getCustomerBalanceAmount();
47
  if ($balance) {
48
- $totalsXml->addCustomChild(
49
- $this->getTotal()->getCode(),
50
- '-' . $this->_formatPrice($balance),
51
  array('label' => Mage::helper('enterprise_giftcardaccount')->__('Store Credit'))
52
  );
53
  }
36
  {
37
  /**
38
  * Add order total rendered to XML object
 
39
  *
40
  * @param $totalsXml Mage_XmlConnect_Model_Simplexml_Element
41
+ * @return null
42
  */
43
  public function addToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
44
  {
45
  $balance = $this->getSource()->getCustomerBalanceAmount();
46
  if ($balance) {
47
+ $totalsXml->addCustomChild($this->getTotal()->getCode(), '-' . $this->_formatPrice($balance),
 
 
48
  array('label' => Mage::helper('enterprise_giftcardaccount')->__('Store Credit'))
49
  );
50
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Customerbalance/Refunded.php CHANGED
@@ -36,18 +36,15 @@ class Mage_XmlConnect_Block_Customer_Order_Totals_Customerbalance_Refunded
36
  {
37
  /**
38
  * Add order total rendered to XML object
39
- * (get from template: )
40
  *
41
  * @param $totalsXml Mage_XmlConnect_Model_Simplexml_Element
42
- * @return void
43
  */
44
  public function addToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
45
  {
46
  $balance = $this->getSource()->getCustomerBalanceTotalRefunded();
47
  if ($balance) {
48
- $totalsXml->addCustomChild(
49
- $this->getTotal()->getCode(),
50
- $this->_formatPrice($balance),
51
  array('label' => Mage::helper('enterprise_giftcardaccount')->__('Refunded to Store Credit'))
52
  );
53
  }
36
  {
37
  /**
38
  * Add order total rendered to XML object
 
39
  *
40
  * @param $totalsXml Mage_XmlConnect_Model_Simplexml_Element
41
+ * @return null
42
  */
43
  public function addToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
44
  {
45
  $balance = $this->getSource()->getCustomerBalanceTotalRefunded();
46
  if ($balance) {
47
+ $totalsXml->addCustomChild($this->getTotal()->getCode(), $this->_formatPrice($balance),
 
 
48
  array('label' => Mage::helper('enterprise_giftcardaccount')->__('Refunded to Store Credit'))
49
  );
50
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Giftcards.php CHANGED
@@ -36,10 +36,9 @@ class Mage_XmlConnect_Block_Customer_Order_Totals_Giftcards
36
  {
37
  /**
38
  * Add order total rendered to XML object
39
- * (get from template: )
40
  *
41
  * @param $totalsXml Mage_XmlConnect_Model_Simplexml_Element
42
- * @return void
43
  */
44
  public function addToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
45
  {
@@ -47,18 +46,14 @@ class Mage_XmlConnect_Block_Customer_Order_Totals_Giftcards
47
  if ($cards) {
48
  foreach ($cards as $card) {
49
  $label = Mage::helper('enterprise_giftcardaccount')->__('Gift Card (%s)', $card->getCode());
50
- $totalsXml->addCustomChild(
51
- $this->getTotal()->getCode(),
52
- '-' . $this->_formatPrice($card->getAmount()),
53
  array('label' => $label)
54
  );
55
  }
56
  } else {
57
  $cardsAmount = $this->getSource()->getGiftCardsAmount();
58
  if ($cardsAmount > 0) {
59
- $totalsXml->addCustomChild(
60
- $this->getTotal()->getCode(),
61
- '-' . $this->_formatPrice($cardsAmount),
62
  array('label' => Mage::helper('enterprise_giftcardaccount')->__('Gift Card'))
63
  );
64
  }
36
  {
37
  /**
38
  * Add order total rendered to XML object
 
39
  *
40
  * @param $totalsXml Mage_XmlConnect_Model_Simplexml_Element
41
+ * @return null
42
  */
43
  public function addToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
44
  {
46
  if ($cards) {
47
  foreach ($cards as $card) {
48
  $label = Mage::helper('enterprise_giftcardaccount')->__('Gift Card (%s)', $card->getCode());
49
+ $totalsXml->addCustomChild($this->getTotal()->getCode(), '-' . $this->_formatPrice($card->getAmount()),
 
 
50
  array('label' => $label)
51
  );
52
  }
53
  } else {
54
  $cardsAmount = $this->getSource()->getGiftCardsAmount();
55
  if ($cardsAmount > 0) {
56
+ $totalsXml->addCustomChild($this->getTotal()->getCode(), '-' . $this->_formatPrice($cardsAmount),
 
 
57
  array('label' => Mage::helper('enterprise_giftcardaccount')->__('Gift Card'))
58
  );
59
  }
app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php CHANGED
@@ -35,10 +35,9 @@ class Mage_XmlConnect_Block_Customer_Order_Totals_Tax extends Mage_Tax_Block_Sal
35
  {
36
  /**
37
  * Add order taxes rendered to XML object
38
- * (get from template: )
39
  *
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $totalsXmlObj
41
- * @return void
42
  */
43
  public function addToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $totalsXmlObj)
44
  {
@@ -55,16 +54,12 @@ class Mage_XmlConnect_Block_Customer_Order_Totals_Tax extends Mage_Tax_Block_Sal
55
 
56
  foreach ((array)$info['rates'] as $rate) {
57
  if (isset($info['amount'])) {
58
- $config = array(
59
- 'label' => $rate['title']
60
- );
61
  if (!is_null($rate['percent'])) {
62
  $config['percent'] = sprintf('(%0.2f%%)', $rate['percent']);
63
  }
64
  $taxesXmlObj->addCustomChild(
65
- 'item',
66
- is_null($rate['percent']) ? '' : $this->_formatPrice($info['amount']),
67
- $config
68
  );
69
  }
70
  }
@@ -72,11 +67,7 @@ class Mage_XmlConnect_Block_Customer_Order_Totals_Tax extends Mage_Tax_Block_Sal
72
  }
73
 
74
  $taxesXmlObj->addCustomChild(
75
- 'summary',
76
- $this->_formatPrice($this->getSource()->getTaxAmount()),
77
- array(
78
- 'label' => $this->__('Tax')
79
- )
80
  );
81
  }
82
 
35
  {
36
  /**
37
  * Add order taxes rendered to XML object
 
38
  *
39
  * @param Mage_XmlConnect_Model_Simplexml_Element $totalsXmlObj
40
+ * @return null
41
  */
42
  public function addToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $totalsXmlObj)
43
  {
54
 
55
  foreach ((array)$info['rates'] as $rate) {
56
  if (isset($info['amount'])) {
57
+ $config = array('label' => $rate['title']);
 
 
58
  if (!is_null($rate['percent'])) {
59
  $config['percent'] = sprintf('(%0.2f%%)', $rate['percent']);
60
  }
61
  $taxesXmlObj->addCustomChild(
62
+ 'item', is_null($rate['percent']) ? '' : $this->_formatPrice($info['amount']), $config
 
 
63
  );
64
  }
65
  }
67
  }
68
 
69
  $taxesXmlObj->addCustomChild(
70
+ 'summary', $this->_formatPrice($this->getSource()->getTaxAmount()), array('label' => $this->__('Tax'))
 
 
 
 
71
  );
72
  }
73
 
app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php CHANGED
@@ -41,78 +41,46 @@ class Mage_XmlConnect_Block_Customer_Storecredit extends Mage_Core_Block_Templat
41
  protected function _toHtml()
42
  {
43
  /** @var $xmlModel Mage_XmlConnect_Model_Simplexml_Element */
44
- $xmlModel = Mage::getModel(
45
- 'xmlconnect/simplexml_element',
46
- '<store_credits_info></store_credits_info>'
47
- );
48
 
49
  $accountBalance = $this->getLayout()
50
  ->addBlock('enterprise_customerbalance/account_balance', 'account_balance');
51
 
52
- $customerBalanceHelper = Mage::helper('enterprise_customerbalance');
53
-
54
- $xmlModel->addCustomChild(
55
- 'balance',
56
- null,
57
- array(
58
- 'label' => $customerBalanceHelper->__('Your current balance is:'),
59
- 'value' => $accountBalance->getBalance(),
60
- 'formatted_value' => Mage::helper('core')->currency($accountBalance->getBalance(), true, false)
61
- )
62
- );
63
 
64
  $accountHistory = $this->getLayout()
65
  ->addBlock('enterprise_customerbalance/account_history', 'account_history');
66
 
67
- if ($accountHistory->canShow()
68
- && $accountHistory->getEvents()
69
- && count($accountHistory->getEvents())
70
- ) {
71
- $balanceHistory = $xmlModel->addCustomChild(
72
- 'balance_history',
73
- null,
74
- array(
75
- 'label' => $customerBalanceHelper->__('Balance History'),
76
- 'action_label' => $customerBalanceHelper->__('Action'),
77
- 'balance_change_label' => $customerBalanceHelper->__('Balance Change'),
78
- 'balance_label' => $customerBalanceHelper->__('Balance'),
79
- 'date_label' => $customerBalanceHelper->__('Date')
80
- )
81
- );
82
 
83
  foreach ($accountHistory->getEvents() as $event) {
84
  $item = $balanceHistory->addCustomChild('item');
85
- $item->addCustomChild(
86
- 'action',
87
- null,
88
- array(
89
- 'value' => $accountHistory->getActionLabel($event->getAction())
90
- )
91
- );
92
 
93
- $item->addCustomChild(
94
- 'balance_change',
95
- null,
96
- array(
97
- 'value' => Mage::helper('core')->currency($event->getBalanceDelta(), true, false)
98
- )
99
- );
100
 
101
- $item->addCustomChild(
102
- 'balance',
103
- null,
104
- array(
105
- 'value' => Mage::helper('core')->currency($event->getBalanceAmount(), true, false)
106
- )
107
- );
108
 
109
- $item->addCustomChild(
110
- 'date',
111
- null,
112
- array(
113
- 'value' => Mage::helper('core')->formatDate($event->getUpdatedAt(), 'short', true)
114
- )
115
- );
116
  }
117
  }
118
 
41
  protected function _toHtml()
42
  {
43
  /** @var $xmlModel Mage_XmlConnect_Model_Simplexml_Element */
44
+ $xmlModel = Mage::getModel('xmlconnect/simplexml_element', '<store_credits_info></store_credits_info>');
 
 
 
45
 
46
  $accountBalance = $this->getLayout()
47
  ->addBlock('enterprise_customerbalance/account_balance', 'account_balance');
48
 
49
+ $xmlModel->addCustomChild('balance', null, array(
50
+ 'label' => $this->__('Your current balance is:'),
51
+ 'value' => $accountBalance->getBalance(),
52
+ 'formatted_value' => Mage::helper('core')->currency($accountBalance->getBalance(), true, false)
53
+ ));
 
 
 
 
 
 
54
 
55
  $accountHistory = $this->getLayout()
56
  ->addBlock('enterprise_customerbalance/account_history', 'account_history');
57
 
58
+ if ($accountHistory->canShow() && $accountHistory->getEvents() && count($accountHistory->getEvents())) {
59
+ $balanceHistory = $xmlModel->addCustomChild('balance_history', null, array(
60
+ 'label' => $this->__('Balance History'),
61
+ 'action_label' => $this->__('Action'),
62
+ 'balance_change_label' => $this->__('Balance Change'),
63
+ 'balance_label' => $this->__('Balance'),
64
+ 'date_label' => $this->__('Date')
65
+ ));
 
 
 
 
 
 
 
66
 
67
  foreach ($accountHistory->getEvents() as $event) {
68
  $item = $balanceHistory->addCustomChild('item');
69
+ $item->addCustomChild('action', null, array(
70
+ 'value' => $accountHistory->getActionLabel($event->getAction())
71
+ ));
 
 
 
 
72
 
73
+ $item->addCustomChild('balance_change', null, array(
74
+ 'value' => Mage::helper('core')->currency($event->getBalanceDelta(), true, false)
75
+ ));
 
 
 
 
76
 
77
+ $item->addCustomChild('balance', null, array(
78
+ 'value' => Mage::helper('core')->currency($event->getBalanceAmount(), true, false)
79
+ ));
 
 
 
 
80
 
81
+ $item->addCustomChild('date', null, array(
82
+ 'value' => Mage::helper('core')->formatDate($event->getUpdatedAt(), 'short', true)
83
+ ));
 
 
 
 
84
  }
85
  }
86
 
app/code/core/Mage/XmlConnect/Block/Home.php CHANGED
@@ -76,9 +76,7 @@ class Mage_XmlConnect_Block_Home extends Mage_XmlConnect_Block_Catalog
76
  ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('category'));
77
 
78
  $iconXml = $itemXmlObj->addChild('icon', $icon);
79
-
80
  $file = Mage::helper('xmlconnect')->urlToPath($icon);
81
-
82
  $iconXml->addAttribute('modification_time', filemtime($file));
83
  }
84
  $homeXmlObj->addChild('home_banner', '/current/media/catalog/category/banner_home.png');
76
  ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('category'));
77
 
78
  $iconXml = $itemXmlObj->addChild('icon', $icon);
 
79
  $file = Mage::helper('xmlconnect')->urlToPath($icon);
 
80
  $iconXml->addAttribute('modification_time', filemtime($file));
81
  }
82
  $homeXmlObj->addChild('home_banner', '/current/media/catalog/category/banner_home.png');
app/code/core/Mage/XmlConnect/Block/Review/Form.php CHANGED
@@ -59,21 +59,15 @@ class Mage_XmlConnect_Block_Review_Form extends Mage_Core_Block_Template
59
  }
60
 
61
  if ($this->getRatings()) {
62
- $ratingsFieldset = $xmlReview->addCustomChild(
63
- 'fieldset',
64
- null,
65
- array('label' => $this->__('How do you rate this product?'))
66
- );
67
 
68
  foreach ($this->getRatings() as $rating) {
69
- $ratingField = $ratingsFieldset->addField(
70
- 'ratings[' . $rating->getId() . ']',
71
- 'radio',
72
- array(
73
- 'label' => $rating->getRatingCode(),
74
- 'required' => 'true'
75
- )
76
- );
77
  foreach ($rating->getOptions() as $option) {
78
  $ratingField->addCustomChild('value', $option->getId());
79
  }
@@ -81,31 +75,19 @@ class Mage_XmlConnect_Block_Review_Form extends Mage_Core_Block_Template
81
  }
82
 
83
  $reviewFieldset = $xmlReview->addCustomChild('fieldset');
84
- $reviewFieldset->addField(
85
- 'nickname',
86
- 'text',
87
- array(
88
- 'label' => $this->__('Nickname'),
89
- 'required' => 'true',
90
- 'value' => $nickname
91
- )
92
- );
93
- $reviewFieldset->addField(
94
- 'title',
95
- 'text',
96
- array(
97
- 'label' => $this->__('Summary of Your Review'),
98
- 'required' => 'true'
99
- )
100
- );
101
- $reviewFieldset->addField(
102
- 'detail',
103
- 'textarea',
104
- array(
105
- 'label' => $this->__('Review'),
106
- 'required' => 'true'
107
- )
108
- );
109
 
110
  return $xmlReview->asNiceXml();
111
  }
@@ -118,14 +100,9 @@ class Mage_XmlConnect_Block_Review_Form extends Mage_Core_Block_Template
118
  public function getRatings()
119
  {
120
  if (is_null($this->_ratings)) {
121
- $this->_ratings = Mage::getModel('rating/rating')
122
- ->getResourceCollection()
123
- ->addEntityFilter('product')
124
- ->setPositionOrder()
125
- ->addRatingPerStoreName(Mage::app()->getStore()->getId())
126
- ->setStoreFilter(Mage::app()->getStore()->getId())
127
- ->load()
128
- ->addOptionToItems();
129
 
130
  if (!$this->_ratings->getSize()) {
131
  $this->_ratings = false;
59
  }
60
 
61
  if ($this->getRatings()) {
62
+ $ratingsFieldset = $xmlReview->addCustomChild('fieldset', null, array(
63
+ 'label' => $this->__('How do you rate this product?')
64
+ ));
 
 
65
 
66
  foreach ($this->getRatings() as $rating) {
67
+ $ratingField = $ratingsFieldset->addField('ratings[' . $rating->getId() . ']', 'radio', array(
68
+ 'label' => $rating->getRatingCode(),
69
+ 'required' => 'true'
70
+ ));
 
 
 
 
71
  foreach ($rating->getOptions() as $option) {
72
  $ratingField->addCustomChild('value', $option->getId());
73
  }
75
  }
76
 
77
  $reviewFieldset = $xmlReview->addCustomChild('fieldset');
78
+ $reviewFieldset->addField('nickname', 'text', array(
79
+ 'label' => $this->__('Nickname'),
80
+ 'required' => 'true',
81
+ 'value' => $nickname
82
+ ));
83
+ $reviewFieldset->addField('title', 'text', array(
84
+ 'label' => $this->__('Summary of Your Review'),
85
+ 'required' => 'true'
86
+ ));
87
+ $reviewFieldset->addField('detail', 'textarea', array(
88
+ 'label' => $this->__('Review'),
89
+ 'required' => 'true'
90
+ ));
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  return $xmlReview->asNiceXml();
93
  }
100
  public function getRatings()
101
  {
102
  if (is_null($this->_ratings)) {
103
+ $this->_ratings = Mage::getModel('rating/rating')->getResourceCollection()->addEntityFilter('product')
104
+ ->setPositionOrder()->addRatingPerStoreName(Mage::app()->getStore()->getId())
105
+ ->setStoreFilter(Mage::app()->getStore()->getId())->load()->addOptionToItems();
 
 
 
 
 
106
 
107
  if (!$this->_ratings->getSize()) {
108
  $this->_ratings = false;
app/code/core/Mage/XmlConnect/Controller/Action.php CHANGED
@@ -62,7 +62,7 @@ abstract class Mage_XmlConnect_Controller_Action extends Mage_Core_Controller_Fr
62
  * Declare content type header
63
  * Validate current application
64
  *
65
- * @return void
66
  */
67
  public function preDispatch()
68
  {
@@ -78,8 +78,7 @@ abstract class Mage_XmlConnect_Controller_Action extends Mage_Core_Controller_Fr
78
  $screenSize = isset($_COOKIE[$screenSizeCookieName]) ? (string) $_COOKIE[$screenSizeCookieName] : '';
79
  if (!$appCode) {
80
  $this->_message(
81
- Mage::helper('xmlconnect')->__('Specified invalid app code.'),
82
- self::MESSAGE_STATUS_ERROR
83
  );
84
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
85
  return;
@@ -91,8 +90,7 @@ abstract class Mage_XmlConnect_Controller_Action extends Mage_Core_Controller_Fr
91
  && (int)Mage::getStoreConfig('general/restriction/mode') == 0
92
  ) {
93
  $this->_message(
94
- Mage::helper('xmlconnect')->__('Website is offline.'),
95
- self::MESSAGE_STATUS_SUCCESS
96
  );
97
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
98
  return;
@@ -108,8 +106,7 @@ abstract class Mage_XmlConnect_Controller_Action extends Mage_Core_Controller_Fr
108
  Mage::register('current_app', $appModel);
109
  } else {
110
  $this->_message(
111
- Mage::helper('xmlconnect')->__('Specified invalid app code.'),
112
- self::MESSAGE_STATUS_ERROR
113
  );
114
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
115
  return;
@@ -119,7 +116,7 @@ abstract class Mage_XmlConnect_Controller_Action extends Mage_Core_Controller_Fr
119
  /**
120
  * Validate response body
121
  *
122
- * @return void
123
  */
124
  public function postDispatch()
125
  {
@@ -139,7 +136,7 @@ abstract class Mage_XmlConnect_Controller_Action extends Mage_Core_Controller_Fr
139
  * @param string $text
140
  * @param string $status
141
  * @param array $children
142
- * @return void
143
  */
144
  protected function _message($text, $status, $children = array())
145
  {
62
  * Declare content type header
63
  * Validate current application
64
  *
65
+ * @return null
66
  */
67
  public function preDispatch()
68
  {
78
  $screenSize = isset($_COOKIE[$screenSizeCookieName]) ? (string) $_COOKIE[$screenSizeCookieName] : '';
79
  if (!$appCode) {
80
  $this->_message(
81
+ Mage::helper('xmlconnect')->__('Specified invalid app code.'), self::MESSAGE_STATUS_ERROR
 
82
  );
83
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
84
  return;
90
  && (int)Mage::getStoreConfig('general/restriction/mode') == 0
91
  ) {
92
  $this->_message(
93
+ Mage::helper('xmlconnect')->__('Website is offline.'), self::MESSAGE_STATUS_SUCCESS
 
94
  );
95
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
96
  return;
106
  Mage::register('current_app', $appModel);
107
  } else {
108
  $this->_message(
109
+ Mage::helper('xmlconnect')->__('Specified invalid app code.'), self::MESSAGE_STATUS_ERROR
 
110
  );
111
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
112
  return;
116
  /**
117
  * Validate response body
118
  *
119
+ * @return null
120
  */
121
  public function postDispatch()
122
  {
136
  * @param string $text
137
  * @param string $status
138
  * @param array $children
139
+ * @return null
140
  */
141
  protected function _message($text, $status, $children = array())
142
  {
app/code/core/Mage/XmlConnect/Helper/Android.php CHANGED
@@ -582,8 +582,7 @@ class Mage_XmlConnect_Helper_Android extends Mage_Core_Helper_Abstract
582
  public function validateConfig($native)
583
  {
584
  $errors = array();
585
- if ($native === false
586
- || !isset($native['navigationBar']['icon'])
587
  || !Zend_Validate::is($native['navigationBar']['icon'], 'NotEmpty')
588
  ) {
589
  $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Logo in Header" field from Design Tab.');
@@ -692,7 +691,7 @@ class Mage_XmlConnect_Helper_Android extends Mage_Core_Helper_Abstract
692
  *
693
  * @throws Mage_Core_Exception
694
  * @param array $data
695
- * @return void
696
  */
697
  public function checkRequiredConfigFields($data)
698
  {
@@ -701,15 +700,11 @@ class Mage_XmlConnect_Helper_Android extends Mage_Core_Helper_Abstract
701
  }
702
 
703
  if (isset($data['navigationBar']['icon']) && empty($data['navigationBar']['icon'])) {
704
- Mage::throwException(
705
- Mage::helper('xmlconnect')->__('Logo in Header image missing.')
706
- );
707
  }
708
 
709
  if (isset($data['body']['bannerAndroidImage']) && empty($data['body']['bannerAndroidImage'])) {
710
- Mage::throwException(
711
- Mage::helper('xmlconnect')->__('Banner on Home Screen image missing.')
712
- );
713
  }
714
  }
715
 
582
  public function validateConfig($native)
583
  {
584
  $errors = array();
585
+ if ($native === false || !isset($native['navigationBar']['icon'])
 
586
  || !Zend_Validate::is($native['navigationBar']['icon'], 'NotEmpty')
587
  ) {
588
  $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Logo in Header" field from Design Tab.');
691
  *
692
  * @throws Mage_Core_Exception
693
  * @param array $data
694
+ * @return null
695
  */
696
  public function checkRequiredConfigFields($data)
697
  {
700
  }
701
 
702
  if (isset($data['navigationBar']['icon']) && empty($data['navigationBar']['icon'])) {
703
+ Mage::throwException(Mage::helper('xmlconnect')->__('Logo in Header image missing.'));
 
 
704
  }
705
 
706
  if (isset($data['body']['bannerAndroidImage']) && empty($data['body']['bannerAndroidImage'])) {
707
+ Mage::throwException(Mage::helper('xmlconnect')->__('Banner on Home Screen image missing.'));
 
 
708
  }
709
  }
710
 
app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php CHANGED
@@ -40,6 +40,7 @@ class Mage_XmlConnect_Helper_Catalog_Category_Image extends Mage_Catalog_Helper_
40
  * @param string $attributeName
41
  * @param string $imageFile
42
  * @return Mage_XmlConnect_Helper_Catalog_Category_Image
 
43
  */
44
  public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile = null)
45
  {
40
  * @param string $attributeName
41
  * @param string $imageFile
42
  * @return Mage_XmlConnect_Helper_Catalog_Category_Image
43
+ *
44
  */
45
  public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile = null)
46
  {
app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php CHANGED
@@ -40,8 +40,7 @@ class Mage_XmlConnect_Helper_Customer_Form_Renderer extends Mage_Core_Helper_Abs
40
  * @param Enterprise_Eav_Block_Form_Renderer_Abstract $blockObject
41
  * @return array
42
  */
43
- public function addTitleAndRequiredAttr(
44
- Mage_XmlConnect_Model_Simplexml_Form_Abstract $fieldsetXmlObj,
45
  Enterprise_Eav_Block_Form_Renderer_Abstract $blockObject
46
  ) {
47
  $attributes = array();
40
  * @param Enterprise_Eav_Block_Form_Renderer_Abstract $blockObject
41
  * @return array
42
  */
43
+ public function addTitleAndRequiredAttr(Mage_XmlConnect_Model_Simplexml_Form_Abstract $fieldsetXmlObj,
 
44
  Enterprise_Eav_Block_Form_Renderer_Abstract $blockObject
45
  ) {
46
  $attributes = array();
app/code/core/Mage/XmlConnect/Helper/Customer/Order.php CHANGED
@@ -33,6 +33,16 @@
33
  */
34
  class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
35
  {
 
 
 
 
 
 
 
 
 
 
36
  /**
37
  * Add Weee taxes child to the XML
38
  *
@@ -41,27 +51,23 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
41
  * @param Mage_XmlConnect_Model_Simplexml_Element $priceXml
42
  * @param Mage_XmlConnect_Model_Simplexml_Element $subtotalXml
43
  * @param bool $isIncludeTax
44
- * @return void
45
  */
46
- public function addPriceAndSubtotalToXml(
47
- Mage_Core_Block_Template $renderer,
48
- Mage_Sales_Model_Order_Item $item,
49
- Mage_XmlConnect_Model_Simplexml_Element $priceXml,
50
- Mage_XmlConnect_Model_Simplexml_Element $subtotalXml,
51
  $isIncludeTax = false
52
- )
53
- {
54
  $weeeParams = array();
55
 
56
  $typesOfDisplay = $renderer->getTypesOfDisplay();
57
  if ($isIncludeTax) {
58
  $nodeName = 'including_tax';
59
- $nodeLabel = $renderer->__('Incl. Tax');
60
 
61
  $inclPrice = $renderer->helper('checkout')->getPriceInclTax($item);
62
  $inclSubtotal = $renderer->helper('checkout')->getSubtotalInclTax($item);
63
 
64
- if ($typesOfDisplay[14]) {
65
  $price = $inclPrice + $renderer->getWeeeTaxAppliedAmount();
66
  $subtotal = $inclSubtotal + $item->getWeeeTaxAppliedRowAmount();
67
  } else {
@@ -71,14 +77,12 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
71
  $weeeParams['include'] = $inclPrice;
72
  } else {
73
  $nodeName = 'excluding_tax';
74
- $nodeLabel = $renderer->__('Excl. Tax');
75
 
76
- if ($typesOfDisplay[14]) {
77
- $price = $item->getPrice()
78
- + $renderer->getWeeeTaxAppliedAmount()
79
  + $renderer->getWeeeTaxDisposition();
80
- $subtotal = $item->getRowTotal()
81
- + $item->getWeeeTaxAppliedRowAmount()
82
  + $item->getWeeeTaxRowDisposition();
83
  } else {
84
  $price = $item->getPrice();
@@ -94,28 +98,14 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
94
  }
95
 
96
  $this->addWeeeTaxesToPriceXml(
97
- $renderer,
98
- $item,
99
- $priceXml->addCustomChild(
100
- $nodeName,
101
- null,
102
- $configNode
103
- ),
104
- $weeeParams
105
  );
106
 
107
  $configNode['value'] = $this->formatPrice($renderer, $subtotal);
108
  $weeeParams['include'] = $isIncludeTax ? $inclSubtotal : null;
109
  $weeeParams['is_subtotal'] = true;
110
  $this->addWeeeTaxesToPriceXml(
111
- $renderer,
112
- $item,
113
- $subtotalXml->addCustomChild(
114
- $nodeName,
115
- null,
116
- $configNode
117
- ),
118
- $weeeParams
119
  );
120
  }
121
 
@@ -124,13 +114,11 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
124
  *
125
  * @param Mage_Core_Block_Template $renderer Product renderer
126
  * @param Mage_XmlConnect_Model_Simplexml_Element $itemXml
127
- * @return void
128
  */
129
- public function addItemOptionsToXml(
130
- Mage_Core_Block_Template $renderer,
131
  Mage_XmlConnect_Model_Simplexml_Element $itemXml
132
- )
133
- {
134
  $options = $renderer->getItemOptions();
135
  if (!empty($options)) {
136
  $optionsXml = $itemXml->addChild('options');
@@ -146,11 +134,7 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
146
  $value = $option['value'];
147
  }
148
  if ($value) {
149
- $optionsXml->addCustomChild(
150
- 'option',
151
- strip_tags($value),
152
- array('label' => $option['label'])
153
- );
154
  }
155
  }
156
  }
@@ -163,15 +147,11 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
163
  * @param Mage_Sales_Model_Order_Item $item
164
  * @param Mage_XmlConnect_Model_Simplexml_Element $parentXml
165
  * @param array $params Params for Weee taxes: 'include' - Price including tax, 'is_subtotal' - Flag of subtotal
166
- * @return void
167
  */
168
- public function addWeeeTaxesToPriceXml(
169
- Mage_Core_Block_Template $renderer,
170
- Mage_Sales_Model_Order_Item $item,
171
- Mage_XmlConnect_Model_Simplexml_Element $parentXml,
172
- $params = array()
173
- )
174
- {
175
  $weeTaxes = $renderer->getWeeeTaxes();
176
  if (empty($weeTaxes)) {
177
  return;
@@ -182,27 +162,23 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
182
  $row = isset($params['is_subtotal']) && $params['is_subtotal'] ? 'row_' : '';
183
 
184
  /** @var $weeeXml Mage_XmlConnect_Model_Simplexml_Element */
185
- if ($typesOfDisplay[1]) {
186
  $weeeXml = $parentXml->addChild('weee');
187
  foreach ($weeTaxes as $tax) {
188
- $weeeXml->addCustomChild(
189
- 'tax',
190
- $this->formatPrice($renderer, $tax[$row . 'amount']),
191
  array('label' => $tax['title'])
192
  );
193
  }
194
- } elseif ($typesOfDisplay[2] || $typesOfDisplay[4]) {
195
  $weeeXml = $parentXml->addChild('weee');
196
  foreach ($weeTaxes as $tax) {
197
- $weeeXml->addCustomChild(
198
- 'tax',
199
- $this->formatPrice($renderer, $tax[$row . 'amount_incl_tax']),
200
  array('label' => $tax['title'])
201
  );
202
  }
203
  }
204
 
205
- if ($typesOfDisplay[2]) {
206
  if (!is_null($params['include'])) {
207
  // including tax
208
  if (isset($params['is_subtotal'])) {
@@ -213,12 +189,10 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
213
  } else {
214
  // excluding tax
215
  if ($params['is_subtotal']) {
216
- $total = $item->getRowTotal()
217
- + $item->getWeeeTaxAppliedRowAmount()
218
  + $item->getWeeeTaxRowDisposition();
219
  } else {
220
- $total = $item->getPrice()
221
- + $renderer->getWeeeTaxAppliedAmount()
222
  + $renderer->getWeeeTaxDisposition();
223
  }
224
  }
@@ -235,58 +209,31 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
235
  }
236
 
237
  /**
238
- * Add item quantites to the XML
239
  *
240
  * @param Mage_Core_Block_Template $renderer Product renderer
241
- * @param Mage_XmlConnect_Model_Simplexml_Element $parentXml
242
  * @param Mage_Sales_Model_Order_Item $item
243
- * @return void
244
  */
245
- public function addQuantityToXml(
246
- Mage_Core_Block_Template $renderer,
247
- Mage_XmlConnect_Model_Simplexml_Element $quantityXml,
248
- Mage_Sales_Model_Order_Item $item
249
- )
250
- {
251
  $qty = 1 * $item->getQtyOrdered();
252
  if ($qty > 0) {
253
- $quantityXml->addCustomChild(
254
- 'value',
255
- $qty,
256
- array(
257
- 'label' => $renderer->__('Ordered')
258
- )
259
- );
260
  }
261
  $qty = 1 * $item->getQtyShipped();
262
  if ($qty > 0) {
263
- $quantityXml->addCustomChild(
264
- 'value',
265
- $qty,
266
- array(
267
- 'label' => $renderer->__('Shipped')
268
- )
269
- );
270
  }
271
  $qty = 1 * $item->getQtyCanceled();
272
  if ($qty > 0) {
273
- $quantityXml->addCustomChild(
274
- 'value',
275
- $qty,
276
- array(
277
- 'label' => $renderer->__('Canceled')
278
- )
279
- );
280
  }
281
  $qty = 1 * $item->getQtyRefunded();
282
  if ($qty > 0) {
283
- $quantityXml->addCustomChild(
284
- 'value',
285
- $qty,
286
- array(
287
- 'label' => $renderer->__('Refunded')
288
- )
289
- );
290
  }
291
  }
292
 
33
  */
34
  class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract
35
  {
36
+ /**#@+
37
+ * Price display type
38
+ * @see Mage_Weee_Helper_Data::typeOfDisplay(...);
39
+ */
40
+ const PRICE_DISPLAY_TYPE_1 = 1;
41
+ const PRICE_DISPLAY_TYPE_2 = 2;
42
+ const PRICE_DISPLAY_TYPE_4 = 4;
43
+ const PRICE_DISPLAY_TYPE_14 = 14;
44
+ /**#@-*/
45
+
46
  /**
47
  * Add Weee taxes child to the XML
48
  *
51
  * @param Mage_XmlConnect_Model_Simplexml_Element $priceXml
52
  * @param Mage_XmlConnect_Model_Simplexml_Element $subtotalXml
53
  * @param bool $isIncludeTax
54
+ * @return null
55
  */
56
+ public function addPriceAndSubtotalToXml(Mage_Core_Block_Template $renderer, Mage_Sales_Model_Order_Item $item,
57
+ Mage_XmlConnect_Model_Simplexml_Element $priceXml, Mage_XmlConnect_Model_Simplexml_Element $subtotalXml,
 
 
 
58
  $isIncludeTax = false
59
+ ) {
 
60
  $weeeParams = array();
61
 
62
  $typesOfDisplay = $renderer->getTypesOfDisplay();
63
  if ($isIncludeTax) {
64
  $nodeName = 'including_tax';
65
+ $nodeLabel = Mage::helper('tax')->__('Incl. Tax');
66
 
67
  $inclPrice = $renderer->helper('checkout')->getPriceInclTax($item);
68
  $inclSubtotal = $renderer->helper('checkout')->getSubtotalInclTax($item);
69
 
70
+ if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_14]) {
71
  $price = $inclPrice + $renderer->getWeeeTaxAppliedAmount();
72
  $subtotal = $inclSubtotal + $item->getWeeeTaxAppliedRowAmount();
73
  } else {
77
  $weeeParams['include'] = $inclPrice;
78
  } else {
79
  $nodeName = 'excluding_tax';
80
+ $nodeLabel = Mage::helper('tax')->__('Excl. Tax');
81
 
82
+ if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_14]) {
83
+ $price = $item->getPrice() + $renderer->getWeeeTaxAppliedAmount()
 
84
  + $renderer->getWeeeTaxDisposition();
85
+ $subtotal = $item->getRowTotal() + $item->getWeeeTaxAppliedRowAmount()
 
86
  + $item->getWeeeTaxRowDisposition();
87
  } else {
88
  $price = $item->getPrice();
98
  }
99
 
100
  $this->addWeeeTaxesToPriceXml(
101
+ $renderer, $item, $priceXml->addCustomChild($nodeName, null, $configNode), $weeeParams
 
 
 
 
 
 
 
102
  );
103
 
104
  $configNode['value'] = $this->formatPrice($renderer, $subtotal);
105
  $weeeParams['include'] = $isIncludeTax ? $inclSubtotal : null;
106
  $weeeParams['is_subtotal'] = true;
107
  $this->addWeeeTaxesToPriceXml(
108
+ $renderer, $item, $subtotalXml->addCustomChild($nodeName, null, $configNode), $weeeParams
 
 
 
 
 
 
 
109
  );
110
  }
111
 
114
  *
115
  * @param Mage_Core_Block_Template $renderer Product renderer
116
  * @param Mage_XmlConnect_Model_Simplexml_Element $itemXml
117
+ * @return null
118
  */
119
+ public function addItemOptionsToXml(Mage_Core_Block_Template $renderer,
 
120
  Mage_XmlConnect_Model_Simplexml_Element $itemXml
121
+ ) {
 
122
  $options = $renderer->getItemOptions();
123
  if (!empty($options)) {
124
  $optionsXml = $itemXml->addChild('options');
134
  $value = $option['value'];
135
  }
136
  if ($value) {
137
+ $optionsXml->addCustomChild('option', strip_tags($value), array('label' => $option['label']));
 
 
 
 
138
  }
139
  }
140
  }
147
  * @param Mage_Sales_Model_Order_Item $item
148
  * @param Mage_XmlConnect_Model_Simplexml_Element $parentXml
149
  * @param array $params Params for Weee taxes: 'include' - Price including tax, 'is_subtotal' - Flag of subtotal
150
+ * @return null
151
  */
152
+ public function addWeeeTaxesToPriceXml(Mage_Core_Block_Template $renderer, Mage_Sales_Model_Order_Item $item,
153
+ Mage_XmlConnect_Model_Simplexml_Element $parentXml, $params = array()
154
+ ) {
 
 
 
 
155
  $weeTaxes = $renderer->getWeeeTaxes();
156
  if (empty($weeTaxes)) {
157
  return;
162
  $row = isset($params['is_subtotal']) && $params['is_subtotal'] ? 'row_' : '';
163
 
164
  /** @var $weeeXml Mage_XmlConnect_Model_Simplexml_Element */
165
+ if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_1]) {
166
  $weeeXml = $parentXml->addChild('weee');
167
  foreach ($weeTaxes as $tax) {
168
+ $weeeXml->addCustomChild('tax', $this->formatPrice($renderer, $tax[$row . 'amount']),
 
 
169
  array('label' => $tax['title'])
170
  );
171
  }
172
+ } elseif ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_2] || $typesOfDisplay[self::PRICE_DISPLAY_TYPE_4]) {
173
  $weeeXml = $parentXml->addChild('weee');
174
  foreach ($weeTaxes as $tax) {
175
+ $weeeXml->addCustomChild('tax', $this->formatPrice($renderer, $tax[$row . 'amount_incl_tax']),
 
 
176
  array('label' => $tax['title'])
177
  );
178
  }
179
  }
180
 
181
+ if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_2]) {
182
  if (!is_null($params['include'])) {
183
  // including tax
184
  if (isset($params['is_subtotal'])) {
189
  } else {
190
  // excluding tax
191
  if ($params['is_subtotal']) {
192
+ $total = $item->getRowTotal() + $item->getWeeeTaxAppliedRowAmount()
 
193
  + $item->getWeeeTaxRowDisposition();
194
  } else {
195
+ $total = $item->getPrice() + $renderer->getWeeeTaxAppliedAmount()
 
196
  + $renderer->getWeeeTaxDisposition();
197
  }
198
  }
209
  }
210
 
211
  /**
212
+ * Add item quantities to the XML
213
  *
214
  * @param Mage_Core_Block_Template $renderer Product renderer
215
+ * @param Mage_XmlConnect_Model_Simplexml_Element $quantityXml
216
  * @param Mage_Sales_Model_Order_Item $item
217
+ * @return null
218
  */
219
+ public function addQuantityToXml(Mage_Core_Block_Template $renderer,
220
+ Mage_XmlConnect_Model_Simplexml_Element $quantityXml, Mage_Sales_Model_Order_Item $item
221
+ ) {
 
 
 
222
  $qty = 1 * $item->getQtyOrdered();
223
  if ($qty > 0) {
224
+ $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('xmlconnect')->__('Ordered')));
 
 
 
 
 
 
225
  }
226
  $qty = 1 * $item->getQtyShipped();
227
  if ($qty > 0) {
228
+ $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('xmlconnect')->__('Shipped')));
 
 
 
 
 
 
229
  }
230
  $qty = 1 * $item->getQtyCanceled();
231
  if ($qty > 0) {
232
+ $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('xmlconnect')->__('Canceled')));
 
 
 
 
 
 
233
  }
234
  $qty = 1 * $item->getQtyRefunded();
235
  if ($qty > 0) {
236
+ $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('xmlconnect')->__('Refunded')));
 
 
 
 
 
 
237
  }
238
  }
239
 
app/code/core/Mage/XmlConnect/Helper/Data.php CHANGED
@@ -43,14 +43,17 @@ class Mage_XmlConnect_Helper_Data extends Mage_Core_Helper_Abstract
43
  */
44
  const MESSAGE_TITLE_LENGTH = 255;
45
 
 
 
 
 
 
46
  /**
47
  * List of the keys for xml config that have to be excluded form application config
48
  *
49
  * @var array
50
  */
51
- protected $_excludedXmlConfigKeys = array(
52
- 'notifications/applicationMasterSecret',
53
- );
54
 
55
  /**
56
  * Application names array
@@ -238,9 +241,10 @@ class Mage_XmlConnect_Helper_Data extends Mage_Core_Helper_Abstract
238
  * Retrieve device specific country options array
239
  *
240
  * @throws Mage_Core_Exception
 
241
  * @return array
242
  */
243
- public function getCountryOptionsArray()
244
  {
245
  Varien_Profiler::start('TEST: ' . __METHOD__);
246
  $deviceType = $this->getDeviceType();
@@ -265,10 +269,8 @@ class Mage_XmlConnect_Helper_Data extends Mage_Core_Helper_Abstract
265
  $options = unserialize($cache);
266
  } else {
267
  if (isset($deviceCountries)) {
268
- $options = Mage::getModel('directory/country')
269
- ->getResourceCollection()
270
- ->addFieldToFilter('country_id', array('in' => $deviceCountries))
271
- ->loadByStore()
272
  ->toOptionArray(false);
273
  }
274
  if (Mage::app()->useCache('config')) {
@@ -570,19 +572,12 @@ EOT;
570
  $options = array();
571
  /** @var $app Mage_XmlConnect_Model_Application */
572
  foreach (Mage::getModel('xmlconnect/application')->getCollection() as $app) {
573
- $options[] = array(
574
- 'value' => $app->getCode(),
575
- 'label' => $app->getName()
576
- );
577
  }
578
  if (count($options) > 1) {
579
- array_unshift(
580
- $options,
581
- array(
582
- 'value' => '',
583
- 'label' => Mage::helper('xmlconnect')->__('Please Select Application')
584
- )
585
- );
586
  }
587
  return $options;
588
  }
@@ -605,6 +600,18 @@ EOT;
605
  return $apps;
606
  }
607
 
 
 
 
 
 
 
 
 
 
 
 
 
608
  /**
609
  * Send broadcast message
610
  *
@@ -618,13 +625,13 @@ EOT;
618
  }
619
 
620
  try {
621
- $appCode = $queue->getAppCode();
622
  /** @var $app Mage_XmlConnect_Model_Application */
623
- $app = Mage::getModel('xmlconnect/application')->loadByCode($appCode);
624
 
625
  if (!$app->getId()) {
626
  Mage::throwException(
627
- Mage::helper('xmlconnect')->__('Can\'t load application with code "%s"', $appCode)
628
  );
629
  }
630
 
@@ -647,27 +654,19 @@ EOT;
647
  break;
648
  }
649
 
650
- $curlHandler = curl_init(Mage::getStoreConfig($configPath));
651
-
652
- $httpHeaders = $this->getHttpHeaders();
653
-
654
- curl_setopt($curlHandler, CURLOPT_POST, 1);
655
- curl_setopt($curlHandler, CURLOPT_HTTPHEADER, $httpHeaders);
656
- curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $params);
657
- curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, 1);
658
- curl_setopt($curlHandler, CURLOPT_USERPWD, $app->getUserpwd());
659
- curl_setopt($curlHandler, CURLOPT_TIMEOUT, 60);
660
 
661
- // Execute the request.
662
- curl_exec($curlHandler);
663
- $succeeded = curl_errno($curlHandler) == 0;
664
- $responseCode = curl_getinfo($curlHandler, CURLINFO_HTTP_CODE) == 200;
665
- // close cURL resource, and free up system resources
666
- curl_close($curlHandler);
667
 
668
- if ($succeeded && $responseCode) {
669
  $queue->setStatus(Mage_XmlConnect_Model_Queue::STATUS_COMPLETED);
670
  }
 
 
671
  $queue->setIsSent(true);
672
  $queue->save();
673
  return;
@@ -687,6 +686,18 @@ EOT;
687
  return array('Content-Type: application/json');
688
  }
689
 
 
 
 
 
 
 
 
 
 
 
 
 
690
  /**
691
  * Remove from array the unnecessary parameters by given keys
692
  *
@@ -823,10 +834,8 @@ EOT;
823
  */
824
  public function validateConfFieldNotEmpty($field, $native)
825
  {
826
- if (($native === false)
827
- || (!isset($native['body']) || !is_array($native['body'])
828
- || !isset($native['body'][$field])
829
- || !Zend_Validate::is($native['body'][$field], 'NotEmpty'))
830
  ) {
831
  return false;
832
  }
@@ -861,4 +870,15 @@ EOT;
861
  $params = array_merge($defaultParams, $params);
862
  return Mage::getUrl($action, $params);
863
  }
 
 
 
 
 
 
 
 
 
 
 
864
  }
43
  */
44
  const MESSAGE_TITLE_LENGTH = 255;
45
 
46
+ /**
47
+ * Curl default timeout
48
+ */
49
+ const CURLOPT_DEFAULT_TIMEOUT = 60;
50
+
51
  /**
52
  * List of the keys for xml config that have to be excluded form application config
53
  *
54
  * @var array
55
  */
56
+ protected $_excludedXmlConfigKeys = array('notifications/applicationMasterSecret');
 
 
57
 
58
  /**
59
  * Application names array
241
  * Retrieve device specific country options array
242
  *
243
  * @throws Mage_Core_Exception
244
+ * @param bool $isItunes deprecated after 1.6.0.0
245
  * @return array
246
  */
247
+ public function getCountryOptionsArray($isItunes = false)
248
  {
249
  Varien_Profiler::start('TEST: ' . __METHOD__);
250
  $deviceType = $this->getDeviceType();
269
  $options = unserialize($cache);
270
  } else {
271
  if (isset($deviceCountries)) {
272
+ $options = Mage::getModel('directory/country')->getResourceCollection()
273
+ ->addFieldToFilter('country_id', array('in' => $deviceCountries))->loadByStore()
 
 
274
  ->toOptionArray(false);
275
  }
276
  if (Mage::app()->useCache('config')) {
572
  $options = array();
573
  /** @var $app Mage_XmlConnect_Model_Application */
574
  foreach (Mage::getModel('xmlconnect/application')->getCollection() as $app) {
575
+ $options[] = array('value' => $app->getId(), 'label' => $app->getName());
 
 
 
576
  }
577
  if (count($options) > 1) {
578
+ array_unshift($options, array(
579
+ 'value' => '', 'label' => Mage::helper('xmlconnect')->__('Please Select Application')
580
+ ));
 
 
 
 
581
  }
582
  return $options;
583
  }
600
  return $apps;
601
  }
602
 
603
+ /**
604
+ * Check if creating AirMail template for the application is allowed
605
+ *
606
+ * @param Mage_XmlConnect_Model_Application $application
607
+ * @deprecated after 1.6.0.0
608
+ * @return boolean
609
+ */
610
+ public static function isTemplateAllowedForApplication($application = null)
611
+ {
612
+ return true;
613
+ }
614
+
615
  /**
616
  * Send broadcast message
617
  *
625
  }
626
 
627
  try {
628
+ $applicationId = Mage::getModel('xmlconnect/template')->load($queue->getTemplateId())->getApplicationId();
629
  /** @var $app Mage_XmlConnect_Model_Application */
630
+ $app = Mage::getModel('xmlconnect/application')->load($applicationId);
631
 
632
  if (!$app->getId()) {
633
  Mage::throwException(
634
+ Mage::helper('xmlconnect')->__('Can\'t load application with id "%s"', $applicationId)
635
  );
636
  }
637
 
654
  break;
655
  }
656
 
657
+ $curl = new Varien_Http_Adapter_Curl();
658
+ $curl->setConfig($this->_getCurlConfig($app->getUserpwd()));
 
 
 
 
 
 
 
 
659
 
660
+ $urbanUrl = Mage::getStoreConfig($configPath);
661
+ $curl->write(
662
+ Zend_Http_Client::POST, $urbanUrl, HTTP_REQUEST_HTTP_VER_1_1, $this->getHttpHeaders(), $params
663
+ );
 
 
664
 
665
+ if ($curl->read() && $curl->getInfo(CURLINFO_HTTP_CODE) == 200) {
666
  $queue->setStatus(Mage_XmlConnect_Model_Queue::STATUS_COMPLETED);
667
  }
668
+ $curl->close();
669
+
670
  $queue->setIsSent(true);
671
  $queue->save();
672
  return;
686
  return array('Content-Type: application/json');
687
  }
688
 
689
+ /**
690
+ * Get urban airship curl request configuration
691
+ *
692
+ * @param string $userPwd
693
+ * @param int $timeout
694
+ * @return array
695
+ */
696
+ protected function _getCurlConfig($userPwd, $timeout = self::CURLOPT_DEFAULT_TIMEOUT)
697
+ {
698
+ return array ('timeout' => $timeout, 'userpwd' => $userPwd);
699
+ }
700
+
701
  /**
702
  * Remove from array the unnecessary parameters by given keys
703
  *
834
  */
835
  public function validateConfFieldNotEmpty($field, $native)
836
  {
837
+ if (($native === false) || (!isset($native['body']) || !is_array($native['body'])
838
+ || !isset($native['body'][$field]) || !Zend_Validate::is($native['body'][$field], 'NotEmpty'))
 
 
839
  ) {
840
  return false;
841
  }
870
  $params = array_merge($defaultParams, $params);
871
  return Mage::getUrl($action, $params);
872
  }
873
+
874
+ /**
875
+ * Remove trilling line breaks
876
+ *
877
+ * @param string $string
878
+ * @return string
879
+ */
880
+ public function trimLineBreaks($string)
881
+ {
882
+ return preg_replace(array('@\r@', '@\n+@'), array('', PHP_EOL), $string);
883
+ }
884
  }
app/code/core/Mage/XmlConnect/Helper/Image.php CHANGED
@@ -163,11 +163,7 @@ class Mage_XmlConnect_Helper_Image extends Mage_Core_Helper_Abstract
163
 
164
  $isCopied = copy($originalSizeFileName, $customSizeFileName);
165
  clearstatcache();
166
- if ($isCopied
167
- && (is_readable($customSizeFileName)
168
- || chmod($customSizeFileName, 0644)
169
- )
170
- ) {
171
  $this->_handleResize($fieldPath, $customSizeFileName);
172
  } else {
173
  $fileName = '';
@@ -184,7 +180,7 @@ class Mage_XmlConnect_Helper_Image extends Mage_Core_Helper_Abstract
184
  *
185
  * @param string $fieldPath
186
  * @param string $file
187
- * @return void
188
  */
189
  protected function _handleResize($fieldPath, $file)
190
  {
@@ -219,9 +215,7 @@ class Mage_XmlConnect_Helper_Image extends Mage_Core_Helper_Abstract
219
  $height = $conf['height'];
220
  }
221
 
222
- if (($width != $image->getOriginalWidth())
223
- || ($height != $image->getOriginalHeight())
224
- ) {
225
  $image->keepTransparency(true);
226
  $image->keepFrame(true);
227
  $image->keepAspectRatio(true);
@@ -647,7 +641,7 @@ class Mage_XmlConnect_Helper_Image extends Mage_Core_Helper_Abstract
647
  * @param mixed $item (argument to change)
648
  * @param mixed $key (used with array_walk_recursive function as a key of given array)
649
  * @param string $value (contains float)
650
- * @return void
651
  */
652
  protected function _zoom(&$item, $key, $value)
653
  {
163
 
164
  $isCopied = copy($originalSizeFileName, $customSizeFileName);
165
  clearstatcache();
166
+ if ($isCopied && (is_readable($customSizeFileName) || chmod($customSizeFileName, 0644))) {
 
 
 
 
167
  $this->_handleResize($fieldPath, $customSizeFileName);
168
  } else {
169
  $fileName = '';
180
  *
181
  * @param string $fieldPath
182
  * @param string $file
183
+ * @return null
184
  */
185
  protected function _handleResize($fieldPath, $file)
186
  {
215
  $height = $conf['height'];
216
  }
217
 
218
+ if (($width != $image->getOriginalWidth()) || ($height != $image->getOriginalHeight())) {
 
 
219
  $image->keepTransparency(true);
220
  $image->keepFrame(true);
221
  $image->keepAspectRatio(true);
641
  * @param mixed $item (argument to change)
642
  * @param mixed $key (used with array_walk_recursive function as a key of given array)
643
  * @param string $value (contains float)
644
+ * @return null
645
  */
646
  protected function _zoom(&$item, $key, $value)
647
  {
app/code/core/Mage/XmlConnect/Helper/Ipad.php CHANGED
@@ -98,11 +98,8 @@ class Mage_XmlConnect_Helper_Ipad extends Mage_Core_Helper_Abstract
98
  *
99
  * @var array
100
  */
101
- protected $_imageIds = array('icon',
102
- 'ipad_loader_portrait_image',
103
- 'ipad_loader_landscape_image',
104
- 'ipad_logo',
105
- 'big_logo'
106
  );
107
 
108
  /**
@@ -693,7 +690,7 @@ class Mage_XmlConnect_Helper_Ipad extends Mage_Core_Helper_Abstract
693
  *
694
  * @throws Mage_Core_Exception
695
  * @param array $data
696
- * @return void
697
  */
698
  public function checkRequiredConfigFields($data)
699
  {
@@ -701,23 +698,17 @@ class Mage_XmlConnect_Helper_Ipad extends Mage_Core_Helper_Abstract
701
  return;
702
  }
703
 
704
- if (isset($data['navigationBar']['icon'])
705
- && empty($data['navigationBar']['icon'])
706
- ) {
707
  Mage::throwException(
708
  Mage::helper('xmlconnect')->__('Logo in Header image missing.')
709
  );
710
  }
711
- if (isset($data['body']['bannerIpadImage'])
712
- && empty($data['body']['bannerIpadImage'])
713
- ) {
714
  Mage::throwException(
715
  Mage::helper('xmlconnect')->__('Banner on Home Screen (portrait mode) image missing.')
716
  );
717
  }
718
- if (isset($data['body']['bannerIpadLandscapeImage'])
719
- && empty($data['body']['bannerIpadLandscapeImage'])
720
- ) {
721
  Mage::throwException(
722
  Mage::helper('xmlconnect')->__('Banner on Home Screen (landscape mode) image missing.')
723
  );
98
  *
99
  * @var array
100
  */
101
+ protected $_imageIds = array(
102
+ 'icon', 'ipad_loader_portrait_image', 'ipad_loader_landscape_image', 'ipad_logo', 'big_logo'
 
 
 
103
  );
104
 
105
  /**
690
  *
691
  * @throws Mage_Core_Exception
692
  * @param array $data
693
+ * @return null
694
  */
695
  public function checkRequiredConfigFields($data)
696
  {
698
  return;
699
  }
700
 
701
+ if (isset($data['navigationBar']['icon']) && empty($data['navigationBar']['icon'])) {
 
 
702
  Mage::throwException(
703
  Mage::helper('xmlconnect')->__('Logo in Header image missing.')
704
  );
705
  }
706
+ if (isset($data['body']['bannerIpadImage']) && empty($data['body']['bannerIpadImage'])) {
 
 
707
  Mage::throwException(
708
  Mage::helper('xmlconnect')->__('Banner on Home Screen (portrait mode) image missing.')
709
  );
710
  }
711
+ if (isset($data['body']['bannerIpadLandscapeImage']) && empty($data['body']['bannerIpadLandscapeImage'])) {
 
 
712
  Mage::throwException(
713
  Mage::helper('xmlconnect')->__('Banner on Home Screen (landscape mode) image missing.')
714
  );
app/code/core/Mage/XmlConnect/Helper/Iphone.php CHANGED
@@ -59,13 +59,7 @@ class Mage_XmlConnect_Helper_Iphone extends Mage_Core_Helper_Abstract
59
  * @var array
60
  */
61
  protected $_imageIds = array(
62
- 'icon',
63
- 'loader_image',
64
- 'loader_image_i4',
65
- 'logo',
66
- 'logo_i4',
67
- 'big_logo',
68
- 'big_logo_i4'
69
  );
70
 
71
  /**
@@ -641,10 +635,8 @@ class Mage_XmlConnect_Helper_Iphone extends Mage_Core_Helper_Abstract
641
  {
642
  $errors = array();
643
 
644
- if ($native === false
645
- || (!isset($native['navigationBar']['icon'])
646
- || !Zend_Validate::is($native['navigationBar']['icon'], 'NotEmpty')
647
- )
648
  ) {
649
  $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Logo in Header" field from Design Tab.');
650
  }
@@ -754,7 +746,7 @@ class Mage_XmlConnect_Helper_Iphone extends Mage_Core_Helper_Abstract
754
  *
755
  * @throws Mage_Core_Exception
756
  * @param array $data
757
- * @return void
758
  */
759
  public function checkRequiredConfigFields($data)
760
  {
@@ -762,26 +754,14 @@ class Mage_XmlConnect_Helper_Iphone extends Mage_Core_Helper_Abstract
762
  return;
763
  }
764
 
765
- if (isset($data['navigationBar']['icon'])
766
- && empty($data['navigationBar']['icon'])
767
- ) {
768
- Mage::throwException(
769
- Mage::helper('xmlconnect')->__('Logo in Header image missing.')
770
- );
771
  }
772
- if (isset($data['body']['bannerImage'])
773
- && empty($data['body']['bannerImage'])
774
- ) {
775
- Mage::throwException(
776
- Mage::helper('xmlconnect')->__('Banner on Home Screen image missing.')
777
- );
778
  }
779
- if (isset($data['body']['backgroundImage'])
780
- && empty($data['body']['backgroundImage'])
781
- ) {
782
- Mage::throwException(
783
- Mage::helper('xmlconnect')->__('App Background image missing.')
784
- );
785
  }
786
  }
787
 
59
  * @var array
60
  */
61
  protected $_imageIds = array(
62
+ 'icon', 'loader_image', 'loader_image_i4', 'logo', 'logo_i4', 'big_logo', 'big_logo_i4'
 
 
 
 
 
 
63
  );
64
 
65
  /**
635
  {
636
  $errors = array();
637
 
638
+ if ($native === false || (!isset($native['navigationBar']['icon'])
639
+ || !Zend_Validate::is($native['navigationBar']['icon'], 'NotEmpty'))
 
 
640
  ) {
641
  $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Logo in Header" field from Design Tab.');
642
  }
746
  *
747
  * @throws Mage_Core_Exception
748
  * @param array $data
749
+ * @return null
750
  */
751
  public function checkRequiredConfigFields($data)
752
  {
754
  return;
755
  }
756
 
757
+ if (isset($data['navigationBar']['icon']) && empty($data['navigationBar']['icon'])) {
758
+ Mage::throwException(Mage::helper('xmlconnect')->__('Logo in Header image missing.'));
 
 
 
 
759
  }
760
+ if (isset($data['body']['bannerImage']) && empty($data['body']['bannerImage'])) {
761
+ Mage::throwException(Mage::helper('xmlconnect')->__('Banner on Home Screen image missing.'));
 
 
 
 
762
  }
763
+ if (isset($data['body']['backgroundImage']) && empty($data['body']['backgroundImage'])) {
764
+ Mage::throwException(Mage::helper('xmlconnect')->__('App Background image missing.'));
 
 
 
 
765
  }
766
  }
767
 
app/code/core/Mage/XmlConnect/Helper/Theme.php CHANGED
@@ -226,9 +226,7 @@ EOT;
226
  Mage::logException($e);
227
  }
228
  if (!count($defaultThemeArray)) {
229
- Mage::throwException(
230
- Mage::helper('xmlconnect')->__('Can\'t load default themes.')
231
- );
232
  }
233
  return $defaultThemeArray;
234
  }
@@ -273,7 +271,7 @@ EOT;
273
  *
274
  * @throws Mage_Core_Exception
275
  * @param null $theme
276
- * @return void
277
  */
278
  public function resetTheme($theme = null)
279
  {
@@ -293,9 +291,7 @@ EOT;
293
  }
294
 
295
  if (!$ioFile->cp($src, $dst)) {
296
- Mage::throwException(
297
- Mage::helper('xmlconnect')->__('Can\'t copy file "%s" to "%s".', $src, $dst)
298
- );
299
  } else {
300
  $ioFile->chmod($dst, 0755);
301
  }
226
  Mage::logException($e);
227
  }
228
  if (!count($defaultThemeArray)) {
229
+ Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t load default themes.'));
 
 
230
  }
231
  return $defaultThemeArray;
232
  }
271
  *
272
  * @throws Mage_Core_Exception
273
  * @param null $theme
274
+ * @return null
275
  */
276
  public function resetTheme($theme = null)
277
  {
291
  }
292
 
293
  if (!$ioFile->cp($src, $dst)) {
294
+ Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t copy file "%s" to "%s".', $src, $dst));
 
 
295
  } else {
296
  $ioFile->chmod($dst, 0755);
297
  }
app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php CHANGED
@@ -37,7 +37,7 @@ class Mage_XmlConnect_Model_Adminhtml_System_Config_Backend_Baseurl
37
  /**
38
  * Update all applications "updated at" parameter with current date
39
  *
40
- * @return this
41
  */
42
  protected function _afterSave()
43
  {
37
  /**
38
  * Update all applications "updated at" parameter with current date
39
  *
40
+ * @return Mage_XmlConnect_Model_Adminhtml_System_Config_Backend_Baseurl
41
  */
42
  protected function _afterSave()
43
  {
app/code/core/Mage/XmlConnect/Model/Application.php CHANGED
@@ -27,8 +27,8 @@
27
  /**
28
  * Xmlconnect Application model
29
  *
30
- * @method Mage_XmlConnect_Model_Mysql4_Application _getResource()
31
- * @method Mage_XmlConnect_Model_Mysql4_Application getResource()
32
  * @method string getName()
33
  * @method Mage_XmlConnect_Model_Application setName(string $value)
34
  * @method string getCode()
@@ -257,15 +257,13 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
257
  /**
258
  * Initialize application
259
  *
260
- * @return void
261
  */
262
  protected function _construct()
263
  {
264
  $this->_init('xmlconnect/application');
265
  $this->_configModel = Mage::getModel('xmlconnect/configData');
266
- $this->_configModel->setDeleteOnUpdate(
267
- $this->getDeleteOnUpdateConfig()
268
- );
269
  }
270
 
271
  /**
@@ -345,7 +343,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
345
  /**
346
  * Set default configuration data
347
  *
348
- * @return void
349
  */
350
  public function loadDefaultConfiguration()
351
  {
@@ -471,8 +469,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
471
  ->getStore($this->getStoreId())->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE);
472
  $result['general']['magentoVersion'] = Mage::getVersion();
473
  $result['general']['copyright'] = Mage::getStoreConfig(
474
- self::XML_PATH_DESIGN_FOOTER_COPYRIGHT,
475
- $this->getStoreId()
476
  );
477
  $result['general']['xmlconnectVersion'] = Mage::getConfig()->getNode(self::XML_PATH_MODULE_VERSION);
478
 
@@ -564,10 +561,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
564
  */
565
  public function getSecureBaseUrl()
566
  {
567
- return Mage::getStoreConfig(
568
- self::XML_PATH_SECURE_BASE_LINK_URL,
569
- $this->getStoreId()
570
- );
571
  }
572
 
573
  /**
@@ -577,9 +571,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
577
  */
578
  public function getUseSecureURLInFrontend()
579
  {
580
- return (int) Mage::getStoreConfigFlag(
581
- Mage_Core_Model_Store::XML_PATH_SECURE_IN_FRONTEND
582
- );
583
  }
584
 
585
  /**
@@ -633,9 +625,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
633
  if (!empty($value)) {
634
  if (is_array($value)) {
635
  $subtree[$key] = $this->_absPath($value);
636
- } elseif (strtolower(substr($key, -4)) == 'icon'
637
- || strtolower(substr($key, -5)) == 'image'
638
- ) {
639
  $subtree[$key] = Mage::getBaseUrl('media') . 'xmlconnect/' . $value;
640
  }
641
  }
@@ -673,9 +663,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
673
  */
674
  protected function _beforeSave()
675
  {
676
- $this->setUpdatedAt(
677
- Mage::getSingleton('core/date')->gmtDate()
678
- );
679
  return $this;
680
  }
681
 
@@ -701,9 +689,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
701
  {
702
  $configuration = $this->getData('config_data');
703
  if (is_array($configuration)) {
704
- $this->getConfigModel()
705
- ->setConfigData($this->getId(), $configuration)
706
- ->initSaveConfig();
707
  }
708
  return $this;
709
  }
@@ -719,9 +705,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
719
  $deprecatedConfig = $this->getData('conf');
720
  if (is_array($deprecatedConfig)) {
721
  $this->getConfigModel()->saveConfig(
722
- $this->getId(),
723
- $this->convertOldConfing($deprecatedConfig),
724
- self::DEPRECATED_CONFIG_FLAG
725
  );
726
  }
727
  return $this;
@@ -758,8 +742,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
758
  {
759
  if (!$this->_isConfigurationLoaded) {
760
  if ($this->getId()) {
761
- $this->_loadDeprecatedConfig()
762
- ->_loadConfigData();
763
  $this->_isConfigurationLoaded = true;
764
  }
765
  }
@@ -774,15 +757,11 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
774
  */
775
  protected function _loadConfigData()
776
  {
777
- $configuration = $this->getConfigModel()
778
- ->getCollection()
779
- ->addArrayFilter(
780
- array(
781
- 'application_id' => $this->getId(),
782
- 'category' => 'payment'
783
- )
784
- )
785
- ->toOptionArray();
786
  $this->setData('config_data', $configuration);
787
  return $this;
788
  }
@@ -796,15 +775,10 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
796
  private function _loadDeprecatedConfig()
797
  {
798
  $configuration = $this->_convertConfig(
799
- $this->getConfigModel()
800
- ->getCollection()
801
- ->addArrayFilter(
802
- array(
803
- 'application_id' => $this->getId(),
804
- 'category' => self::DEPRECATED_CONFIG_FLAG
805
- )
806
- )
807
- ->toOptionArray()
808
  );
809
  $this->setData('conf', $configuration);
810
  return $this;
@@ -867,9 +841,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
867
  $conf['submit_restore'] = array();
868
  }
869
  foreach ($params as $id => $value) {
870
- $deviceImages = Mage::helper('xmlconnect')
871
- ->getDeviceHelper()
872
- ->getSubmitImages();
873
 
874
  if (!in_array($id, $deviceImages)) {
875
  $conf['submit_text'][$id] = $value;
@@ -1047,9 +1019,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
1047
  $params['code'] = $this->getCode();
1048
  $params['type'] = $this->getType();
1049
  $params['url'] = Mage::getUrl('xmlconnect/configuration/index', array(
1050
- '_store' => $this->getStoreId(),
1051
- '_nosid' => true,
1052
- 'app_code' => $this->getCode()
1053
  ));
1054
 
1055
  $params['magentoversion'] = Mage::getVersion();
@@ -1079,9 +1049,7 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
1079
  $submitRestore = $this->_data['conf']['submit_restore'];
1080
  }
1081
 
1082
- $deviceImages = Mage::helper('xmlconnect')
1083
- ->getDeviceHelper()
1084
- ->getSubmitImages();
1085
 
1086
  foreach ($deviceImages as $id) {
1087
  if (isset($submit[$id])) {
27
  /**
28
  * Xmlconnect Application model
29
  *
30
+ * @method Mage_XmlConnect_Model_Resource_Application _getResource()
31
+ * @method Mage_XmlConnect_Model_Resource_Application getResource()
32
  * @method string getName()
33
  * @method Mage_XmlConnect_Model_Application setName(string $value)
34
  * @method string getCode()
257
  /**
258
  * Initialize application
259
  *
260
+ * @return null
261
  */
262
  protected function _construct()
263
  {
264
  $this->_init('xmlconnect/application');
265
  $this->_configModel = Mage::getModel('xmlconnect/configData');
266
+ $this->_configModel->setDeleteOnUpdate($this->getDeleteOnUpdateConfig());
 
 
267
  }
268
 
269
  /**
343
  /**
344
  * Set default configuration data
345
  *
346
+ * @return null
347
  */
348
  public function loadDefaultConfiguration()
349
  {
469
  ->getStore($this->getStoreId())->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE);
470
  $result['general']['magentoVersion'] = Mage::getVersion();
471
  $result['general']['copyright'] = Mage::getStoreConfig(
472
+ self::XML_PATH_DESIGN_FOOTER_COPYRIGHT, $this->getStoreId()
 
473
  );
474
  $result['general']['xmlconnectVersion'] = Mage::getConfig()->getNode(self::XML_PATH_MODULE_VERSION);
475
 
561
  */
562
  public function getSecureBaseUrl()
563
  {
564
+ return Mage::getStoreConfig(self::XML_PATH_SECURE_BASE_LINK_URL, $this->getStoreId());
 
 
 
565
  }
566
 
567
  /**
571
  */
572
  public function getUseSecureURLInFrontend()
573
  {
574
+ return (int) Mage::getStoreConfigFlag(Mage_Core_Model_Store::XML_PATH_SECURE_IN_FRONTEND);
 
 
575
  }
576
 
577
  /**
625
  if (!empty($value)) {
626
  if (is_array($value)) {
627
  $subtree[$key] = $this->_absPath($value);
628
+ } elseif (strtolower(substr($key, -4)) == 'icon' || strtolower(substr($key, -5)) == 'image') {
 
 
629
  $subtree[$key] = Mage::getBaseUrl('media') . 'xmlconnect/' . $value;
630
  }
631
  }
663
  */
664
  protected function _beforeSave()
665
  {
666
+ $this->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
 
 
667
  return $this;
668
  }
669
 
689
  {
690
  $configuration = $this->getData('config_data');
691
  if (is_array($configuration)) {
692
+ $this->getConfigModel()->setConfigData($this->getId(), $configuration)->initSaveConfig();
 
 
693
  }
694
  return $this;
695
  }
705
  $deprecatedConfig = $this->getData('conf');
706
  if (is_array($deprecatedConfig)) {
707
  $this->getConfigModel()->saveConfig(
708
+ $this->getId(), $this->convertOldConfing($deprecatedConfig), self::DEPRECATED_CONFIG_FLAG
 
 
709
  );
710
  }
711
  return $this;
742
  {
743
  if (!$this->_isConfigurationLoaded) {
744
  if ($this->getId()) {
745
+ $this->_loadDeprecatedConfig()->_loadConfigData();
 
746
  $this->_isConfigurationLoaded = true;
747
  }
748
  }
757
  */
758
  protected function _loadConfigData()
759
  {
760
+ $configuration = $this->getConfigModel()->getCollection()->addArrayFilter(array(
761
+ 'application_id' => $this->getId(),
762
+ 'category' => 'payment'
763
+ ))->toOptionArray();
764
+
 
 
 
 
765
  $this->setData('config_data', $configuration);
766
  return $this;
767
  }
775
  private function _loadDeprecatedConfig()
776
  {
777
  $configuration = $this->_convertConfig(
778
+ $this->getConfigModel()->getCollection()->addArrayFilter(array(
779
+ 'application_id' => $this->getId(),
780
+ 'category' => self::DEPRECATED_CONFIG_FLAG
781
+ ))->toOptionArray()
 
 
 
 
 
782
  );
783
  $this->setData('conf', $configuration);
784
  return $this;
841
  $conf['submit_restore'] = array();
842
  }
843
  foreach ($params as $id => $value) {
844
+ $deviceImages = Mage::helper('xmlconnect')->getDeviceHelper()->getSubmitImages();
 
 
845
 
846
  if (!in_array($id, $deviceImages)) {
847
  $conf['submit_text'][$id] = $value;
1019
  $params['code'] = $this->getCode();
1020
  $params['type'] = $this->getType();
1021
  $params['url'] = Mage::getUrl('xmlconnect/configuration/index', array(
1022
+ '_store' => $this->getStoreId(), '_nosid' => true, 'app_code' => $this->getCode()
 
 
1023
  ));
1024
 
1025
  $params['magentoversion'] = Mage::getVersion();
1049
  $submitRestore = $this->_data['conf']['submit_restore'];
1050
  }
1051
 
1052
+ $deviceImages = Mage::helper('xmlconnect')->getDeviceHelper()->getSubmitImages();
 
 
1053
 
1054
  foreach ($deviceImages as $id) {
1055
  if (isset($submit[$id])) {
app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php CHANGED
@@ -59,9 +59,7 @@ class Mage_XmlConnect_Model_Catalog_Category_Image extends Mage_Catalog_Model_Pr
59
  if (!$file) {
60
  // check if placeholder defined in config
61
  $isConfigPlaceholder = Mage::getStoreConfig(
62
- 'catalog/placeholder/'
63
- . $this->getDestinationSubdir()
64
- . '_placeholder'
65
  );
66
  $configPlaceholder = '/placeholder/' . $isConfigPlaceholder;
67
  if ($isConfigPlaceholder && file_exists($baseDir . $configPlaceholder)) {
@@ -69,21 +67,17 @@ class Mage_XmlConnect_Model_Catalog_Category_Image extends Mage_Catalog_Model_Pr
69
  } else {
70
  // replace file with skin or default skin placeholder
71
  $skinBaseDir = Mage::getDesign()->getSkinBaseDir();
72
- $skinPlaceholder = '/images/xmlconnect/catalog/category/placeholder/'
73
- . $this->getDestinationSubdir()
74
  . '.jpg';
75
 
76
  $file = $skinPlaceholder;
77
  if (file_exists($skinBaseDir . $file)) {
78
  $baseDir = $skinBaseDir;
79
  } else {
80
- $baseDir = Mage::getDesign()->getSkinBaseDir(
81
- array('_theme' => 'default')
82
- );
83
  if (!file_exists($baseDir . $file)) {
84
- $baseDir = Mage::getDesign()->getSkinBaseDir(
85
- array('_theme' => 'default', '_package' => 'base')
86
- );
87
  }
88
  }
89
  }
@@ -93,33 +87,24 @@ class Mage_XmlConnect_Model_Catalog_Category_Image extends Mage_Catalog_Model_Pr
93
  $baseFile = $baseDir . $file;
94
 
95
  if ((!$file) || (!file_exists($baseFile))) {
96
- Mage::throwException(
97
- Mage::helper('xmlconnect')->__('Image file was not found.')
98
- );
99
  }
100
 
101
  $this->_baseFile = $baseFile;
102
 
103
  // build new filename (most important params)
104
- $path = array(
105
- Mage::getSingleton('xmlconnect/catalog_category_media_config')->getBaseMediaPath(),
106
- 'cache',
107
- Mage::app()->getStore()->getId(),
108
- $path[] = $this->getDestinationSubdir()
109
  );
110
  if ((!empty($this->_width)) || (!empty($this->_height))) {
111
  $path[] = "{$this->_width}x{$this->_height}";
112
  }
113
 
114
  // add misk params as a hash
115
- $miscParams = array(
116
- ($this->_keepAspectRatio ? '' : 'non') . 'proportional',
117
- ($this->_keepFrame ? '' : 'no') . 'frame',
118
- ($this->_keepTransparency ? '' : 'no') . 'transparency',
119
- ($this->_constrainOnly ? 'do' : 'not') . 'constrainonly',
120
- $this->_rgbToString($this->_backgroundColor),
121
- 'angle' . $this->_angle,
122
- 'quality' . $this->_quality
123
  );
124
 
125
  // if has watermark add watermark params to hash
@@ -176,7 +161,7 @@ class Mage_XmlConnect_Model_Catalog_Category_Image extends Mage_Catalog_Model_Pr
176
  /**
177
  * Clear catalog cache
178
  *
179
- * @return void
180
  */
181
  public function clearCache()
182
  {
59
  if (!$file) {
60
  // check if placeholder defined in config
61
  $isConfigPlaceholder = Mage::getStoreConfig(
62
+ 'catalog/placeholder/' . $this->getDestinationSubdir() . '_placeholder'
 
 
63
  );
64
  $configPlaceholder = '/placeholder/' . $isConfigPlaceholder;
65
  if ($isConfigPlaceholder && file_exists($baseDir . $configPlaceholder)) {
67
  } else {
68
  // replace file with skin or default skin placeholder
69
  $skinBaseDir = Mage::getDesign()->getSkinBaseDir();
70
+ $skinPlaceholder = '/images/xmlconnect/catalog/category/placeholder/' . $this->getDestinationSubdir()
 
71
  . '.jpg';
72
 
73
  $file = $skinPlaceholder;
74
  if (file_exists($skinBaseDir . $file)) {
75
  $baseDir = $skinBaseDir;
76
  } else {
77
+ $baseDir = Mage::getDesign()->getSkinBaseDir(array('_theme' => 'default'));
 
 
78
  if (!file_exists($baseDir . $file)) {
79
+ $baseDir = Mage::getDesign()
80
+ ->getSkinBaseDir(array('_theme' => 'default', '_package' => 'base'));
 
81
  }
82
  }
83
  }
87
  $baseFile = $baseDir . $file;
88
 
89
  if ((!$file) || (!file_exists($baseFile))) {
90
+ Mage::throwException(Mage::helper('xmlconnect')->__('Image file was not found.'));
 
 
91
  }
92
 
93
  $this->_baseFile = $baseFile;
94
 
95
  // build new filename (most important params)
96
+ $path = array(Mage::getSingleton('xmlconnect/catalog_category_media_config')->getBaseMediaPath(), 'cache',
97
+ Mage::app()->getStore()->getId(), $path[] = $this->getDestinationSubdir()
 
 
 
98
  );
99
  if ((!empty($this->_width)) || (!empty($this->_height))) {
100
  $path[] = "{$this->_width}x{$this->_height}";
101
  }
102
 
103
  // add misk params as a hash
104
+ $miscParams = array(($this->_keepAspectRatio ? '' : 'non') . 'proportional',
105
+ ($this->_keepFrame ? '' : 'no') . 'frame', ($this->_keepTransparency ? '' : 'no') . 'transparency',
106
+ ($this->_constrainOnly ? 'do' : 'not') . 'constrainonly', $this->_rgbToString($this->_backgroundColor),
107
+ 'angle' . $this->_angle, 'quality' . $this->_quality
 
 
 
 
108
  );
109
 
110
  // if has watermark add watermark params to hash
161
  /**
162
  * Clear catalog cache
163
  *
164
+ * @return null
165
  */
166
  public function clearCache()
167
  {
app/code/core/Mage/XmlConnect/Model/ConfigData.php CHANGED
@@ -60,7 +60,7 @@ class Mage_XmlConnect_Model_ConfigData extends Mage_Core_Model_Abstract
60
  /**
61
  * Initialize configuration data
62
  *
63
- * @return void
64
  */
65
  protected function _construct()
66
  {
@@ -154,11 +154,7 @@ class Mage_XmlConnect_Model_ConfigData extends Mage_Core_Model_Abstract
154
  $applicationId = str_ireplace(self::CONFIG_PREFIX, '', $application);
155
  $this->_deleteOnUpdate($applicationId);
156
  foreach ($data as $category => $config) {
157
- $this->saveConfig(
158
- $applicationId,
159
- $config,
160
- $category
161
- );
162
  }
163
  }
164
  return $this;
@@ -176,9 +172,7 @@ class Mage_XmlConnect_Model_ConfigData extends Mage_Core_Model_Abstract
176
  {
177
  foreach ($configData as $path => $value) {
178
  if (!is_scalar($value)) {
179
- Mage::throwException(
180
- Mage::helper('xmlconnect')->__('Unsupported value type received')
181
- );
182
  }
183
  $this->getResource()->saveConfig($applicationId, $category, $path, $value);
184
  }
60
  /**
61
  * Initialize configuration data
62
  *
63
+ * @return null
64
  */
65
  protected function _construct()
66
  {
154
  $applicationId = str_ireplace(self::CONFIG_PREFIX, '', $application);
155
  $this->_deleteOnUpdate($applicationId);
156
  foreach ($data as $category => $config) {
157
+ $this->saveConfig($applicationId, $config, $category);
 
 
 
 
158
  }
159
  }
160
  return $this;
172
  {
173
  foreach ($configData as $path => $value) {
174
  if (!is_scalar($value)) {
175
+ Mage::throwException(Mage::helper('xmlconnect')->__('Unsupported value type received'));
 
 
176
  }
177
  $this->getResource()->saveConfig($applicationId, $category, $path, $value);
178
  }
app/code/core/Mage/XmlConnect/Model/History.php CHANGED
@@ -27,8 +27,8 @@
27
  /**
28
  * Xmlconnect history model
29
  *
30
- * @method Mage_XmlConnect_Model_Mysql4_History _getResource()
31
- * @method Mage_XmlConnect_Model_Mysql4_History getResource()
32
  * @method int getApplicationId()
33
  * @method Mage_XmlConnect_Model_History setApplicationId(int $value)
34
  * @method string getCreatedAt()
@@ -45,7 +45,7 @@
45
  * @method Mage_XmlConnect_Model_History setCode(string $value)
46
  *
47
  * @category Mage
48
- * @package Mage_Xmlconnect
49
  * @author Magento Core Team <core@magentocommerce.com>
50
  */
51
  class Mage_XmlConnect_Model_History extends Mage_Core_Model_Abstract
@@ -53,7 +53,7 @@ class Mage_XmlConnect_Model_History extends Mage_Core_Model_Abstract
53
  /**
54
  * Initialize application
55
  *
56
- * @return void
57
  */
58
  protected function _construct()
59
  {
27
  /**
28
  * Xmlconnect history model
29
  *
30
+ * @method Mage_XmlConnect_Model_Resource_History _getResource()
31
+ * @method Mage_XmlConnect_Model_Resource_History getResource()
32
  * @method int getApplicationId()
33
  * @method Mage_XmlConnect_Model_History setApplicationId(int $value)
34
  * @method string getCreatedAt()
45
  * @method Mage_XmlConnect_Model_History setCode(string $value)
46
  *
47
  * @category Mage
48
+ * @package Mage_XmlConnect
49
  * @author Magento Core Team <core@magentocommerce.com>
50
  */
51
  class Mage_XmlConnect_Model_History extends Mage_Core_Model_Abstract
53
  /**
54
  * Initialize application
55
  *
56
+ * @return null
57
  */
58
  protected function _construct()
59
  {
app/code/core/Mage/XmlConnect/Model/Input/Filter/MaliciousCode.php DELETED
@@ -1,100 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category Mage
22
- * @package Mage_XmlConnect
23
- * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
-
27
- /**
28
- * Filter for removing malicious code from HTML
29
- *
30
- * Current class is a copy of Mage_Core_Model_Input_Filter_MaliciousCode
31
- * and added for back compatibility with older versions of Magento
32
- * due to the fact that we use these code for packages in Magento Connect
33
- *
34
- * @category Mage
35
- * @package Mage_XmlConnect
36
- * @author Magento Core Team <core@magentocommerce.com>
37
- */
38
- class Mage_XmlConnect_Model_Input_Filter_MaliciousCode implements Zend_Filter_Interface
39
- {
40
- /**
41
- * Regular expressions for cutting malicious code
42
- *
43
- * @var array
44
- */
45
- protected $_expressions = array(
46
- //comments, must be first
47
- '/(\/\*.*\*\/)/Us',
48
- //tabs
49
- '/(\t)/',
50
- //javasript prefix
51
- '/(javascript\s*:)/Usi',
52
- //import styles
53
- '/(@import)/Usi',
54
- //js in the style attribute
55
- '/style=[^<]*((expression\s*?\([^<]*?\))|(behavior\s*:))[^<]*(?=\>)/Uis',
56
- //js attributes
57
- '/(ondblclick|onclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onload|onunload|onerror)=[^<]*(?=\>)/Uis',
58
- //tags
59
- '/<\/?(script|meta|link|frame|iframe).*>/Uis',
60
- //base64 usage
61
- '/src=[^<]*base64[^<]*(?=\>)/Uis',
62
- );
63
-
64
- /**
65
- * Filter value
66
- *
67
- * @param string|array $value
68
- * @return string|array Filtered value
69
- */
70
- public function filter($value)
71
- {
72
- return preg_replace($this->_expressions, '', $value);
73
- }
74
-
75
- /**
76
- * Add expression
77
- *
78
- * @param string $expression
79
- * @return Mage_Core_Model_Input_Filter_MaliciousCode
80
- */
81
- public function addExpression($expression)
82
- {
83
- if (!in_array($expression, $this->_expressions)) {
84
- $this->_expressions[] = $expression;
85
- }
86
- return $this;
87
- }
88
-
89
- /**
90
- * Set expressions
91
- *
92
- * @param array $expressions
93
- * @return Mage_Core_Model_Input_Filter_MaliciousCode
94
- */
95
- public function setExpressions(array $expressions)
96
- {
97
- $this->_expressions = $expressions;
98
- return $this;
99
- }
100
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php CHANGED
@@ -25,104 +25,12 @@
25
  */
26
 
27
  /**
28
- * Application recourse model
29
  *
30
  * @category Mage
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Model_Mysql4_Application extends Mage_Core_Model_Mysql4_Abstract
35
  {
36
- /**
37
- * Constructor, setting table and index field
38
- *
39
- * @return void
40
- */
41
- protected function _construct()
42
- {
43
- $this->_init('xmlconnect/application', 'application_id');
44
- }
45
-
46
- /**
47
- * Update Application Status field, insert data to history table
48
- *
49
- * @param int $applicationId
50
- * @param string $status
51
- * @return Mage_XmlConnect_Model_Mysql4_Application
52
- */
53
- public function updateApplicationStatus($applicationId, $status)
54
- {
55
- $this->_getWriteAdapter()->update(
56
- $this->getMainTable(),
57
- array('status' => $status),
58
- $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $applicationId)
59
- );
60
- return $this;
61
- }
62
-
63
- /**
64
- * Processing object before save data
65
- * Update app_code as Store + Device
66
- *
67
- * @param Mage_Core_Model_Abstract $object
68
- * @return Mage_Core_Model_Abstract
69
- */
70
- protected function _beforeSave(Mage_Core_Model_Abstract $object)
71
- {
72
- if (!$object->getId()) {
73
- $object->setCode($object->getCodePrefix());
74
- }
75
- return parent::_beforeSave($object);
76
- }
77
-
78
- /**
79
- * Processing object after save data
80
- * Update app_code as Store + Device + 123 (increment).
81
- *
82
- * @param Mage_Core_Model_Abstract $object
83
- * @return Mage_Core_Model_Abstract
84
- */
85
- protected function _afterSave(Mage_Core_Model_Abstract $object)
86
- {
87
- $appCode = $object->getCode();
88
- $isCodePrefixed = $object->isCodePrefixed();
89
- if (!$isCodePrefixed) {
90
- $this->_getWriteAdapter()->update(
91
- $this->getMainTable(),
92
- array('code' => $appCode . $object->getId()),
93
- $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $object->getId())
94
- );
95
- }
96
- return parent::_afterSave($object);
97
- }
98
-
99
- /**
100
- * Collect existing stores and type unique pairs
101
- *
102
- * @return array
103
- */
104
- public function getExistingStoreDeviceType()
105
- {
106
- $select = $this->_getWriteAdapter()->select()
107
- ->from($this->getMainTable(), array('store_id', 'type'))
108
- ->group(array('store_id', 'type'))
109
- ->order(array('store_id', 'type'));
110
- return $this->_getReadAdapter()->fetchAll($select, array('store_id', 'type'));
111
- }
112
-
113
- /**
114
- * Update all applications "updated at" parameter with current date
115
- *
116
- * @return Mage_XmlConnect_Model_Mysql4_Application
117
- */
118
- public function updateAllAppsUpdatedAtParameter()
119
- {
120
- $this->_getWriteAdapter()->update(
121
- $this->getMainTable(),
122
- array(
123
- 'updated_at' => date('Y-m-d H:i:s')
124
- )
125
- );
126
- return $this;
127
- }
128
  }
25
  */
26
 
27
  /**
28
+ * XmlConnect Model Resource Application
29
  *
30
  * @category Mage
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Model_Mysql4_Application extends Mage_XmlConnect_Model_Resource_Application
35
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php CHANGED
@@ -23,15 +23,14 @@
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Mage_XmlConnect_Model_Mysql4_Application_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
 
 
 
 
 
 
 
 
27
  {
28
- /**
29
- * Constructor, setting table
30
- *
31
- * @return void
32
- */
33
- protected function _construct()
34
- {
35
- $this->_init('xmlconnect/application');
36
- }
37
  }
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+
27
+ /**
28
+ * XmlConnect Model Resource Application Collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Mysql4_Application_Collection extends Mage_XmlConnect_Model_Resource_Application_Collection
35
  {
 
 
 
 
 
 
 
 
 
36
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/Cms/Page/Collection.php CHANGED
@@ -27,37 +27,10 @@
27
  /**
28
  * Extended CMS page collection
29
  *
30
- * @category Mage
31
- * @package Mage_XmlConnect
32
- * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
-
35
- class Mage_XmlConnect_Model_Mysql4_Cms_Page_Collection extends Mage_Cms_Model_Mysql4_Page_Collection
36
  {
37
- /**
38
- * Returns pairs identifier - title for unique identifiers
39
- * and pairs identifier|page_id - title for non-unique after first
40
- *
41
- * @return array
42
- */
43
- public function toOptionIdArray()
44
- {
45
- $res = array();
46
- $existingIdentifiers = array();
47
- foreach ($this as $item) {
48
- $identifier = $item->getData('identifier');
49
-
50
- $data['value'] = $identifier;
51
- $data['label'] = $item->getData('title');
52
- if (in_array($identifier, $existingIdentifiers)) {
53
- $data['value'] .= '|' . $item->getData('page_id');
54
- } else {
55
- $existingIdentifiers[] = $identifier;
56
- }
57
-
58
- $res[] = $data;
59
- }
60
-
61
- return $res;
62
- }
63
  }
27
  /**
28
  * Extended CMS page collection
29
  *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Model_Mysql4_Cms_Page_Collection extends Mage_XmlConnect_Model_Resource_Cms_Page_Collection
 
35
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData.php CHANGED
@@ -31,77 +31,6 @@
31
  * @package Mage_Xmlconnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Model_Mysql4_ConfigData extends Mage_Core_Model_Mysql4_Abstract
35
  {
36
- /**
37
- * Initialize configuration data
38
- *
39
- * @return void
40
- */
41
- protected function _construct()
42
- {
43
- $this->_init('xmlconnect/configData', null);
44
- }
45
-
46
- /**
47
- * Save config value
48
- *
49
- * @param int $applicationId
50
- * @param string $category
51
- * @param string $path
52
- * @param string $value
53
- * @return Mage_XmlConnect_Model_Mysql4_ConfigData
54
- */
55
- public function saveConfig($applicationId, $category, $path, $value)
56
- {
57
- $newData = array(
58
- 'application_id' => $applicationId,
59
- 'category' => $category,
60
- 'path' => $path,
61
- 'value' => $value
62
- );
63
-
64
- $this->_getWriteAdapter()->insertOnDuplicate(
65
- $this->getMainTable(),
66
- $newData,
67
- array('value')
68
- );
69
- return $this;
70
- }
71
-
72
- /**
73
- * Delete config value
74
- *
75
- * @param int $applicationId
76
- * @param bool $category
77
- * @param bool $path
78
- * @param bool $pathLike
79
- * @return Mage_XmlConnect_Model_Mysql4_ConfigData
80
- */
81
- public function deleteConfig($applicationId, $category = false, $path = false, $pathLike = true)
82
- {
83
- try {
84
- $this->_getWriteAdapter()->beginTransaction();
85
- $writeAdapter = $this->_getWriteAdapter();
86
- $deleteWhere[] = $writeAdapter->quoteInto('application_id=?', $applicationId);
87
- if ($category) {
88
- $deleteWhere[] = $writeAdapter->quoteInto('category=?', $category);
89
- }
90
- if ($path) {
91
- $deleteWhere[] = $pathLike
92
- ? $writeAdapter->quoteInto('path like ?', $path . '/%')
93
- : $writeAdapter->quoteInto('path=?', $path);
94
- }
95
- $writeAdapter->delete($this->getMainTable(), $deleteWhere);
96
- $this->_getWriteAdapter()->commit();
97
- } catch (Mage_Core_Exception $e) {
98
- $this->_getWriteAdapter()->rollBack();
99
- throw $e;
100
- } catch (Exception $e){
101
- $this->_getWriteAdapter()->rollBack();
102
- Mage::logException($e);
103
- }
104
-
105
- return $this;
106
- }
107
  }
31
  * @package Mage_Xmlconnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Model_Mysql4_ConfigData extends Mage_XmlConnect_Model_Resource_ConfigData
35
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/ConfigData/Collection.php CHANGED
@@ -32,146 +32,6 @@
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
  class Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
35
- extends Mage_Core_Model_Mysql4_Collection_Abstract
36
  {
37
- /**
38
- * Is application filter applied
39
- *
40
- * @var bool
41
- */
42
- protected $_applicationFilter = false;
43
-
44
- /**
45
- * Internal constructor
46
- */
47
- protected function _construct()
48
- {
49
- $this->_init('xmlconnect/configData');
50
- }
51
-
52
- /**
53
- * Add application filter
54
- *
55
- * @param $applicationId
56
- * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
57
- */
58
- public function addApplicationIdFilter($applicationId)
59
- {
60
- $this->_applicationFilter = true;
61
- $this->getSelect()
62
- ->where('application_id=?', $applicationId);
63
- return $this;
64
- }
65
-
66
- /**
67
- * Add path filter
68
- *
69
- * @param $path
70
- * @param bool $like
71
- * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
72
- */
73
- public function addPathFilter($path, $like = true)
74
- {
75
- if ($like) {
76
- $this->getSelect()
77
- ->where('path like ?', $path . '/%');
78
- } else {
79
- $this->getSelect()
80
- ->where('path=?', $path);
81
- }
82
- return $this;
83
- }
84
-
85
- /**
86
- * Add category filter
87
- *
88
- * @param $category
89
- * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
90
- */
91
- public function addCategoryFilter($category)
92
- {
93
- $this->getSelect()->where('category=?', $category);
94
- return $this;
95
- }
96
-
97
- /**
98
- * Add value filter
99
- *
100
- * @param $value
101
- * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
102
- */
103
- public function addValueFilter($value)
104
- {
105
- $this->getSelect()->where('value=?', $value);
106
- return $this;
107
- }
108
-
109
- /**
110
- * Add filter by array
111
- *
112
- * @param array $array
113
- * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
114
- */
115
- public function addArrayFilter(array $array)
116
- {
117
- foreach ($array as $key => $val) {
118
- $method = 'add' . uc_words($key, '') . 'Filter';
119
- if (is_callable($this->$method($val))) {
120
- return $this->$method($val);
121
- }
122
- }
123
- return $this;
124
- }
125
-
126
- /**
127
- * Convert items array to array for select options
128
- *
129
- * return items array
130
- * array(
131
- * application_id => array(
132
- * category => array(
133
- * path
134
- * )
135
- * )
136
- * )
137
- *
138
- * @return array
139
- */
140
- public function toOptionArray()
141
- {
142
- $result = array();
143
- foreach ($this as $item) {
144
- $appId = $item->getData('application_id');
145
- $category = $item->getData('category');
146
- $path = $item->getData('path');
147
- $value = $item->getData('value');
148
-
149
- if ($this->_applicationFilter) {
150
- $result[$category][$path] = $value;
151
- } else {
152
- $result[$appId][$category][$path] = $value;
153
- }
154
- }
155
- return $result;
156
- }
157
-
158
- /**
159
- * Get Application filter status
160
- *
161
- * @return boolean
162
- */
163
- public function getApplicationFilter()
164
- {
165
- return $this->_applicationFilter;
166
- }
167
-
168
- /**
169
- * Set Application filter status
170
- *
171
- * @param boolean $applicationFilter
172
- */
173
- public function setApplicationFilter($applicationFilter)
174
- {
175
- $this->_applicationFilter = $applicationFilter;
176
- }
177
  }
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
  class Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
35
+ extends Mage_XmlConnect_Model_Resource_ConfigData_Collection
36
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/Filter/Collection.php CHANGED
@@ -28,74 +28,9 @@
28
  * Filter collection
29
  *
30
  * @category Mage
31
- * @package Mage_Xmlconnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Model_Mysql4_Filter_Collection extends Varien_Data_Collection
35
  {
36
- /**
37
- * Set CategoryId filter
38
- *
39
- * @param int $categoryId
40
- * @return Mage_XmlConnect_Model_Mysql4_Filter_Collection
41
- */
42
- public function setCategoryId($categoryId)
43
- {
44
- if ((int)$categoryId > 0) {
45
- $this->addFilter('category_id', $categoryId);
46
- }
47
- return $this;
48
- }
49
-
50
- /**
51
- * Load data
52
- *
53
- * @param bool $printQuery
54
- * @param bool $logQuery
55
- * @return Mage_XmlConnect_Model_Mysql4_Filter_Collection
56
- */
57
- public function load($printQuery = false, $logQuery = false)
58
- {
59
- if (empty($this->_items)) {
60
- $layer = Mage::getSingleton('catalog/layer');
61
- foreach ($this->_filters as $filter) {
62
- if ('category_id' == $filter['field']) {
63
- $layer->setCurrentCategory((int)$filter['value']);
64
- }
65
- }
66
- if ($layer->getCurrentCategory()->getIsAnchor()) {
67
- foreach ($layer->getFilterableAttributes() as $attributeItem) {
68
- $filterModelName = 'catalog/layer_filter_attribute';
69
- switch ($attributeItem->getAttributeCode()) {
70
- case 'price':
71
- $filterModelName = 'catalog/layer_filter_price';
72
- break;
73
- case 'decimal':
74
- $filterModelName = 'catalog/layer_filter_decimal';
75
- break;
76
- default:
77
- $filterModelName = 'catalog/layer_filter_attribute';
78
- break;
79
- }
80
-
81
- $filterModel = Mage::getModel($filterModelName);
82
- $filterModel->setLayer($layer)->setAttributeModel($attributeItem);
83
- $filterValues = new Varien_Data_Collection;
84
- foreach ($filterModel->getItems() as $valueItem) {
85
- $valueObject = new Varien_Object();
86
- $valueObject->setLabel($valueItem->getLabel());
87
- $valueObject->setValueString($valueItem->getValueString());
88
- $valueObject->setProductsCount($valueItem->getCount());
89
- $filterValues->addItem($valueObject);
90
- }
91
- $item = new Varien_Object;
92
- $item->setCode($attributeItem->getAttributeCode());
93
- $item->setName($filterModel->getName());
94
- $item->setValues($filterValues);
95
- $this->addItem($item);
96
- }
97
- }
98
- }
99
- return $this;
100
- }
101
  }
28
  * Filter collection
29
  *
30
  * @category Mage
31
+ * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Model_Mysql4_Filter_Collection extends Mage_XmlConnect_Model_Resource_Filter_Collection
35
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/History.php CHANGED
@@ -23,62 +23,14 @@
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Mage_XmlConnect_Model_Mysql4_History extends Mage_Core_Model_Mysql4_Abstract
27
- {
28
- /**
29
- * Constructor, setting table and index field
30
- *
31
- * @return void
32
- */
33
- protected function _construct()
34
- {
35
- $this->_init('xmlconnect/history', 'history_id');
36
- }
37
-
38
- /**
39
- * Serialization for 'params' variable
40
- *
41
- * @param Mage_Core_Model_Abstract $object
42
- * @return Mage_Core_Model_Abstract
43
- */
44
- protected function _beforeSave(Mage_Core_Model_Abstract $object)
45
- {
46
- $object->setParams(serialize($object->getParams()));
47
- return parent::_beforeSave($object);
48
- }
49
-
50
- /**
51
- * Deserialization for 'params' variable
52
- *
53
- * @param Mage_Core_Model_Abstract $object
54
- * @return Mage_Core_Model_Abstract
55
- */
56
- protected function _afterLoad(Mage_Core_Model_Abstract $object)
57
- {
58
- $object->setParams(unserialize($object->getParams()));
59
- return parent::_afterLoad($object);
60
- }
61
 
62
- /**
63
- * Returns array of existing images
64
- *
65
- * @param int $id - application instance Id
66
- * @return array
67
- */
68
- public function getLastParams($id)
69
- {
70
- $paramArray = array();
71
- $idFieldName = Mage::getModel('xmlconnect/application')->getIdFieldName();
72
- $select = $this->_getReadAdapter()->select()
73
- ->from($this->getMainTable(), 'params')
74
- ->where($idFieldName . '=?', $id)
75
- ->order(array('created_at DESC'));
76
-
77
- $params = $this->_getReadAdapter()->fetchOne($select);
78
-
79
- if (isset($params)) {
80
- $paramArray = unserialize($params);
81
- }
82
- return $paramArray;
83
- }
84
  }
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
+ /**
28
+ * XmlConnect Model Resource History
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Mysql4_History extends Mage_XmlConnect_Model_Resource_History
35
+ {
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php CHANGED
@@ -24,46 +24,14 @@
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
 
27
-
28
  /**
29
  * History resource collection
30
  *
31
- * @category Mage
32
- * @package Mage_XmlConnect
33
- * @author Magento Core Team <core@magentocommerce.com>
34
  */
35
  class Mage_XmlConnect_Model_Mysql4_History_Collection
36
- extends Mage_Core_Model_Mysql4_Collection_Abstract
37
  {
38
- /**
39
- * Internal constructor
40
- */
41
- protected function _construct()
42
- {
43
- $this->_init('xmlconnect/history');
44
- }
45
-
46
- /**
47
- * Filter collection by store
48
- *
49
- * @param int $storeId
50
- * @return Mage_Core_Model_Mysql4_Collection_Abstract
51
- */
52
- public function addStoreFilter($storeId)
53
- {
54
- $this->addFieldToFilter('store_id', $storeId);
55
- return $this;
56
- }
57
-
58
- /**
59
- * Filter collection by application_id
60
- *
61
- * @param int $applicationId
62
- * @return Mage_Core_Model_Mysql4_Collection_Abstract
63
- */
64
- public function addApplicationFilter($applicationId)
65
- {
66
- $this->addFieldToFilter('application_id', $applicationId);
67
- return $this;
68
- }
69
  }
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
 
 
27
  /**
28
  * History resource collection
29
  *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
  class Mage_XmlConnect_Model_Mysql4_History_Collection
35
+ extends Mage_XmlConnect_Model_Resource_History_Collection
36
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/Queue.php CHANGED
@@ -23,15 +23,14 @@
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Mage_XmlConnect_Model_Mysql4_Queue extends Mage_Core_Model_Mysql4_Abstract
 
 
 
 
 
 
 
 
27
  {
28
- /**
29
- * Constructor, setting table and index field
30
- *
31
- * @return void
32
- */
33
- protected function _construct()
34
- {
35
- $this->_init('xmlconnect/queue', 'id');
36
- }
37
  }
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+
27
+ /**
28
+ * XmlConnect Model Resource Queue
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Mysql4_Queue extends Mage_XmlConnect_Model_Resource_Queue
35
  {
 
 
 
 
 
 
 
 
 
36
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/Queue/Collection.php CHANGED
@@ -24,7 +24,6 @@
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
 
27
-
28
  /**
29
  * Queue resource collection
30
  *
@@ -33,71 +32,6 @@
33
  * @author Magento Core Team <core@magentocommerce.com>
34
  */
35
  class Mage_XmlConnect_Model_Mysql4_Queue_Collection
36
- extends Mage_Core_Model_Mysql4_Collection_Abstract
37
  {
38
- /**
39
- * Internal constructor
40
- *
41
- * @return void
42
- */
43
- protected function _construct()
44
- {
45
- $this->_init('xmlconnect/queue');
46
- }
47
-
48
- /**
49
- * Initialize collection select
50
- *
51
- * @return Mage_XmlConnect_Model_Mysql4_Queue_Collection
52
- */
53
- protected function _initSelect()
54
- {
55
- parent::_initSelect();
56
- $this->_joinTemplateName()
57
- ->_joinApplicationName();
58
- return $this;
59
- }
60
-
61
- /**
62
- * Join Template Name to collection
63
- *
64
- * @return Mage_XmlConnect_Model_Mysql4_Queue_Collection
65
- */
66
- protected function _joinTemplateName()
67
- {
68
- $this->getSelect()
69
- ->joinLeft(array('t' => $this->getTable('xmlconnect/template')), 't.id = template_id', array(
70
- 'template_name' => 't.name',
71
- ));
72
- return $this;
73
- }
74
-
75
- /**
76
- * Join Application Name to collection
77
- *
78
- * @return Mage_XmlConnect_Model_Mysql4_Queue_Collection
79
- */
80
- protected function _joinApplicationName()
81
- {
82
- $this->getSelect()
83
- ->joinLeft(array('app' => $this->getTable('xmlconnect/application')), 'app.code = main_table.app_code', array(
84
- 'application_name' => 'app.name',
85
- ));
86
- return $this;
87
- }
88
-
89
- /**
90
- * Add filter by only ready fot sending item
91
- *
92
- * @return Mage_XmlConnect_Model_Mysql4_Queue_Collection
93
- */
94
- public function addOnlyForSendingFilter()
95
- {
96
- $this->getSelect()
97
- ->where('main_table.status in (?)', array(Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE))
98
- ->where('main_table.exec_time < ?', Mage::getSingleton('core/date')->gmtDate())
99
- ->order(new Zend_Db_Expr('main_table.exec_time ' . Zend_Db_Select::SQL_ASC));
100
-
101
- return $this;
102
- }
103
  }
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
 
 
27
  /**
28
  * Queue resource collection
29
  *
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
  class Mage_XmlConnect_Model_Mysql4_Queue_Collection
35
+ extends Mage_XmlConnect_Model_Resource_Queue_Collection
36
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/Setup.php CHANGED
@@ -23,7 +23,15 @@
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Mage_XmlConnect_Model_Mysql4_Setup extends Mage_Catalog_Model_Resource_Eav_Mysql4_Setup
27
- {
28
 
 
 
 
 
 
 
 
 
 
 
29
  }
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
 
27
+
28
+ /**
29
+ * XML Connect Setup Resource Model
30
+ *
31
+ * @category Mage
32
+ * @package Mage_XmlConnect
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Mage_XmlConnect_Model_Mysql4_Setup extends Mage_XmlConnect_Model_Resource_Setup
36
+ {
37
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/Template.php CHANGED
@@ -23,15 +23,14 @@
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Mage_XmlConnect_Model_Mysql4_Template extends Mage_Core_Model_Mysql4_Abstract
 
 
 
 
 
 
 
 
27
  {
28
- /**
29
- * Constructor, setting table and index field
30
- *
31
- * @return void
32
- */
33
- protected function _construct()
34
- {
35
- $this->_init('xmlconnect/template', 'id');
36
- }
37
  }
23
  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+
27
+ /**
28
+ * XmlConnect Model Resource Template
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Mysql4_Template extends Mage_XmlConnect_Model_Resource_Template
35
  {
 
 
 
 
 
 
 
 
 
36
  }
app/code/core/Mage/XmlConnect/Model/Mysql4/Template/Collection.php CHANGED
@@ -32,41 +32,6 @@
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
  class Mage_XmlConnect_Model_Mysql4_Template_Collection
35
- extends Mage_Core_Model_Mysql4_Collection_Abstract
36
  {
37
- /**
38
- * Internal constructor
39
- *
40
- * @return void
41
- */
42
- protected function _construct()
43
- {
44
- $this->_init('xmlconnect/template');
45
- }
46
-
47
- /**
48
- * Initialize collection select
49
- *
50
- * @return Mage_XmlConnect_Model_Mysql4_Template_Collection
51
- */
52
- protected function _initSelect()
53
- {
54
- parent::_initSelect();
55
- $this->_joinApplicationName();
56
- return $this;
57
- }
58
-
59
- /**
60
- * Join Application Name to collection
61
- *
62
- * @return Mage_XmlConnect_Model_Mysql4_Template_Collection
63
- */
64
- protected function _joinApplicationName()
65
- {
66
- $this->getSelect()
67
- ->joinLeft(array('app' => $this->getTable('xmlconnect/application')), 'app.code = app_code', array(
68
- 'app_name' => 'app.name',
69
- ));
70
- return $this;
71
- }
72
  }
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
  class Mage_XmlConnect_Model_Mysql4_Template_Collection
35
+ extends Mage_XmlConnect_Model_Resource_Template_Collection
36
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
app/code/core/Mage/XmlConnect/Model/Observer.php CHANGED
@@ -70,8 +70,7 @@ class Mage_XmlConnect_Model_Observer
70
  public function changeUpdatedAtParamOnConfigSave($observer)
71
  {
72
  $configData = $observer->getEvent()->getConfigData();
73
- if ($configData
74
- && (int)$configData->isValueChanged()
75
  && in_array($configData->getPath(), $this->_appDependOnConfigFieldPathes)
76
  ) {
77
  Mage::getModel('xmlconnect/application')->updateAllAppsUpdatedAtParameter();
@@ -87,10 +86,8 @@ class Mage_XmlConnect_Model_Observer
87
  public function sendMessageImmediately($observer)
88
  {
89
  $message = $observer->getEvent()->getData('queueMessage');
90
- if ($message instanceof Mage_XmlConnect_Model_Queue
91
- && (strtolower($message->getExecTime()) == 'null'
92
- || !$message->getExecTime()
93
- )
94
  ) {
95
  $message->setExecTime(Mage::getSingleton('core/date')->gmtDate());
96
  Mage::helper('xmlconnect')->sendBroadcastMessage($message);
@@ -103,7 +100,7 @@ class Mage_XmlConnect_Model_Observer
103
  /**
104
  * Send scheduled messages
105
  *
106
- * @return void
107
  */
108
  public function scheduledSend()
109
  {
70
  public function changeUpdatedAtParamOnConfigSave($observer)
71
  {
72
  $configData = $observer->getEvent()->getConfigData();
73
+ if ($configData && (int)$configData->isValueChanged()
 
74
  && in_array($configData->getPath(), $this->_appDependOnConfigFieldPathes)
75
  ) {
76
  Mage::getModel('xmlconnect/application')->updateAllAppsUpdatedAtParameter();
86
  public function sendMessageImmediately($observer)
87
  {
88
  $message = $observer->getEvent()->getData('queueMessage');
89
+ if ($message instanceof Mage_XmlConnect_Model_Queue && (strtolower($message->getExecTime()) == 'null'
90
+ || !$message->getExecTime())
 
 
91
  ) {
92
  $message->setExecTime(Mage::getSingleton('core/date')->gmtDate());
93
  Mage::helper('xmlconnect')->sendBroadcastMessage($message);
100
  /**
101
  * Send scheduled messages
102
  *
103
+ * @return null
104
  */
105
  public function scheduledSend()
106
  {
app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Model_Payment_Method_Paypal_Config
35
- extends Mage_Paypal_Model_Config
36
  {
37
  /**
38
  * PayPal Website Payments Pro - PayPal Mobile Express Checkout Library
@@ -47,9 +46,6 @@ class Mage_XmlConnect_Model_Payment_Method_Paypal_Config
47
  */
48
  public function getExpressCheckoutStartUrl($token)
49
  {
50
- return $this->getPaypalUrl(array(
51
- 'cmd' => '_express-checkout-mobile',
52
- 'token' => $token,
53
- ));
54
  }
55
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Model_Payment_Method_Paypal_Config extends Mage_Paypal_Model_Config
 
35
  {
36
  /**
37
  * PayPal Website Payments Pro - PayPal Mobile Express Checkout Library
46
  */
47
  public function getExpressCheckoutStartUrl($token)
48
  {
49
+ return $this->getPaypalUrl(array('cmd' => '_express-checkout-mobile', 'token' => $token));
 
 
 
50
  }
51
  }
app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Model_Payment_Method_Paypal_Mecl
35
- extends Mage_Paypal_Model_Express
36
  {
37
  /**
38
  * Store MECL payment method code
@@ -44,7 +43,7 @@ class Mage_XmlConnect_Model_Payment_Method_Paypal_Mecl
44
  *
45
  * @var string
46
  */
47
- protected $_code = self::MECL_METHOD_CODE;
48
 
49
  /**
50
  * Can use method for a frontend checkout
@@ -53,9 +52,18 @@ class Mage_XmlConnect_Model_Payment_Method_Paypal_Mecl
53
  */
54
  protected $_canUseCheckout = false;
55
 
56
- protected $_canUseInternal = false;
57
- protected $_canUseForMultishipping = false;
58
- protected $_isInitializeNeeded = false;
 
 
 
 
 
 
 
 
 
59
  protected $_canManageRecurringProfiles = false;
60
 
61
  /**
@@ -69,7 +77,7 @@ class Mage_XmlConnect_Model_Payment_Method_Paypal_Mecl
69
  $storeId = false;
70
  $model = Mage::registry('current_app');
71
 
72
- if (($model instanceof Mage_XmlConnect_Model_Application)) {
73
  $storeId = $model->getStoreId();
74
  }
75
 
@@ -77,8 +85,7 @@ class Mage_XmlConnect_Model_Payment_Method_Paypal_Mecl
77
  $storeId = $quote ? $quote->getStoreId() : Mage::app()->getStore()->getId();
78
  }
79
 
80
- return (bool) Mage::getModel('paypal/config')
81
- ->setStoreId($storeId)
82
  ->isMethodAvailable(Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS);
83
  }
84
 
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Model_Payment_Method_Paypal_Mecl extends Mage_Paypal_Model_Express
 
35
  {
36
  /**
37
  * Store MECL payment method code
43
  *
44
  * @var string
45
  */
46
+ protected $_code = self::MECL_METHOD_CODE;
47
 
48
  /**
49
  * Can use method for a frontend checkout
52
  */
53
  protected $_canUseCheckout = false;
54
 
55
+ /**
56
+ * Can method be used for multishipping checkout type
57
+ *
58
+ * @var bool
59
+ */
60
+ protected $_canUseForMultishipping = false;
61
+
62
+ /**
63
+ * Can method manage recurring profiles
64
+ *
65
+ * @var bool
66
+ */
67
  protected $_canManageRecurringProfiles = false;
68
 
69
  /**
77
  $storeId = false;
78
  $model = Mage::registry('current_app');
79
 
80
+ if ($model instanceof Mage_XmlConnect_Model_Application) {
81
  $storeId = $model->getStoreId();
82
  }
83
 
85
  $storeId = $quote ? $quote->getStoreId() : Mage::app()->getStore()->getId();
86
  }
87
 
88
+ return (bool) Mage::getModel('paypal/config')->setStoreId($storeId)
 
89
  ->isMethodAvailable(Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS);
90
  }
91
 
app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php CHANGED
@@ -81,8 +81,7 @@ class Mage_XmlConnect_Model_Payment_Method_Paypal_Mep extends Mage_Paypal_Model_
81
  $storeId = $quote ? $quote->getStoreId() : Mage::app()->getStore()->getId();
82
  }
83
 
84
- return (bool) Mage::getModel('paypal/config')
85
- ->setStoreId($storeId)
86
  ->isMethodAvailable(Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS);
87
  }
88
 
81
  $storeId = $quote ? $quote->getStoreId() : Mage::app()->getStore()->getId();
82
  }
83
 
84
+ return (bool) Mage::getModel('paypal/config')->setStoreId($storeId)
 
85
  ->isMethodAvailable(Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS);
86
  }
87
 
app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php CHANGED
@@ -31,8 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Model_Paypal_Mecl_Checkout
35
- extends Mage_Paypal_Model_Express_Checkout
36
  {
37
  /**
38
  * Payment method type
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Model_Paypal_Mecl_Checkout extends Mage_Paypal_Model_Express_Checkout
 
35
  {
36
  /**
37
  * Payment method type
app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php CHANGED
@@ -175,9 +175,7 @@ class Mage_XmlConnect_Model_Paypal_Mep_Checkout
175
  $billing->unsAddressId()->unsAddressType();
176
  $shipping = $this->_quote->getShippingAddress();
177
  $shippingMethod = $shipping->getShippingMethod();
178
- $shipping->addData($billing->getData())
179
- ->setSameAsBilling(1)
180
- ->setShippingMethod($shippingMethod)
181
  ->setCollectShippingRates(true);
182
  }
183
 
@@ -206,10 +204,8 @@ class Mage_XmlConnect_Model_Paypal_Mep_Checkout
206
  if (!$this->_quote->getIsVirtual() && $shippingAddress) {
207
  if ($shippingMethod != $shippingAddress->getShippingMethod()) {
208
  $this->_ignoreAddressValidation();
209
- $this->_quote->getShippingAddress()
210
- ->setShippingMethod($shippingMethod);
211
- $this->_quote->collectTotals()
212
- ->save();
213
  }
214
  }
215
 
@@ -237,8 +233,7 @@ class Mage_XmlConnect_Model_Paypal_Mep_Checkout
237
  $email = isset($data['payer']) ? $data['payer'] : null;
238
  $payment->setAdditionalInformation(self::PAYMENT_INFO_PAYER_EMAIL, $email);
239
  $payment->setAdditionalInformation(
240
- self::PAYMENT_INFO_TRANSACTION_ID,
241
- isset($data['transaction_id']) ? $data['transaction_id'] : null
242
  );
243
  $this->_quote->setCustomerEmail($email);
244
 
@@ -266,11 +261,8 @@ class Mage_XmlConnect_Model_Paypal_Mep_Checkout
266
  * Prepare session to success or cancellation page
267
  */
268
  $quoteId = $this->_quote->getId();
269
- $this->_getCheckoutSession()
270
- ->setLastQuoteId($quoteId)
271
- ->setLastSuccessQuoteId($quoteId)
272
- ->setLastOrderId($order->getId())
273
- ->setLastRealOrderId($order->getIncrementId());
274
 
275
  if ($order->getState() == Mage_Sales_Model_Order::STATE_PROCESSING
276
  && Mage::getSingleton('customer/session')->isLoggedIn()
@@ -305,7 +297,7 @@ class Mage_XmlConnect_Model_Paypal_Mep_Checkout
305
  /**
306
  * Make sure addresses will be saved without validation errors
307
  *
308
- * @return void
309
  */
310
  protected function _ignoreAddressValidation()
311
  {
@@ -333,8 +325,7 @@ class Mage_XmlConnect_Model_Paypal_Mep_Checkout
333
  protected function _prepareGuestQuote()
334
  {
335
  $quote = $this->_quote;
336
- $quote->setCustomerId(null)
337
- ->setCustomerIsGuest(true)
338
  ->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
339
  return $this;
340
  }
@@ -343,7 +334,7 @@ class Mage_XmlConnect_Model_Paypal_Mep_Checkout
343
  * Adopt specified request array from PayPal
344
  *
345
  * @param array $request
346
- * @return void
347
  */
348
  protected function _applyCountryWorkarounds(&$request)
349
  {
175
  $billing->unsAddressId()->unsAddressType();
176
  $shipping = $this->_quote->getShippingAddress();
177
  $shippingMethod = $shipping->getShippingMethod();
178
+ $shipping->addData($billing->getData())->setSameAsBilling(1)->setShippingMethod($shippingMethod)
 
 
179
  ->setCollectShippingRates(true);
180
  }
181
 
204
  if (!$this->_quote->getIsVirtual() && $shippingAddress) {
205
  if ($shippingMethod != $shippingAddress->getShippingMethod()) {
206
  $this->_ignoreAddressValidation();
207
+ $this->_quote->getShippingAddress()->setShippingMethod($shippingMethod);
208
+ $this->_quote->collectTotals()->save();
 
 
209
  }
210
  }
211
 
233
  $email = isset($data['payer']) ? $data['payer'] : null;
234
  $payment->setAdditionalInformation(self::PAYMENT_INFO_PAYER_EMAIL, $email);
235
  $payment->setAdditionalInformation(
236
+ self::PAYMENT_INFO_TRANSACTION_ID, isset($data['transaction_id']) ? $data['transaction_id'] : null
 
237
  );
238
  $this->_quote->setCustomerEmail($email);
239
 
261
  * Prepare session to success or cancellation page
262
  */
263
  $quoteId = $this->_quote->getId();
264
+ $this->_getCheckoutSession()->setLastQuoteId($quoteId)->setLastSuccessQuoteId($quoteId)
265
+ ->setLastOrderId($order->getId())->setLastRealOrderId($order->getIncrementId());
 
 
 
266
 
267
  if ($order->getState() == Mage_Sales_Model_Order::STATE_PROCESSING
268
  && Mage::getSingleton('customer/session')->isLoggedIn()
297
  /**
298
  * Make sure addresses will be saved without validation errors
299
  *
300
+ * @return null
301
  */
302
  protected function _ignoreAddressValidation()
303
  {
325
  protected function _prepareGuestQuote()
326
  {
327
  $quote = $this->_quote;
328
+ $quote->setCustomerId(null)->setCustomerIsGuest(true)
 
329
  ->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
330
  return $this;
331
  }
334
  * Adopt specified request array from PayPal
335
  *
336
  * @param array $request
337
+ * @return null
338
  */
339
  protected function _applyCountryWorkarounds(&$request)
340
  {
app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php CHANGED
@@ -58,7 +58,7 @@ abstract class Mage_XmlConnect_Model_Preview_Abstract extends Varien_Object
58
  * Internal constructor not depended on params.
59
  * It's used for application object initialization
60
  *
61
- * @return void
62
  */
63
  final function _construct()
64
  {
58
  * Internal constructor not depended on params.
59
  * It's used for application object initialization
60
  *
61
+ * @return null
62
  */
63
  final function _construct()
64
  {
app/code/core/Mage/XmlConnect/Model/Queue.php CHANGED
@@ -84,7 +84,7 @@ class Mage_XmlConnect_Model_Queue extends Mage_Core_Model_Template
84
  /**
85
  * Initialize queue message
86
  *
87
- * @return void
88
  */
89
  protected function _construct()
90
  {
@@ -103,9 +103,7 @@ class Mage_XmlConnect_Model_Queue extends Mage_Core_Model_Template
103
  parent::load($id, $field);
104
 
105
  if ($this->getTemplateId()) {
106
- $this->setName(
107
- Mage::getModel('xmlconnect/template')->load($this->getTemplateId())->getName()
108
- );
109
  }
110
  return $this;
111
  }
@@ -188,16 +186,16 @@ EOT;
188
  switch ($this->getData('type')) {
189
  case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL:
190
  $html = sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Push title'))
191
- . $this->getPushTitle();
192
- $html .= sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message title'))
193
- . $this->getMessageTitle();
194
- $html .= sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message content'))
195
- . $processor->filter($this->getContent());
196
  break;
197
  case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_PUSH:
198
  default:
199
  $html = sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Push title'))
200
- . $this->getPushTitle();
201
  break;
202
  }
203
  return $html;
@@ -242,11 +240,7 @@ EOT;
242
  );
243
 
244
  $payload = array(
245
- 'push' => array(
246
- $notificationType => array(
247
- 'alert' => $this->getPushTitle(),
248
- )
249
- ),
250
  'title' => $this->getMessageTitle(),
251
  'message' => $this->getContent(),
252
  );
84
  /**
85
  * Initialize queue message
86
  *
87
+ * @return null
88
  */
89
  protected function _construct()
90
  {
103
  parent::load($id, $field);
104
 
105
  if ($this->getTemplateId()) {
106
+ $this->setName(Mage::getModel('xmlconnect/template')->load($this->getTemplateId())->getName());
 
 
107
  }
108
  return $this;
109
  }
186
  switch ($this->getData('type')) {
187
  case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL:
188
  $html = sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Push title'))
189
+ . $this->getPushTitle()
190
+ . sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message title'))
191
+ . $this->getMessageTitle()
192
+ . sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message content'))
193
+ . $processor->filter($this->getContent());
194
  break;
195
  case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_PUSH:
196
  default:
197
  $html = sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Push title'))
198
+ . $this->getPushTitle();
199
  break;
200
  }
201
  return $html;
240
  );
241
 
242
  $payload = array(
243
+ 'push' => array($notificationType => array('alert' => $this->getPushTitle())),
 
 
 
 
244
  'title' => $this->getMessageTitle(),
245
  'message' => $this->getContent(),
246
  );
app/code/core/Mage/XmlConnect/Model/Resource/Application.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * XmlConnect Model Resource Application
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_Application extends Mage_Core_Model_Resource_Db_Abstract
35
+ {
36
+ /**
37
+ * Constructor, setting table and index field
38
+ *
39
+ * @return null
40
+ */
41
+ protected function _construct()
42
+ {
43
+ $this->_init('xmlconnect/application', 'application_id');
44
+ }
45
+
46
+ /**
47
+ * Update Application Status field, insert data to history table
48
+ *
49
+ * @param int $applicationId
50
+ * @param string $status
51
+ * @return Mage_XmlConnect_Model_Resource_Application
52
+ */
53
+ public function updateApplicationStatus($applicationId, $status)
54
+ {
55
+ $this->_getWriteAdapter()->update(
56
+ $this->getMainTable(),
57
+ array('status' => $status),
58
+ $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $applicationId)
59
+ );
60
+ return $this;
61
+ }
62
+
63
+ /**
64
+ * Processing object before save data
65
+ * Update app_code as Store + Device
66
+ *
67
+ * @param Mage_Core_Model_Abstract $object
68
+ * @return Mage_Core_Model_Abstract
69
+ */
70
+ protected function _beforeSave(Mage_Core_Model_Abstract $object)
71
+ {
72
+ if (!$object->getId()) {
73
+ $object->setCode($object->getCodePrefix());
74
+ }
75
+ return parent::_beforeSave($object);
76
+ }
77
+
78
+ /**
79
+ * Processing object after save data
80
+ * Update app_code as Store + Device + 123 (increment).
81
+ *
82
+ * @param Mage_Core_Model_Abstract $object
83
+ * @return Mage_Core_Model_Abstract
84
+ */
85
+ protected function _afterSave(Mage_Core_Model_Abstract $object)
86
+ {
87
+ $appCode = $object->getCode();
88
+ $isCodePrefixed = $object->isCodePrefixed();
89
+ if (!$isCodePrefixed) {
90
+ $this->_getWriteAdapter()->update(
91
+ $this->getMainTable(),
92
+ array('code' => $appCode . $object->getId()),
93
+ $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $object->getId())
94
+ );
95
+ }
96
+ return parent::_afterSave($object);
97
+ }
98
+
99
+ /**
100
+ * Collect existing stores and type unique pairs
101
+ *
102
+ * @return array
103
+ */
104
+ public function getExistingStoreDeviceType()
105
+ {
106
+ $select = $this->_getWriteAdapter()->select()->from($this->getMainTable(), array('store_id', 'type'))
107
+ ->group(array('store_id', 'type'))->order(array('store_id', 'type'));
108
+ return $this->_getReadAdapter()->fetchAll($select, array('store_id', 'type'));
109
+ }
110
+
111
+ /**
112
+ * Update all applications "updated at" parameter with current date
113
+ *
114
+ * @return Mage_XmlConnect_Model_Resource_Application
115
+ */
116
+ public function updateAllAppsUpdatedAtParameter()
117
+ {
118
+ $this->_getWriteAdapter()->update($this->getMainTable(), array('updated_at' => date('Y-m-d H:i:s')));
119
+ return $this;
120
+ }
121
+ }
app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * XmlConnect Model Resource Application Collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_Application_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
35
+ {
36
+ /**
37
+ * Constructor, setting table
38
+ *
39
+ * @return null
40
+ */
41
+ protected function _construct()
42
+ {
43
+ $this->_init('xmlconnect/application');
44
+ }
45
+ }
app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Extended CMS page collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_Cms_Page_Collection extends Mage_Cms_Model_Resource_Page_Collection
35
+ {
36
+ /**
37
+ * Returns pairs identifier - title for unique identifiers
38
+ * and pairs identifier|page_id - title for non-unique after first
39
+ *
40
+ * @return array
41
+ */
42
+ public function toOptionIdArray()
43
+ {
44
+ $res = array();
45
+ $existingIdentifiers = array();
46
+ foreach ($this as $item) {
47
+ $identifier = $item->getData('identifier');
48
+
49
+ $data['value'] = $identifier;
50
+ $data['label'] = $item->getData('title');
51
+ if (in_array($identifier, $existingIdentifiers)) {
52
+ $data['value'] .= '|' . $item->getData('page_id');
53
+ } else {
54
+ $existingIdentifiers[] = $identifier;
55
+ }
56
+
57
+ $res[] = $data;
58
+ }
59
+
60
+ return $res;
61
+ }
62
+ }
app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Configuration data recourse model
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Xmlconnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_ConfigData extends Mage_Core_Model_Mysql4_Abstract
35
+ {
36
+ /**
37
+ * Initialize configuration data
38
+ *
39
+ * @return null
40
+ */
41
+ protected function _construct()
42
+ {
43
+ $this->_init('xmlconnect/configData', null);
44
+ }
45
+
46
+ /**
47
+ * Save config value
48
+ *
49
+ * @param int $applicationId
50
+ * @param string $category
51
+ * @param string $path
52
+ * @param string $value
53
+ * @return Mage_XmlConnect_Model_Mysql4_ConfigData
54
+ */
55
+ public function saveConfig($applicationId, $category, $path, $value)
56
+ {
57
+ $newData = array(
58
+ 'application_id' => $applicationId,
59
+ 'category' => $category,
60
+ 'path' => $path,
61
+ 'value' => $value
62
+ );
63
+
64
+ $this->_getWriteAdapter()->insertOnDuplicate($this->getMainTable(), $newData, array('value'));
65
+ return $this;
66
+ }
67
+
68
+ /**
69
+ * Delete config value
70
+ *
71
+ * @param int $applicationId
72
+ * @param bool $category
73
+ * @param bool $path
74
+ * @param bool $pathLike
75
+ * @return Mage_XmlConnect_Model_Mysql4_ConfigData
76
+ */
77
+ public function deleteConfig($applicationId, $category = false, $path = false, $pathLike = true)
78
+ {
79
+ try {
80
+ $this->_getWriteAdapter()->beginTransaction();
81
+ $writeAdapter = $this->_getWriteAdapter();
82
+ $deleteWhere[] = $writeAdapter->quoteInto('application_id=?', $applicationId);
83
+ if ($category) {
84
+ $deleteWhere[] = $writeAdapter->quoteInto('category=?', $category);
85
+ }
86
+ if ($path) {
87
+ $deleteWhere[] = $pathLike ? $writeAdapter->quoteInto('path like ?', $path . '/%')
88
+ : $writeAdapter->quoteInto('path=?', $path);
89
+ }
90
+ $writeAdapter->delete($this->getMainTable(), $deleteWhere);
91
+ $this->_getWriteAdapter()->commit();
92
+ } catch (Mage_Core_Exception $e) {
93
+ $this->_getWriteAdapter()->rollBack();
94
+ throw $e;
95
+ } catch (Exception $e){
96
+ $this->_getWriteAdapter()->rollBack();
97
+ Mage::logException($e);
98
+ }
99
+
100
+ return $this;
101
+ }
102
+ }
app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Configuration data collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Xmlconnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_ConfigData_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
35
+ {
36
+ /**
37
+ * Is application filter applied
38
+ *
39
+ * @var bool
40
+ */
41
+ protected $_applicationFilter = false;
42
+
43
+ /**
44
+ * Internal constructor
45
+ */
46
+ protected function _construct()
47
+ {
48
+ $this->_init('xmlconnect/configData');
49
+ }
50
+
51
+ /**
52
+ * Add application filter
53
+ *
54
+ * @param $applicationId
55
+ * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
56
+ */
57
+ public function addApplicationIdFilter($applicationId)
58
+ {
59
+ $this->_applicationFilter = true;
60
+ $this->getSelect()->where('application_id=?', $applicationId);
61
+ return $this;
62
+ }
63
+
64
+ /**
65
+ * Add path filter
66
+ *
67
+ * @param $path
68
+ * @param bool $like
69
+ * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
70
+ */
71
+ public function addPathFilter($path, $like = true)
72
+ {
73
+ if ($like) {
74
+ $this->getSelect()->where('path like ?', $path . '/%');
75
+ } else {
76
+ $this->getSelect()->where('path=?', $path);
77
+ }
78
+ return $this;
79
+ }
80
+
81
+ /**
82
+ * Add category filter
83
+ *
84
+ * @param $category
85
+ * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
86
+ */
87
+ public function addCategoryFilter($category)
88
+ {
89
+ $this->getSelect()->where('category=?', $category);
90
+ return $this;
91
+ }
92
+
93
+ /**
94
+ * Add value filter
95
+ *
96
+ * @param $value
97
+ * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
98
+ */
99
+ public function addValueFilter($value)
100
+ {
101
+ $this->getSelect()->where('value=?', $value);
102
+ return $this;
103
+ }
104
+
105
+ /**
106
+ * Add filter by array
107
+ *
108
+ * @param array $array
109
+ * @return Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
110
+ */
111
+ public function addArrayFilter(array $array)
112
+ {
113
+ foreach ($array as $key => $val) {
114
+ $method = 'add' . uc_words($key, '') . 'Filter';
115
+ if (is_callable($this->$method($val))) {
116
+ return $this->$method($val);
117
+ }
118
+ }
119
+ return $this;
120
+ }
121
+
122
+ /**
123
+ * Convert items array to array for select options
124
+ *
125
+ * return items array
126
+ * array(
127
+ * application_id => array(
128
+ * category => array(
129
+ * path
130
+ * )
131
+ * )
132
+ * )
133
+ *
134
+ * @return array
135
+ */
136
+ public function toOptionArray()
137
+ {
138
+ $result = array();
139
+ foreach ($this as $item) {
140
+ $appId = $item->getData('application_id');
141
+ $category = $item->getData('category');
142
+ $path = $item->getData('path');
143
+ $value = $item->getData('value');
144
+
145
+ if ($this->_applicationFilter) {
146
+ $result[$category][$path] = $value;
147
+ } else {
148
+ $result[$appId][$category][$path] = $value;
149
+ }
150
+ }
151
+ return $result;
152
+ }
153
+
154
+ /**
155
+ * Get Application filter status
156
+ *
157
+ * @return boolean
158
+ */
159
+ public function getApplicationFilter()
160
+ {
161
+ return $this->_applicationFilter;
162
+ }
163
+
164
+ /**
165
+ * Set Application filter status
166
+ *
167
+ * @param boolean $applicationFilter
168
+ */
169
+ public function setApplicationFilter($applicationFilter)
170
+ {
171
+ $this->_applicationFilter = $applicationFilter;
172
+ }
173
+ }
app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Filter collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_Filter_Collection extends Varien_Data_Collection
35
+ {
36
+ /**
37
+ * Set CategoryId filter
38
+ *
39
+ * @param int $categoryId
40
+ * @return Mage_XmlConnect_Model_Resource_Filter_Collection
41
+ */
42
+ public function setCategoryId($categoryId)
43
+ {
44
+ if ((int)$categoryId > 0) {
45
+ $this->addFilter('category_id', $categoryId);
46
+ }
47
+ return $this;
48
+ }
49
+
50
+ /**
51
+ * Load data
52
+ *
53
+ * @param bool $printQuery
54
+ * @param bool $logQuery
55
+ * @return Mage_XmlConnect_Model_Resource_Filter_Collection
56
+ */
57
+ public function load($printQuery = false, $logQuery = false)
58
+ {
59
+ if (empty($this->_items)) {
60
+ $layer = Mage::getSingleton('catalog/layer');
61
+ foreach ($this->_filters as $filter) {
62
+ if ('category_id' == $filter['field']) {
63
+ $layer->setCurrentCategory((int)$filter['value']);
64
+ }
65
+ }
66
+ if ($layer->getCurrentCategory()->getIsAnchor()) {
67
+ foreach ($layer->getFilterableAttributes() as $attributeItem) {
68
+ $filterModelName = 'catalog/layer_filter_attribute';
69
+ switch ($attributeItem->getAttributeCode()) {
70
+ case 'price':
71
+ $filterModelName = 'catalog/layer_filter_price';
72
+ break;
73
+ case 'decimal':
74
+ $filterModelName = 'catalog/layer_filter_decimal';
75
+ break;
76
+ default:
77
+ $filterModelName = 'catalog/layer_filter_attribute';
78
+ break;
79
+ }
80
+
81
+ $filterModel = Mage::getModel($filterModelName);
82
+ $filterModel->setLayer($layer)->setAttributeModel($attributeItem);
83
+ $filterValues = new Varien_Data_Collection;
84
+ foreach ($filterModel->getItems() as $valueItem) {
85
+ $valueObject = new Varien_Object();
86
+ $valueObject->setLabel($valueItem->getLabel());
87
+ $valueObject->setValueString($valueItem->getValueString());
88
+ $valueObject->setProductsCount($valueItem->getCount());
89
+ $filterValues->addItem($valueObject);
90
+ }
91
+ $item = new Varien_Object;
92
+ $item->setCode($attributeItem->getAttributeCode());
93
+ $item->setName($filterModel->getName());
94
+ $item->setValues($filterValues);
95
+ $this->addItem($item);
96
+ }
97
+ }
98
+ }
99
+ return $this;
100
+ }
101
+ }
app/code/core/Mage/XmlConnect/Model/Resource/History.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * XmlConnect Model Resource History
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_History extends Mage_Core_Model_Resource_Db_Abstract
35
+ {
36
+ /**
37
+ * Constructor, setting table and index field
38
+ *
39
+ * @return null
40
+ */
41
+ protected function _construct()
42
+ {
43
+ $this->_init('xmlconnect/history', 'history_id');
44
+ }
45
+
46
+ /**
47
+ * Serialization for 'params' variable
48
+ *
49
+ * @param Mage_Core_Model_Abstract $object
50
+ * @return Mage_Core_Model_Abstract
51
+ */
52
+ protected function _beforeSave(Mage_Core_Model_Abstract $object)
53
+ {
54
+ $object->setParams(serialize($object->getParams()));
55
+ return parent::_beforeSave($object);
56
+ }
57
+
58
+ /**
59
+ * Deserialization for 'params' variable
60
+ *
61
+ * @param Mage_Core_Model_Abstract $object
62
+ * @return Mage_Core_Model_Abstract
63
+ */
64
+ protected function _afterLoad(Mage_Core_Model_Abstract $object)
65
+ {
66
+ $object->setParams(unserialize($object->getParams()));
67
+ return parent::_afterLoad($object);
68
+ }
69
+
70
+ /**
71
+ * Returns array of existing images
72
+ *
73
+ * @param int $id application instance Id
74
+ * @return array
75
+ */
76
+ public function getLastParams($id)
77
+ {
78
+ $paramArray = array();
79
+ $idFieldName = Mage::getModel('xmlconnect/application')->getIdFieldName();
80
+ $select = $this->_getReadAdapter()->select()->from($this->getMainTable(), 'params')
81
+ ->where($idFieldName . '=?', $id)->order(array('created_at ' . Zend_Db_Select::SQL_DESC));
82
+
83
+ $params = $this->_getReadAdapter()->fetchOne($select);
84
+
85
+ if (isset($params)) {
86
+ $paramArray = unserialize($params);
87
+ }
88
+ return $paramArray;
89
+ }
90
+ }
app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * History resource collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_History_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
35
+ {
36
+ /**
37
+ * Internal constructor
38
+ */
39
+ protected function _construct()
40
+ {
41
+ $this->_init('xmlconnect/history');
42
+ }
43
+
44
+ /**
45
+ * Filter collection by store
46
+ *
47
+ * @param int $storeId
48
+ * @return Mage_XmlConnect_Model_Resource_History_Collection
49
+ */
50
+ public function addStoreFilter($storeId)
51
+ {
52
+ $this->addFieldToFilter('store_id', $storeId);
53
+ return $this;
54
+ }
55
+
56
+ /**
57
+ * Filter collection by application_id
58
+ *
59
+ * @param int $applicationId
60
+ * @return Mage_XmlConnect_Model_Resource_History_Collection
61
+ */
62
+ public function addApplicationFilter($applicationId)
63
+ {
64
+ $this->addFieldToFilter('application_id', $applicationId);
65
+ return $this;
66
+ }
67
+ }
app/code/core/Mage/XmlConnect/Model/Resource/Queue.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * XmlConnect Model Resource Queue
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_Queue extends Mage_Core_Model_Resource_Db_Abstract
35
+ {
36
+ /**
37
+ * Constructor, setting table and index field
38
+ *
39
+ * @return null
40
+ */
41
+ protected function _construct()
42
+ {
43
+ $this->_init('xmlconnect/queue', 'queue_id');
44
+ }
45
+ }
app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Queue resource collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_Queue_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
35
+ {
36
+ /**
37
+ * Internal constructor
38
+ *
39
+ * @return null
40
+ */
41
+ protected function _construct()
42
+ {
43
+ $this->_init('xmlconnect/queue');
44
+ }
45
+
46
+ /**
47
+ * Initialize collection select
48
+ *
49
+ * @return Mage_XmlConnect_Model_Resource_Queue_Collection
50
+ */
51
+ protected function _initSelect()
52
+ {
53
+ parent::_initSelect();
54
+ $this->_joinNames();
55
+ return $this;
56
+ }
57
+
58
+ /**
59
+ * Join Template Name and Application Name to collection
60
+ *
61
+ * @return Mage_XmlConnect_Model_Resource_Queue_Collection
62
+ */
63
+ protected function _joinNames()
64
+ {
65
+ $this->_joinTemplateName();
66
+ $this->_joinApplicationName();
67
+ return $this;
68
+ }
69
+
70
+ /**
71
+ * Join Template Name to collection
72
+ *
73
+ * @return Mage_XmlConnect_Model_Resource_Queue_Collection
74
+ */
75
+ protected function _joinTemplateName()
76
+ {
77
+ $this->getSelect()->joinLeft(
78
+ array('t' => $this->getTable('xmlconnect/template')),
79
+ 't.template_id = main_table.template_id',
80
+ array('template_name' => 't.name')
81
+ );
82
+ return $this;
83
+ }
84
+
85
+ /**
86
+ * Join Application Name to collection
87
+ *
88
+ * @return Mage_XmlConnect_Model_Resource_Queue_Collection
89
+ */
90
+ protected function _joinApplicationName()
91
+ {
92
+ $this->getSelect()->joinLeft(
93
+ array('app' => $this->getTable('xmlconnect/application')),
94
+ 'app.application_id = t.application_id',
95
+ array('application_name' => 'app.name')
96
+ );
97
+ return $this;
98
+ }
99
+
100
+ /**
101
+ * Add filter by only ready fot sending item
102
+ *
103
+ * @return Mage_XmlConnect_Model_Resource_Queue_Collection
104
+ */
105
+ public function addOnlyForSendingFilter()
106
+ {
107
+ $this->getSelect()->where('main_table.status in (?)', array(Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE))
108
+ ->where('main_table.exec_time < ?', Mage::getSingleton('core/date')->gmtDate())
109
+ ->order(new Zend_Db_Expr('main_table.exec_time ' . Zend_Db_Select::SQL_ASC)
110
+ );
111
+ return $this;
112
+ }
113
+ }
app/code/core/Mage/XmlConnect/{Block/Checkout/Shipping/Method/Avaliable.php → Model/Resource/Setup.php} RENAMED
@@ -25,15 +25,12 @@
25
  */
26
 
27
  /**
28
- * Wrongly named class is now replaced
29
- * This class is an alias for properly named class
30
  *
31
- * @deprecated Misspelling has been fixed
32
  * @category Mage
33
  * @package Mage_XmlConnect
34
  * @author Magento Core Team <core@magentocommerce.com>
35
  */
36
- class Mage_XmlConnect_Block_Checkout_Shipping_Method_Avaliable
37
- extends Mage_XmlConnect_Block_Checkout_Shipping_Method_Available
38
  {
39
  }
25
  */
26
 
27
  /**
28
+ * XML Connect Setup Resource Model
 
29
  *
 
30
  * @category Mage
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Setup
 
35
  {
36
  }
app/code/core/Mage/XmlConnect/Model/Resource/Template.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * XmlConnect Model Resource Template
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_Template extends Mage_Core_Model_Resource_Db_Abstract
35
+ {
36
+ /**
37
+ * Constructor, setting table and index field
38
+ *
39
+ * @return null
40
+ */
41
+ protected function _construct()
42
+ {
43
+ $this->_init('xmlconnect/template', 'template_id');
44
+ }
45
+ }
app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Template resource collection
29
+ *
30
+ * @category Mage
31
+ * @package Mage_XmlConnect
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_XmlConnect_Model_Resource_Template_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
35
+ {
36
+ /**
37
+ * Internal constructor
38
+ *
39
+ * @return null
40
+ */
41
+ protected function _construct()
42
+ {
43
+ $this->_init('xmlconnect/template');
44
+ }
45
+
46
+ /**
47
+ * Initialize collection select
48
+ *
49
+ * @return Mage_XmlConnect_Model_Resource_Template_Collection
50
+ */
51
+ protected function _initSelect()
52
+ {
53
+ parent::_initSelect();
54
+ $this->_joinApplicationName();
55
+ return $this;
56
+ }
57
+
58
+ /**
59
+ * Join Application Name to collection
60
+ *
61
+ * @return Mage_XmlConnect_Model_Resource_Template_Collection
62
+ */
63
+ protected function _joinApplicationName()
64
+ {
65
+ $this->getSelect()->joinLeft(
66
+ array('app' => $this->getTable('xmlconnect/application')),
67
+ 'app.application_id = main_table.application_id',
68
+ array('app_name' => 'app.name', 'app_code' => 'app.code')
69
+ );
70
+ return $this;
71
+ }
72
+ }
app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php CHANGED
@@ -42,14 +42,7 @@ class Mage_XmlConnect_Model_Simplexml_Element extends Varien_Simplexml_Element
42
  public function appendChild($source)
43
  {
44
  if (sizeof($source->children())) {
45
- /**
46
- * @link http://bugs.php.net/bug.php?id=41867 , fixed in 5.2.4
47
- */
48
- if (version_compare(phpversion(), '5.2.4', '<') === true) {
49
- $name = $source->children()->getName();
50
- } else {
51
- $name = $source->getName();
52
- }
53
  $child = $this->addChild($name);
54
  } else {
55
  $child = $this->addChild($source->getName(), $this->xmlentities($source));
@@ -104,7 +97,7 @@ class Mage_XmlConnect_Model_Simplexml_Element extends Varien_Simplexml_Element
104
  *
105
  * @param string $value
106
  * @param bool $stripTags
107
- * @return string|Mage_XmlConnect_Model_Simplexml_Element|null
108
  */
109
  public function xmlAttribute($value = null, $stripTags = true)
110
  {
42
  public function appendChild($source)
43
  {
44
  if (sizeof($source->children())) {
45
+ $name = $source->getName();
 
 
 
 
 
 
 
46
  $child = $this->addChild($name);
47
  } else {
48
  $child = $this->addChild($source->getName(), $this->xmlentities($source));
97
  *
98
  * @param string $value
99
  * @param bool $stripTags
100
+ * @return string|this
101
  */
102
  public function xmlAttribute($value = null, $stripTags = true)
103
  {
app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php CHANGED
@@ -68,7 +68,7 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
68
  {
69
  parent::__construct($attributes);
70
  $this->setType('form');
71
- $this->_allElements = new Mage_XmlConnect_Model_Simplexml_Form_Element_Collection($this);
72
  }
73
 
74
  /**
@@ -76,12 +76,11 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
76
  *
77
  * @static $_defaultElementRenderer
78
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
79
- * @return void
80
  */
81
  public static function setElementRenderer(
82
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
83
- )
84
- {
85
  self::$_defaultElementRenderer = $renderer;
86
  }
87
 
@@ -90,12 +89,11 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
90
  *
91
  * @static $_defaultValidatorRenderer
92
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
93
- * @return void
94
  */
95
  public static function setValidatorRenderer(
96
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
97
- )
98
- {
99
  self::$_defaultValidatorRenderer = $renderer;
100
  }
101
 
@@ -104,12 +102,11 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
104
  *
105
  * @static $_defaultValidatorRuleRenderer
106
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
107
- * @return void
108
  */
109
  public static function setValidatorRuleRenderer(
110
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
111
- )
112
- {
113
  self::$_defaultValidatorRuleRenderer = $renderer;
114
  }
115
 
@@ -118,12 +115,11 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
118
  *
119
  * @static $_defaultFieldsetRenderer
120
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
121
- * @return void
122
  */
123
  public static function setFieldsetRenderer(
124
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
125
- )
126
- {
127
  self::$_defaultFieldsetRenderer = $renderer;
128
  }
129
 
@@ -132,12 +128,11 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
132
  *
133
  * @static $_defaultFieldsetElementRenderer
134
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
135
- * @return void
136
  */
137
  public static function setFieldsetElementRenderer(
138
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
139
- )
140
- {
141
  self::$_defaultFieldsetElementRenderer = $renderer;
142
  }
143
 
@@ -203,10 +198,7 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
203
  * @param bool $after
204
  * @return Mage_XmlConnect_Model_Simplexml_Form
205
  */
206
- public function addElement(
207
- Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element,
208
- $after = false
209
- )
210
  {
211
  $this->checkElementId($element->getId());
212
  parent::addElement($element, $after);
@@ -248,9 +240,7 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
248
  public function checkElementId($elementId)
249
  {
250
  if ($this->_elementIdExists($elementId)) {
251
- throw new Exception(
252
- Mage::helper('xmlconnect')->__('Element with id %s already exists', $elementId)
253
- );
254
  }
255
  return true;
256
  }
@@ -310,7 +300,8 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
310
  }
311
 
312
  foreach ($values as $elementId => $value) {
313
- if ($element = $this->getElement($elementId)) {
 
314
  $element->setValue($value);
315
  }
316
  }
@@ -392,9 +383,6 @@ class Mage_XmlConnect_Model_Simplexml_Form extends Mage_XmlConnect_Model_Simplex
392
  if ($this->getUseContainer()) {
393
  return $this->toXmlObject()->asNiceXml();
394
  }
395
-
396
- Mage::throwException(
397
- Mage::helper('xmlconnect')->__('Container is not defined.')
398
- );
399
  }
400
  }
68
  {
69
  parent::__construct($attributes);
70
  $this->setType('form');
71
+ $this->_allElements = Mage::getModel('xmlconnect/simplexml_form_element_collection', $this);
72
  }
73
 
74
  /**
76
  *
77
  * @static $_defaultElementRenderer
78
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
79
+ * @return null
80
  */
81
  public static function setElementRenderer(
82
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
83
+ ) {
 
84
  self::$_defaultElementRenderer = $renderer;
85
  }
86
 
89
  *
90
  * @static $_defaultValidatorRenderer
91
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
92
+ * @return null
93
  */
94
  public static function setValidatorRenderer(
95
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
96
+ ) {
 
97
  self::$_defaultValidatorRenderer = $renderer;
98
  }
99
 
102
  *
103
  * @static $_defaultValidatorRuleRenderer
104
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
105
+ * @return null
106
  */
107
  public static function setValidatorRuleRenderer(
108
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
109
+ ) {
 
110
  self::$_defaultValidatorRuleRenderer = $renderer;
111
  }
112
 
115
  *
116
  * @static $_defaultFieldsetRenderer
117
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
118
+ * @return null
119
  */
120
  public static function setFieldsetRenderer(
121
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
122
+ ) {
 
123
  self::$_defaultFieldsetRenderer = $renderer;
124
  }
125
 
128
  *
129
  * @static $_defaultFieldsetElementRenderer
130
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
131
+ * @return null
132
  */
133
  public static function setFieldsetElementRenderer(
134
  Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface $renderer
135
+ ) {
 
136
  self::$_defaultFieldsetElementRenderer = $renderer;
137
  }
138
 
198
  * @param bool $after
199
  * @return Mage_XmlConnect_Model_Simplexml_Form
200
  */
201
+ public function addElement(Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element, $after = false)
 
 
 
202
  {
203
  $this->checkElementId($element->getId());
204
  parent::addElement($element, $after);
240
  public function checkElementId($elementId)
241
  {
242
  if ($this->_elementIdExists($elementId)) {
243
+ throw new Exception(Mage::helper('xmlconnect')->__('Element with id %s already exists', $elementId));
 
 
244
  }
245
  return true;
246
  }
300
  }
301
 
302
  foreach ($values as $elementId => $value) {
303
+ $element = $this->getElement($elementId);
304
+ if ($element) {
305
  $element->setValue($value);
306
  }
307
  }
383
  if ($this->getUseContainer()) {
384
  return $this->toXmlObject()->asNiceXml();
385
  }
386
+ Mage::throwException(Mage::helper('xmlconnect')->__('Container is not defined.'));
 
 
 
387
  }
388
  }
app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php CHANGED
@@ -101,10 +101,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object
101
  protected function _prepareXmlObject()
102
  {
103
  $this->setXmlObject(
104
- Mage::getModel(
105
- 'xmlconnect/simplexml_element',
106
- '<' . $this->_mainNode . '></' . $this->_mainNode . '>'
107
- )
108
  );
109
  return $this;
110
  }
@@ -185,7 +182,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object
185
  public function getElements()
186
  {
187
  if (empty($this->_elements)) {
188
- $this->_elements = new Mage_XmlConnect_Model_Simplexml_Form_Element_Collection($this);
189
  }
190
  return $this->_elements;
191
  }
@@ -194,10 +191,10 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object
194
  * Add form element
195
  *
196
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element
197
- * @param $after
198
  * @return Mage_XmlConnect_Model_Simplexml_Form_Abstract
199
  */
200
- public function addElement(Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element, $after = null)
201
  {
202
  $element->setForm($this);
203
  $this->getElements()->add($element, $after);
@@ -225,7 +222,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object
225
  $className = 'Mage_XmlConnect_Model_Simplexml_Form_Element_' . uc_words($type);
226
  }
227
 
228
- $element = new $className($config);
229
  $element->setId($elementId);
230
  $this->addElement($element, $after);
231
  return $element;
@@ -253,7 +250,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object
253
  */
254
  public function addFieldset($elementId, $config = array(), $after = false)
255
  {
256
- $element = new Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset($config);
257
  $element->setId($elementId);
258
  $this->addElement($element, $after);
259
  return $element;
@@ -268,7 +265,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object
268
  */
269
  public function addValidator($config = array(), $after = false)
270
  {
271
- $element = new Mage_XmlConnect_Model_Simplexml_Form_Element_Validator($config);
272
  $element->setId($this->getXmlId());
273
  $this->addElement($element, $after);
274
  return $element;
@@ -394,9 +391,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object
394
  } elseif(null !== $defValue){
395
  $xmlObj->addAttribute($attribute, $xmlObj->xmlAttribute($defValue));
396
  } else {
397
- Mage::throwException(
398
- Mage::helper('xmlconnect')->__('%s attribute is required.', $attribute)
399
- );
400
  }
401
  }
402
  return $this;
@@ -511,7 +506,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object
511
  /**
512
  * Check value and return as array - attribute => value
513
  *
514
- * @param $attribute
515
  * @param mixed $value
516
  * @return array
517
  */
101
  protected function _prepareXmlObject()
102
  {
103
  $this->setXmlObject(
104
+ Mage::getModel('xmlconnect/simplexml_element', '<' . $this->_mainNode . '></' . $this->_mainNode . '>')
 
 
 
105
  );
106
  return $this;
107
  }
182
  public function getElements()
183
  {
184
  if (empty($this->_elements)) {
185
+ $this->_elements = Mage::getModel('xmlconnect/simplexml_form_element_collection', $this);
186
  }
187
  return $this->_elements;
188
  }
191
  * Add form element
192
  *
193
  * @param Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element
194
+ * @param bool|string $after
195
  * @return Mage_XmlConnect_Model_Simplexml_Form_Abstract
196
  */
197
+ public function addElement(Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element, $after = false)
198
  {
199
  $element->setForm($this);
200
  $this->getElements()->add($element, $after);
222
  $className = 'Mage_XmlConnect_Model_Simplexml_Form_Element_' . uc_words($type);
223
  }
224
 
225
+ $element = Mage::getModel($className, $config);
226
  $element->setId($elementId);
227
  $this->addElement($element, $after);
228
  return $element;
250
  */
251
  public function addFieldset($elementId, $config = array(), $after = false)
252
  {
253
+ $element = Mage::getModel('xmlconnect/simplexml_form_element_fieldset', $config);
254
  $element->setId($elementId);
255
  $this->addElement($element, $after);
256
  return $element;
265
  */
266
  public function addValidator($config = array(), $after = false)
267
  {
268
+ $element = Mage::getModel('xmlconnect/simplexml_form_element_validator', $config);
269
  $element->setId($this->getXmlId());
270
  $this->addElement($element, $after);
271
  return $element;
391
  } elseif(null !== $defValue){
392
  $xmlObj->addAttribute($attribute, $xmlObj->xmlAttribute($defValue));
393
  } else {
394
+ Mage::throwException(Mage::helper('xmlconnect')->__('%s attribute is required.', $attribute));
 
 
395
  }
396
  }
397
  return $this;
506
  /**
507
  * Check value and return as array - attribute => value
508
  *
509
+ * @param string $attribute
510
  * @param mixed $value
511
  * @return array
512
  */
app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php CHANGED
@@ -179,13 +179,7 @@ abstract class Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract
179
  */
180
  public function getXmlAttributes()
181
  {
182
- return array(
183
- 'title',
184
- 'required',
185
- 'disabled',
186
- 'visible',
187
- 'relation'
188
- );
189
  }
190
 
191
  /**
@@ -195,10 +189,7 @@ abstract class Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract
195
  */
196
  public function getRequiredXmlAttributes()
197
  {
198
- return array(
199
- 'label' => null,
200
- 'type' => null
201
- );
202
  }
203
 
204
  /**
@@ -274,10 +265,7 @@ abstract class Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract
274
  protected function _addValue(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
275
  {
276
  if ($this->getEscapedValue()) {
277
- $xmlObj->addAttribute(
278
- 'value',
279
- $xmlObj->xmlAttribute($this->getEscapedValue())
280
- );
281
  }
282
  return $this;
283
  }
179
  */
180
  public function getXmlAttributes()
181
  {
182
+ return array('title', 'required', 'disabled', 'visible', 'relation');
 
 
 
 
 
 
183
  }
184
 
185
  /**
189
  */
190
  public function getRequiredXmlAttributes()
191
  {
192
+ return array('label' => null, 'type' => null);
 
 
 
193
  }
194
 
195
  /**
265
  protected function _addValue(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
266
  {
267
  if ($this->getEscapedValue()) {
268
+ $xmlObj->addAttribute('value', $xmlObj->xmlAttribute($this->getEscapedValue()));
 
 
 
269
  }
270
  return $this;
271
  }
app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php CHANGED
@@ -39,11 +39,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
39
  *
40
  * @var array
41
  */
42
- protected $_countryListValues = array(
43
- 'country_id',
44
- 'region_id',
45
- 'region'
46
- );
47
 
48
  /**
49
  * Init country list select element
@@ -76,6 +72,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
76
  /**
77
  * Get values using old standard
78
  *
 
79
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
80
  * @return Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
81
  */
@@ -99,46 +96,25 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
99
  $selectedCountry = array('selected' => 1);
100
  }
101
 
102
- $item = $valuesXmlObj->addCustomChild('item', null, array(
103
- 'relation' => $relationType
104
- ) + $selectedCountry
105
  );
106
 
107
- $item->addCustomChild(
108
- 'label',
109
- (string)$data['label']
110
- );
111
- $item->addCustomChild(
112
- 'value',
113
- $data['value']
114
- );
115
 
116
  if ($relationType == 'region_id') {
117
  $regionsXmlObj = $item->addCustomChild('regions');
118
  foreach ($regions as $regionData) {
119
  $selectedRegion = array();
120
 
121
- if (!empty($selectedCountry)
122
- && $this->getRegionId() == $regionData['value']
123
- ) {
124
  $selectedRegion = array('selected' => 1);
125
  }
126
 
127
- $regionItem = $regionsXmlObj->addCustomChild(
128
- 'region_item',
129
- null,
130
- $selectedRegion
131
- );
132
-
133
- $regionItem->addCustomChild(
134
- 'label',
135
- (string)$regionData['label']
136
- );
137
-
138
- $regionItem->addCustomChild(
139
- 'value',
140
- (string)$regionData['value']
141
- );
142
  }
143
  }
144
  }
@@ -163,10 +139,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
163
  }
164
 
165
  if ($this->getCountryId()) {
166
- $xmlObj->addAttribute(
167
- 'value',
168
- $xmlObj->xmlAttribute($this->getCountryId())
169
- );
170
  }
171
  $countries = $this->_getCountryOptions();
172
 
@@ -186,9 +159,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
186
  }
187
 
188
  $item = $values->addCustomChild('item', null, array(
189
- 'relation' => $relationType,
190
- 'label' => (string)$data['label'],
191
- 'value' => $data['value']
192
  ));
193
 
194
  if ($relationType !== 'region') {
@@ -199,31 +170,24 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
199
  }
200
 
201
  $regionsXmlObj = $item->addCustomChild('field', null, array(
202
- 'id' => 'region_list_' . $data['value'],
203
- 'name' => 'region_id',
204
- 'label' => Mage::helper('xmlconnect')->__('State/Province'),
205
- 'type' => 'select',
206
- 'required' => 1
207
- ) + $selectedRegion
208
- );
209
 
210
  $regionValues = $regionsXmlObj->addCustomChild('values');
211
 
212
  foreach ($regions as $regionData) {
213
  $regionValues->addCustomChild('item', null, array(
214
- 'label' => (string)$regionData['label'],
215
- 'value' => (string)$regionData['value']
216
  ));
217
  }
218
  } elseif ($this->getCountryId() == $data['value']) {
219
- $item->addCustomChild('field', null, array(
220
- 'id' => 'region_' . $data['value'],
221
- 'name' => 'region',
222
- 'label' => Mage::helper('xmlconnect')->__('State/Province'),
223
- 'type' => 'text',
224
- 'value' => $this->getRegion(),
225
- 'required' => 1
226
- ));
227
  }
228
  }
229
  }
@@ -239,12 +203,11 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
239
  protected function _getRegionOptions($countryId)
240
  {
241
  $cacheKey = 'DIRECTORY_REGION_SELECT_STORE' . Mage::app()->getStore()->getId() . $countryId;
242
- if (Mage::app()->useCache('config') && $cache = Mage::app()->loadCache($cacheKey)) {
 
243
  $options = unserialize($cache);
244
  } else {
245
- $collection = Mage::getModel('directory/region')
246
- ->getResourceCollection()
247
- ->addCountryFilter($countryId)
248
  ->load();
249
  $options = $collection->toOptionArray();
250
  if (Mage::app()->useCache('config')) {
@@ -262,11 +225,11 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
262
  protected function _getCountryOptions()
263
  {
264
  $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_' . Mage::app()->getStore()->getCode();
265
- if (Mage::app()->useCache('config') && $cache = Mage::app()->loadCache($cacheKey)) {
 
266
  $options = unserialize($cache);
267
  } else {
268
- $collection = Mage::getModel('directory/country')->getResourceCollection()
269
- ->loadByStore();
270
  $options = $collection->toOptionArray(false);
271
  if (Mage::app()->useCache('config')) {
272
  Mage::app()->saveCache(serialize($options), $cacheKey, array('config'));
39
  *
40
  * @var array
41
  */
42
+ protected $_countryListValues = array('country_id', 'region_id', 'region');
 
 
 
 
43
 
44
  /**
45
  * Init country list select element
72
  /**
73
  * Get values using old standard
74
  *
75
+ * @deprecated old output standard
76
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
77
  * @return Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
78
  */
96
  $selectedCountry = array('selected' => 1);
97
  }
98
 
99
+ $item = $valuesXmlObj->addCustomChild('item', null,
100
+ array('relation' => $relationType) + $selectedCountry
 
101
  );
102
 
103
+ $item->addCustomChild('label', (string)$data['label']);
104
+ $item->addCustomChild('value', $data['value']);
 
 
 
 
 
 
105
 
106
  if ($relationType == 'region_id') {
107
  $regionsXmlObj = $item->addCustomChild('regions');
108
  foreach ($regions as $regionData) {
109
  $selectedRegion = array();
110
 
111
+ if (!empty($selectedCountry) && $this->getRegionId() == $regionData['value']) {
 
 
112
  $selectedRegion = array('selected' => 1);
113
  }
114
 
115
+ $regionItem = $regionsXmlObj->addCustomChild('region_item', null, $selectedRegion);
116
+ $regionItem->addCustomChild('label', (string)$regionData['label']);
117
+ $regionItem->addCustomChild('value', (string)$regionData['value']);
 
 
 
 
 
 
 
 
 
 
 
 
118
  }
119
  }
120
  }
139
  }
140
 
141
  if ($this->getCountryId()) {
142
+ $xmlObj->addAttribute('value', $xmlObj->xmlAttribute($this->getCountryId()));
 
 
 
143
  }
144
  $countries = $this->_getCountryOptions();
145
 
159
  }
160
 
161
  $item = $values->addCustomChild('item', null, array(
162
+ 'relation' => $relationType, 'label' => (string)$data['label'], 'value' => $data['value']
 
 
163
  ));
164
 
165
  if ($relationType !== 'region') {
170
  }
171
 
172
  $regionsXmlObj = $item->addCustomChild('field', null, array(
173
+ 'id' => 'region_list_' . $data['value'], 'name' => 'region_id',
174
+ 'label' => Mage::helper('xmlconnect')->__('State/Province'), 'type' => 'select',
175
+ 'required' => 1
176
+ ) + $selectedRegion);
 
 
 
177
 
178
  $regionValues = $regionsXmlObj->addCustomChild('values');
179
 
180
  foreach ($regions as $regionData) {
181
  $regionValues->addCustomChild('item', null, array(
182
+ 'label' => (string)$regionData['label'], 'value' => (string)$regionData['value']
 
183
  ));
184
  }
185
  } elseif ($this->getCountryId() == $data['value']) {
186
+ $item->addCustomChild('field', null, array(
187
+ 'id' => 'region_' . $data['value'], 'name' => 'region',
188
+ 'label' => Mage::helper('xmlconnect')->__('State/Province'), 'type' => 'text',
189
+ 'value' => $this->getRegion(), 'required' => 1
190
+ ));
 
 
 
191
  }
192
  }
193
  }
203
  protected function _getRegionOptions($countryId)
204
  {
205
  $cacheKey = 'DIRECTORY_REGION_SELECT_STORE' . Mage::app()->getStore()->getId() . $countryId;
206
+ $cache = Mage::app()->loadCache($cacheKey);
207
+ if (Mage::app()->useCache('config') && $cache) {
208
  $options = unserialize($cache);
209
  } else {
210
+ $collection = Mage::getModel('directory/region')->getResourceCollection()->addCountryFilter($countryId)
 
 
211
  ->load();
212
  $options = $collection->toOptionArray();
213
  if (Mage::app()->useCache('config')) {
225
  protected function _getCountryOptions()
226
  {
227
  $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_' . Mage::app()->getStore()->getCode();
228
+ $cache = Mage::app()->loadCache($cacheKey);
229
+ if (Mage::app()->useCache('config') && $cache) {
230
  $options = unserialize($cache);
231
  } else {
232
+ $collection = Mage::getModel('directory/country')->getResourceCollection()->loadByStore();
 
233
  $options = $collection->toOptionArray(false);
234
  if (Mage::app()->useCache('config')) {
235
  Mage::app()->saveCache(serialize($options), $cacheKey, array('config'));
app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php CHANGED
@@ -67,7 +67,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset
67
  *
68
  * @param array $attributes
69
  */
70
- public function __construct($attributes=array())
71
  {
72
  parent::__construct($attributes);
73
  $this->_renderer = Mage_XmlConnect_Model_Simplexml_Form::getFieldsetRenderer();
@@ -84,22 +84,15 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset
84
  $xmlObj = $this->getXmlObject();
85
  $this->_addRequiredAttributes($xmlObj);
86
  foreach ($this->getAttributes() as $key => $val) {
87
- $xmlObj->addAttribute(
88
- $key,
89
- $xmlObj->xmlAttribute($val)
90
- );
91
  }
92
-
93
- foreach ($this->getChildrenXml() as $element) {
94
  $xmlObj->appendChild($element);
95
  }
96
-
97
- foreach ($this->getSubFieldsetXml() as $fieldset) {
98
  $xmlObj->appendChild($fieldset);
99
  }
100
-
101
  $this->addAfterXmlElementToObj($xmlObj);
102
-
103
  return $xmlObj;
104
  }
105
 
@@ -126,13 +119,14 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset
126
  /**
127
  * Get children array of elements
128
  *
 
129
  * @return array
130
  */
131
- public function getChildrenXml()
132
  {
133
  $result = array();
134
  foreach ($this->getSortedElements() as $element) {
135
- if ($element->getType() != 'fieldset') {
136
  $result[] = $element->toXmlObject();
137
  }
138
  }
@@ -140,19 +134,18 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset
140
  }
141
 
142
  /**
143
- * Get sub fieldset xml
144
  *
145
- * @return array
 
 
146
  */
147
- public function getSubFieldsetXml()
148
- {
149
- $result = array();
150
- foreach ($this->getSortedElements() as $element) {
151
- if ($element->getType() == 'fieldset') {
152
- $result[] = $element->toXmlObject();
153
- }
154
  }
155
- return $result;
156
  }
157
 
158
  /**
67
  *
68
  * @param array $attributes
69
  */
70
+ public function __construct($attributes = array())
71
  {
72
  parent::__construct($attributes);
73
  $this->_renderer = Mage_XmlConnect_Model_Simplexml_Form::getFieldsetRenderer();
84
  $xmlObj = $this->getXmlObject();
85
  $this->_addRequiredAttributes($xmlObj);
86
  foreach ($this->getAttributes() as $key => $val) {
87
+ $xmlObj->addAttribute($key, $xmlObj->xmlAttribute($val));
 
 
 
88
  }
89
+ foreach ($this->getChildrenXml(false) as $element) {
 
90
  $xmlObj->appendChild($element);
91
  }
92
+ foreach ($this->getChildrenXml(true) as $fieldset) {
 
93
  $xmlObj->appendChild($fieldset);
94
  }
 
95
  $this->addAfterXmlElementToObj($xmlObj);
 
96
  return $xmlObj;
97
  }
98
 
119
  /**
120
  * Get children array of elements
121
  *
122
+ * @param bool $isFieldset
123
  * @return array
124
  */
125
+ public function getChildrenXml($isFieldset = false)
126
  {
127
  $result = array();
128
  foreach ($this->getSortedElements() as $element) {
129
+ if ($this->_checkFieldset($element, $isFieldset)) {
130
  $result[] = $element->toXmlObject();
131
  }
132
  }
134
  }
135
 
136
  /**
137
+ * Check weather is element a fieldset
138
  *
139
+ * @param Mage_XmlConnect_Model_Simplexml_Form_Abstract $element
140
+ * @param bool $equal
141
+ * @return bool
142
  */
143
+ protected function _checkFieldset($element, $equal = true) {
144
+ if ($equal) {
145
+ return $element->getType() == 'fieldset';
146
+ } else {
147
+ return $element->getType() != 'fieldset';
 
 
148
  }
 
149
  }
150
 
151
  /**
app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php CHANGED
@@ -122,10 +122,9 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Multiline
122
  $value = !empty($values[$i]) ? array('value' => $values[$i]) : array();
123
 
124
  $valuesXmlObj->addCustomChild('item', null, array(
125
- 'id' => $this->getXmlId($i),
126
- 'name' => $this->getFieldName($i)
127
- ) + $value
128
- );
129
  }
130
  }
131
  return $this;
122
  $value = !empty($values[$i]) ? array('value' => $values[$i]) : array();
123
 
124
  $valuesXmlObj->addCustomChild('item', null, array(
125
+ 'id' => $this->getXmlId($i),
126
+ 'name' => $this->getFieldName($i)
127
+ ) + $value);
 
128
  }
129
  }
130
  return $this;
app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php CHANGED
@@ -71,10 +71,9 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Multiselect
71
  }
72
 
73
  $valuesXmlObj->addCustomChild('item', null, array(
74
- 'label' => $option['label'],
75
- 'value' => $option['value']
76
- ) + $selected
77
- );
78
  }
79
 
80
  return $this;
71
  }
72
 
73
  $valuesXmlObj->addCustomChild('item', null, array(
74
+ 'label' => $option['label'],
75
+ 'value' => $option['value']
76
+ ) + $selected);
 
77
  }
78
 
79
  return $this;
app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php CHANGED
@@ -71,22 +71,21 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Abstract
71
  */
72
  protected function _setDefaultValidatorTypeMessages()
73
  {
74
- $helper = Mage::helper('xmlconnect');
75
  $this->_validatorTypeMessages = array(
76
- 'min_length' => $helper->__('Text length does not satisfy specified min text range.'),
77
- 'max_length' => $helper->__('Text length does not satisfy specified max text range.'),
78
- 'alphanumeric' => $helper->__('Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'),
79
- 'email' => $helper->__('Please enter a valid email address. For example johndoe@domain.com.'),
80
- 'required' => $helper->__('This is a required field.'),
81
- 'required_select' => $helper->__('Please select an option.'),
82
- 'numeric' => $helper->__('Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'),
83
- 'alpha' => $helper->__('Please use letters only (a-z or A-Z) in this field.'),
84
- 'url' => $helper->__('Please enter a valid URL. Protocol is required (http://, https:// or ftp://)'),
85
- 'date' => $helper->__('Please enter a valid date.'),
86
- 'max_file_size' => $helper->__('\'%s\' exceeds the allowed file size: %d (bytes)', $this->getFieldLabel(), $this->getValue()),
87
- 'file_extensions' => $helper->__('\'%s\' is not a valid file extension. Allowed extensions: %s', $this->getFieldLabel(), $this->getValue()),
88
- 'max_image_width' => $helper->__('\'%s\' width exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()),
89
- 'max_image_height' => $helper->__('\'%s\' height exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue())
90
  );
91
  return $this;
92
  }
@@ -111,9 +110,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Abstract
111
  } elseif(null !== $defValue){
112
  $xmlObj->addAttribute($attribute, $xmlObj->xmlAttribute($defValue));
113
  } else {
114
- Mage::throwException(
115
- Mage::helper('xmlconnect')->__('%s attribute is required.', $attribute)
116
- );
117
  }
118
  }
119
  $this->_addMessage($xmlObj);
@@ -178,12 +175,9 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Abstract
178
  * @param array $validatorTypeMessages
179
  * @return Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Abstract
180
  */
181
- public function setValidatorTypeMessages(array $validatorTypeMessages)
182
  {
183
- $this->_validatorTypeMessages = array_merge(
184
- $this->_validatorTypeMessages,
185
- $validatorTypeMessages
186
- );
187
  return $this;
188
  }
189
  }
71
  */
72
  protected function _setDefaultValidatorTypeMessages()
73
  {
 
74
  $this->_validatorTypeMessages = array(
75
+ 'min_length' => Mage::helper('xmlconnect')->__('Text length does not satisfy specified min text range.'),
76
+ 'max_length' => Mage::helper('xmlconnect')->__('Text length does not satisfy specified max text range.'),
77
+ 'alphanumeric' => Mage::helper('xmlconnect')->__('Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'),
78
+ 'email' => Mage::helper('xmlconnect')->__('Please enter a valid email address. For example johndoe@domain.com.'),
79
+ 'required' => Mage::helper('xmlconnect')->__('This is a required field.'),
80
+ 'required_select' => Mage::helper('xmlconnect')->__('Please select an option.'),
81
+ 'numeric' => Mage::helper('xmlconnect')->__('Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'),
82
+ 'alpha' => Mage::helper('xmlconnect')->__('Please use letters only (a-z or A-Z) in this field.'),
83
+ 'url' => Mage::helper('xmlconnect')->__('Please enter a valid URL. Protocol is required (http://, https:// or ftp://)'),
84
+ 'date' => Mage::helper('xmlconnect')->__('Please enter a valid date.'),
85
+ 'max_file_size' => Mage::helper('xmlconnect')->__('\'%s\' exceeds the allowed file size: %d (bytes)', $this->getFieldLabel(), $this->getValue()),
86
+ 'file_extensions' => Mage::helper('xmlconnect')->__('\'%s\' is not a valid file extension. Allowed extensions: %s', $this->getFieldLabel(), $this->getValue()),
87
+ 'max_image_width' => Mage::helper('xmlconnect')->__('\'%s\' width exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()),
88
+ 'max_image_height' => Mage::helper('xmlconnect')->__('\'%s\' height exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue())
89
  );
90
  return $this;
91
  }
110
  } elseif(null !== $defValue){
111
  $xmlObj->addAttribute($attribute, $xmlObj->xmlAttribute($defValue));
112
  } else {
113
+ Mage::throwException(Mage::helper('xmlconnect')->__('%s attribute is required.', $attribute));
 
 
114
  }
115
  }
116
  $this->_addMessage($xmlObj);
175
  * @param array $validatorTypeMessages
176
  * @return Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Abstract
177
  */
178
+ public function addValidatorTypeMessages(array $validatorTypeMessages)
179
  {
180
+ $this->_validatorTypeMessages = array_merge($this->_validatorTypeMessages, $validatorTypeMessages);
 
 
 
181
  return $this;
182
  }
183
  }
app/code/core/Mage/XmlConnect/Model/Template.php CHANGED
@@ -36,7 +36,7 @@ class Mage_XmlConnect_Model_Template extends Mage_Core_Model_Template
36
  /**
37
  * Model constructor
38
  *
39
- * @return void
40
  */
41
  protected function _construct()
42
  {
36
  /**
37
  * Model constructor
38
  *
39
+ * @return null
40
  */
41
  protected function _construct()
42
  {
app/code/core/Mage/XmlConnect/Model/Theme.php CHANGED
@@ -172,14 +172,8 @@ class Mage_XmlConnect_Model_Theme
172
  /** @var $coreHelper Mage_Core_Helper_Data */
173
  $coreHelper = Mage::helper('core');
174
 
175
- $themeFileName = $themesHelper->getMediaThemePath()
176
- . DS
177
- .$themesHelper->getCustomThemeName()
178
- . '_'
179
- . time()
180
- . '_'
181
- . $coreHelper->getRandomString(10, 'abcdefghijklmnopqrstuvwxyz0123456789')
182
- . '.xml';
183
  return $themeFileName;
184
  }
185
 
@@ -298,7 +292,7 @@ class Mage_XmlConnect_Model_Theme
298
  *
299
  * @param SimpleXMLElement $parent
300
  * @param array $data
301
- * @return void
302
  */
303
  protected function _buildRecursive($parent, $data)
304
  {
@@ -315,7 +309,7 @@ class Mage_XmlConnect_Model_Theme
315
  * Import data into theme form $data array, and save XML to file
316
  *
317
  * @param array $data
318
- * @return void
319
  */
320
  public function importAndSaveData($data)
321
  {
@@ -325,9 +319,7 @@ class Mage_XmlConnect_Model_Theme
325
  if (is_writeable($this->_file)) {
326
  file_put_contents($this->_file, $xml->asXML());
327
  } else {
328
- Mage::throwException(
329
- Mage::helper('xmlconnect')->__('Can\'t write to file "%s".', $this->_file)
330
- );
331
  }
332
  }
333
  }
172
  /** @var $coreHelper Mage_Core_Helper_Data */
173
  $coreHelper = Mage::helper('core');
174
 
175
+ $themeFileName = $themesHelper->getMediaThemePath() . DS .$themesHelper->getCustomThemeName() . '_' . time()
176
+ . '_' . $coreHelper->getRandomString(10, 'abcdefghijklmnopqrstuvwxyz0123456789') . '.xml';
 
 
 
 
 
 
177
  return $themeFileName;
178
  }
179
 
292
  *
293
  * @param SimpleXMLElement $parent
294
  * @param array $data
295
+ * @return null
296
  */
297
  protected function _buildRecursive($parent, $data)
298
  {
309
  * Import data into theme form $data array, and save XML to file
310
  *
311
  * @param array $data
312
+ * @return null
313
  */
314
  public function importAndSaveData($data)
315
  {
319
  if (is_writeable($this->_file)) {
320
  file_put_contents($this->_file, $xml->asXML());
321
  } else {
322
+ Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t write to file "%s".', $this->_file));
 
 
323
  }
324
  }
325
  }
app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php CHANGED
@@ -83,7 +83,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
83
  /**
84
  * Mobile applications management
85
  *
86
- * @return void
87
  */
88
  public function indexAction()
89
  {
@@ -95,7 +95,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
95
  /**
96
  * Create new app
97
  *
98
- * @return void
99
  */
100
  public function newAction()
101
  {
@@ -108,7 +108,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
108
  /**
109
  * Submission Action, loads application data
110
  *
111
- * @return void
112
  */
113
  public function submissionAction()
114
  {
@@ -152,7 +152,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
152
  /**
153
  * Edit app form
154
  *
155
- * @return void
156
  */
157
  public function editAction()
158
  {
@@ -209,7 +209,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
209
  /**
210
  * Submit POST application action
211
  *
212
- * @return void
213
  */
214
  public function submissionPostAction()
215
  {
@@ -238,20 +238,16 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
238
  $this->_processPostRequest();
239
  $history = Mage::getModel('xmlconnect/history');
240
  $history->setData(array(
241
- 'params' => $params,
242
- 'application_id' => $app->getId(),
243
- 'created_at' => Mage::getModel('core/date')->date(),
244
- 'store_id' => $app->getStoreId(),
245
- 'title' => isset($params['title']) ? $params['title'] : '',
246
- 'name' => $app->getName(),
247
- 'code' => $app->getCode(),
248
- 'activation_key' => isset($params['resubmission_activation_key'])
249
- ? $params['resubmission_activation_key']
250
- : $params['key'],
251
  ));
252
  $history->save();
253
- $app->getResource()->updateApplicationStatus($app->getId(),
254
- Mage_XmlConnect_Model_Application::APP_STATUS_SUCCESS);
 
255
  $this->_getSession()->addSuccess($this->__('App has been submitted.'));
256
  $this->_clearSessionData();
257
  $this->_redirect('*/*/edit', array('application_id' => $app->getId()));
@@ -316,30 +312,34 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
316
  /**
317
  * Send HTTP POST request to magentocommerce.com
318
  *
319
- * @return void
320
  */
321
  protected function _processPostRequest()
322
  {
323
  try {
 
324
  $app = Mage::helper('xmlconnect')->getApplication();
325
  $params = $app->getSubmitParams();
326
 
327
  $appConnectorUrl = Mage::getStoreConfig('xmlconnect/mobile_application/magentocommerce_url');
328
- $curlHandler = curl_init($appConnectorUrl . $params['key']);
329
-
330
- // set URL and other appropriate options
331
- curl_setopt($curlHandler, CURLOPT_POST, 1);
332
- curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $params);
333
- curl_setopt($curlHandler, CURLOPT_SSL_VERIFYHOST, 2);
334
- curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, 1);
335
- curl_setopt($curlHandler, CURLOPT_SSL_VERIFYPEER, FALSE);
336
- curl_setopt($curlHandler, CURLOPT_TIMEOUT, 60);
337
 
338
- // Execute the request.
339
- $result = curl_exec($curlHandler);
340
-
341
- // close cURL resource, and free up system resources
342
- curl_close($curlHandler);
 
 
 
 
 
 
 
 
 
 
 
 
343
 
344
  // Assert that we received an expected message in reponse.
345
  $resultArray = json_decode($result, true);
@@ -363,7 +363,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
363
  /**
364
  * Save action
365
  *
366
- * @return void
367
  */
368
  public function saveAction()
369
  {
@@ -483,15 +483,9 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
483
  );
484
  }
485
  } catch (Mage_Core_Exception $e) {
486
- $response = array(
487
- 'error' => true,
488
- 'message' => $e->getMessage(),
489
- );
490
  } catch (Exception $e) {
491
- $response = array(
492
- 'error' => true,
493
- 'message' => $this->__('Can\'t save theme.')
494
- );
495
  }
496
  } else {
497
  $response = array('error' => true, 'message' => $this->__('Theme name is not set.'));
@@ -517,7 +511,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
517
  $parts = explode('_', $key);
518
  // "4" - is number of expected params conf_native_bar_tintcolor in correct data
519
  if (is_array($parts) && count($parts) == 4) {
520
- @list(, $key1, $key2, $key3) = $parts;
521
  if (!isset($conf[$key1])) {
522
  $conf[$key1] = array();
523
  }
@@ -530,21 +524,10 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
530
  return $conf;
531
  }
532
 
533
- /**
534
- * Save Theme action
535
- *
536
- * @return void
537
- */
538
- public function saveThemeAction()
539
- {
540
- $data = $this->getRequest()->getPost();
541
- $this->_saveThemeAction($data);
542
- }
543
-
544
  /**
545
  * Delete theme action
546
  *
547
- * @return void
548
  */
549
  public function deleteThemeAction()
550
  {
@@ -568,10 +551,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
568
  );
569
  }
570
  } catch (Mage_Core_Exception $e) {
571
- $response = array(
572
- 'error' => true,
573
- 'message' => $e->getMessage(),
574
- );
575
  } catch (Exception $e) {
576
  $response = array(
577
  'error' => true,
@@ -588,9 +568,20 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
588
  }
589
 
590
  /**
591
- * Reset Theme action
 
 
 
 
 
 
 
 
 
 
 
592
  *
593
- * @return void
594
  */
595
  public function resetThemeAction()
596
  {
@@ -599,15 +590,9 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
599
  Mage::helper('xmlconnect/theme')->resetTheme($theme);
600
  $response = Mage::helper('xmlconnect/theme')->getAllThemesArray(true);
601
  } catch (Mage_Core_Exception $e) {
602
- $response = array(
603
- 'error' => true,
604
- 'message' => $e->getMessage(),
605
- );
606
  } catch (Exception $e) {
607
- $response = array(
608
- 'error' => true,
609
- 'message' => $this->__('Can\'t reset theme.')
610
- );
611
  }
612
  if (is_array($response)) {
613
  $response = Mage::helper('core')->jsonEncode($response);
@@ -618,7 +603,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
618
  /**
619
  * Preview Home action handler
620
  *
621
- * @return void
622
  */
623
  public function previewHomeAction()
624
  {
@@ -636,7 +621,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
636
  /**
637
  * Preview Catalog action handler
638
  *
639
- * @return void
640
  */
641
  public function previewCatalogAction()
642
  {
@@ -734,7 +719,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
734
  /**
735
  * Delete app action
736
  *
737
- * @return void
738
  */
739
  public function deleteAction()
740
  {
@@ -766,9 +751,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
766
  Mage::getModel('xmlconnect/template')->load($id)->delete();
767
 
768
  // display success message
769
- Mage::getSingleton('adminhtml/session')->addSuccess(
770
- $this->__('Template has been deleted.')
771
- );
772
 
773
  // go to grid
774
  $this->_redirect('*/*/template');
@@ -784,9 +767,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
784
  }
785
 
786
  // display error message
787
- Mage::getSingleton('adminhtml/session')->addError(
788
- $this->__('Unable to find template to delete.')
789
- );
790
  }
791
 
792
  /**
@@ -812,7 +793,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
812
  /**
813
  * Render apps grid
814
  *
815
- * @return void
816
  */
817
  public function gridAction()
818
  {
@@ -823,7 +804,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
823
 
824
  /**
825
  * Process all uploaded files
826
- * setup filenames to the configuration return array
827
  *
828
  * @param array $data
829
  * @param bool $restore
@@ -971,7 +952,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
971
  /**
972
  * List AirMail message queue grid
973
  *
974
- * @return void
975
  */
976
  public function queueAction()
977
  {
@@ -983,7 +964,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
983
  /**
984
  * Edit message action
985
  *
986
- * @return void
987
  */
988
  public function editQueueAction()
989
  {
@@ -1010,7 +991,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1010
  /**
1011
  * Cancel queue action
1012
  *
1013
- * @return void
1014
  */
1015
  public function cancelQueueAction()
1016
  {
@@ -1037,7 +1018,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1037
  /**
1038
  * Delete queue action
1039
  *
1040
- * @return void
1041
  */
1042
  public function deleteQueueAction()
1043
  {
@@ -1064,7 +1045,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1064
  /**
1065
  * Cancel selected queue action
1066
  *
1067
- * @return void
1068
  */
1069
  public function massCancelQueueAction()
1070
  {
@@ -1075,9 +1056,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1075
  try {
1076
  $queue = Mage::getModel('xmlconnect/queue');
1077
  foreach ($queueIds as $queueId) {
1078
- $queue->reset()
1079
- ->load((int)$queueId)
1080
- ->setStatus(Mage_XmlConnect_Model_Queue::STATUS_CANCELED)
1081
  ->save();
1082
  }
1083
  Mage::getSingleton('adminhtml/session')->addSuccess(
@@ -1094,7 +1073,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1094
  /**
1095
  * Delete selected queue action
1096
  *
1097
- * @return void
1098
  */
1099
  public function massDeleteQueueAction()
1100
  {
@@ -1105,15 +1084,10 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1105
  try {
1106
  $queue = Mage::getModel('xmlconnect/queue');
1107
  foreach ($queueIds as $queueId) {
1108
- $queue->reset()
1109
- ->load($queueId)
1110
- ->setStatus(Mage_XmlConnect_Model_Queue::STATUS_DELETED)
1111
- ->save();
1112
  }
1113
  Mage::getSingleton('adminhtml/session')->addSuccess(
1114
- Mage::helper('adminhtml')->__(
1115
- 'Total of %d record(s) were deleted.', count($queueIds)
1116
- )
1117
  );
1118
  } catch (Exception $e) {
1119
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
@@ -1126,7 +1100,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1126
  /**
1127
  * Save AirMail message action
1128
  *
1129
- * @return void
1130
  */
1131
  public function saveMessageAction()
1132
  {
@@ -1136,14 +1110,12 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1136
 
1137
  if ($data) {
1138
  try {
1139
- $data = Mage::getModel('xmlconnect/input_filter_maliciousCode')->filter($data);
1140
  $template = $this->_initTemplate('template_id');
1141
  $message = $this->_initMessage();
1142
 
1143
  if (!$template->getId() && !$message->getTemplateId()) {
1144
- $this->_getSession()->addError(
1145
- $this->__('Template for new AirMail Message does not exist.')
1146
- );
1147
  $this->_redirect('*/*/queue');
1148
  return;
1149
  }
@@ -1155,9 +1127,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1155
  if ($deviceType == Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID
1156
  && $data['type'] == Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL
1157
  ) {
1158
- $this->_getSession()->addError(
1159
- $this->__('Android doesn\'t support AirMail message type.')
1160
- );
1161
  $redirectParams = $this->_getQueueMessageParams($message);
1162
  $action = $message->getId() ? 'editQueue' : 'queueMessage';
1163
  $this->_redirect('*/*/' . $action, $redirectParams);
@@ -1249,7 +1219,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1249
  /**
1250
  * Temlate grid
1251
  *
1252
- * @return void
1253
  */
1254
  public function templateAction()
1255
  {
@@ -1261,7 +1231,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1261
  /**
1262
  * Create new template action
1263
  *
1264
- * @return void
1265
  */
1266
  public function newTemplateAction()
1267
  {
@@ -1271,7 +1241,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1271
  /**
1272
  * Edit template action
1273
  *
1274
- * @return void
1275
  */
1276
  public function editTemplateAction()
1277
  {
@@ -1279,9 +1249,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1279
 
1280
  $applicationsFound = Mage::helper('xmlconnect')->getApplicationOptions();
1281
  if (!$template->getId() && empty($applicationsFound)) {
1282
- $this->_getSession()->addError(
1283
- $this->__('At last one application has to be created.')
1284
- );
1285
  $this->_redirect('*/*/template');
1286
  return;
1287
  }
@@ -1294,7 +1262,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1294
  /**
1295
  * Save template action
1296
  *
1297
- * @return void
1298
  */
1299
  public function saveTemplateAction()
1300
  {
@@ -1302,7 +1270,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1302
  $template = false;
1303
  $isError = false;
1304
  if ($data) {
1305
- $data = Mage::getModel('xmlconnect/input_filter_maliciousCode')->filter($data);
1306
  Mage::getSingleton('adminhtml/session')->setTemplateFormData($data);
1307
  try {
1308
  $id = $this->getRequest()->getParam('id');
@@ -1335,7 +1303,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1335
  /**
1336
  * Add message to queue action
1337
  *
1338
- * @return void
1339
  */
1340
  public function queueMessageAction()
1341
  {
@@ -1343,23 +1311,19 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1343
  if (!$message->getId()) {
1344
  $template = $this->_initTemplate('template_id');
1345
  if (!$template->getId()) {
1346
- $this->_getSession()->addError(
1347
- $this->__('Template for new AirMail Message does not exist.')
1348
- );
1349
  $this->_redirect('*/*/template');
1350
  }
1351
  }
1352
 
1353
  if (isset($template)) {
1354
- $appCode = $template->getAppCode();
1355
  } else {
1356
- $appCode = Mage::getModel('xmlconnect/template')
1357
- ->load($message->getTemplateId())
1358
- ->getAppCode();
1359
  }
1360
 
1361
  /** @var $app Mage_XmlConnect_Model_Application */
1362
- $app = Mage::getModel('xmlconnect/application')->loadByCode($appCode);
1363
 
1364
  if(!$app->isNotificationsActive()) {
1365
  $this->_getSession()->addError(
@@ -1376,9 +1340,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1376
  } else {
1377
  $title = $this->__('New AirMail Message');
1378
  }
1379
- $this->_addBreadcrumb(
1380
- $this->__('AirMail Message Queue'),
1381
- $this->__('AirMail Message Queue'),
1382
  $this->getUrl('*/*/queue')
1383
  );
1384
  $this->_addBreadcrumb($title, $title);
@@ -1390,7 +1352,7 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
1390
  /**
1391
  * Edit queue message action
1392
  *
1393
- * @return void
1394
  */
1395
  public function editMessageAction()
1396
  {
83
  /**
84
  * Mobile applications management
85
  *
86
+ * @return null
87
  */
88
  public function indexAction()
89
  {
95
  /**
96
  * Create new app
97
  *
98
+ * @return null
99
  */
100
  public function newAction()
101
  {
108
  /**
109
  * Submission Action, loads application data
110
  *
111
+ * @return null
112
  */
113
  public function submissionAction()
114
  {
152
  /**
153
  * Edit app form
154
  *
155
+ * @return null
156
  */
157
  public function editAction()
158
  {
209
  /**
210
  * Submit POST application action
211
  *
212
+ * @return null
213
  */
214
  public function submissionPostAction()
215
  {
238
  $this->_processPostRequest();
239
  $history = Mage::getModel('xmlconnect/history');
240
  $history->setData(array(
241
+ 'params' => $params, 'application_id' => $app->getId(),
242
+ 'created_at' => Mage::getModel('core/date')->date(), 'store_id' => $app->getStoreId(),
243
+ 'title' => isset($params['title']) ? $params['title'] : '', 'name' => $app->getName(),
244
+ 'code' => $app->getCode(), 'activation_key' => isset($params['resubmission_activation_key'])
245
+ ? $params['resubmission_activation_key'] : $params['key'],
 
 
 
 
 
246
  ));
247
  $history->save();
248
+ $app->getResource()->updateApplicationStatus(
249
+ $app->getId(), Mage_XmlConnect_Model_Application::APP_STATUS_SUCCESS
250
+ );
251
  $this->_getSession()->addSuccess($this->__('App has been submitted.'));
252
  $this->_clearSessionData();
253
  $this->_redirect('*/*/edit', array('application_id' => $app->getId()));
312
  /**
313
  * Send HTTP POST request to magentocommerce.com
314
  *
315
+ * @return null
316
  */
317
  protected function _processPostRequest()
318
  {
319
  try {
320
+ /** @var $app Mage_XmlConnect_Model_Application */
321
  $app = Mage::helper('xmlconnect')->getApplication();
322
  $params = $app->getSubmitParams();
323
 
324
  $appConnectorUrl = Mage::getStoreConfig('xmlconnect/mobile_application/magentocommerce_url');
 
 
 
 
 
 
 
 
 
325
 
326
+ $curl = new Varien_Http_Adapter_Curl();
327
+ $verifyPeerValue = Mage::getStoreConfig('xmlconnect/mobile_application/curl_ssl_verifypeer');
328
+ $curl->setConfig(array(
329
+ 'timeout' => Mage_XmlConnect_Helper_Data::CURLOPT_DEFAULT_TIMEOUT,
330
+ 'verifypeer' => $verifyPeerValue, 'verifyhost' => 2, 'header' => false
331
+ ));
332
+
333
+ $mCommerceUrl = $appConnectorUrl . $params['key'];
334
+ $curl->write(Zend_Http_Client::POST, $mCommerceUrl, CURL_HTTP_VERSION_1_1, array(), $params);
335
+
336
+ $result = $curl->read();
337
+ if(false === $result) {
338
+ Mage::log('Curl error: ' . $curl->getError());
339
+ $curl->close();
340
+ Mage::throwException($this->__('Request internal error.'));
341
+ }
342
+ $curl->close();
343
 
344
  // Assert that we received an expected message in reponse.
345
  $resultArray = json_decode($result, true);
363
  /**
364
  * Save action
365
  *
366
+ * @return null
367
  */
368
  public function saveAction()
369
  {
483
  );
484
  }
485
  } catch (Mage_Core_Exception $e) {
486
+ $response = array('error' => true, 'message' => $e->getMessage());
 
 
 
487
  } catch (Exception $e) {
488
+ $response = array('error' => true, 'message' => $this->__('Can\'t save theme.'));
 
 
 
489
  }
490
  } else {
491
  $response = array('error' => true, 'message' => $this->__('Theme name is not set.'));
511
  $parts = explode('_', $key);
512
  // "4" - is number of expected params conf_native_bar_tintcolor in correct data
513
  if (is_array($parts) && count($parts) == 4) {
514
+ list(, $key1, $key2, $key3) = $parts;
515
  if (!isset($conf[$key1])) {
516
  $conf[$key1] = array();
517
  }
524
  return $conf;
525
  }
526
 
 
 
 
 
 
 
 
 
 
 
 
527
  /**
528
  * Delete theme action
529
  *
530
+ * @return null
531
  */
532
  public function deleteThemeAction()
533
  {
551
  );
552
  }
553
  } catch (Mage_Core_Exception $e) {
554
+ $response = array('error' => true, 'message' => $e->getMessage());
 
 
 
555
  } catch (Exception $e) {
556
  $response = array(
557
  'error' => true,
568
  }
569
 
570
  /**
571
+ * Save Theme action
572
+ *
573
+ * @return null
574
+ */
575
+ public function saveThemeAction()
576
+ {
577
+ $data = $this->getRequest()->getPost();
578
+ $this->_saveThemeAction($data);
579
+ }
580
+
581
+ /**
582
+ * Save Theme action
583
  *
584
+ * @return null
585
  */
586
  public function resetThemeAction()
587
  {
590
  Mage::helper('xmlconnect/theme')->resetTheme($theme);
591
  $response = Mage::helper('xmlconnect/theme')->getAllThemesArray(true);
592
  } catch (Mage_Core_Exception $e) {
593
+ $response = array('error' => true, 'message' => $e->getMessage());
 
 
 
594
  } catch (Exception $e) {
595
+ $response = array('error' => true, 'message' => $this->__('Can\'t reset theme.'));
 
 
 
596
  }
597
  if (is_array($response)) {
598
  $response = Mage::helper('core')->jsonEncode($response);
603
  /**
604
  * Preview Home action handler
605
  *
606
+ * @return null
607
  */
608
  public function previewHomeAction()
609
  {
621
  /**
622
  * Preview Catalog action handler
623
  *
624
+ * @return null
625
  */
626
  public function previewCatalogAction()
627
  {
719
  /**
720
  * Delete app action
721
  *
722
+ * @return null
723
  */
724
  public function deleteAction()
725
  {
751
  Mage::getModel('xmlconnect/template')->load($id)->delete();
752
 
753
  // display success message
754
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Template has been deleted.'));
 
 
755
 
756
  // go to grid
757
  $this->_redirect('*/*/template');
767
  }
768
 
769
  // display error message
770
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Unable to find template to delete.'));
 
 
771
  }
772
 
773
  /**
793
  /**
794
  * Render apps grid
795
  *
796
+ * @return null
797
  */
798
  public function gridAction()
799
  {
804
 
805
  /**
806
  * Process all uploaded files
807
+ * setup file names to the configuration return array
808
  *
809
  * @param array $data
810
  * @param bool $restore
952
  /**
953
  * List AirMail message queue grid
954
  *
955
+ * @return null
956
  */
957
  public function queueAction()
958
  {
964
  /**
965
  * Edit message action
966
  *
967
+ * @return null
968
  */
969
  public function editQueueAction()
970
  {
991
  /**
992
  * Cancel queue action
993
  *
994
+ * @return null
995
  */
996
  public function cancelQueueAction()
997
  {
1018
  /**
1019
  * Delete queue action
1020
  *
1021
+ * @return null
1022
  */
1023
  public function deleteQueueAction()
1024
  {
1045
  /**
1046
  * Cancel selected queue action
1047
  *
1048
+ * @return null
1049
  */
1050
  public function massCancelQueueAction()
1051
  {
1056
  try {
1057
  $queue = Mage::getModel('xmlconnect/queue');
1058
  foreach ($queueIds as $queueId) {
1059
+ $queue->reset()->load((int)$queueId)->setStatus(Mage_XmlConnect_Model_Queue::STATUS_CANCELED)
 
 
1060
  ->save();
1061
  }
1062
  Mage::getSingleton('adminhtml/session')->addSuccess(
1073
  /**
1074
  * Delete selected queue action
1075
  *
1076
+ * @return null
1077
  */
1078
  public function massDeleteQueueAction()
1079
  {
1084
  try {
1085
  $queue = Mage::getModel('xmlconnect/queue');
1086
  foreach ($queueIds as $queueId) {
1087
+ $queue->reset()->load($queueId)->setStatus(Mage_XmlConnect_Model_Queue::STATUS_DELETED)->save();
 
 
 
1088
  }
1089
  Mage::getSingleton('adminhtml/session')->addSuccess(
1090
+ Mage::helper('adminhtml')->__('Total of %d record(s) were deleted.', count($queueIds))
 
 
1091
  );
1092
  } catch (Exception $e) {
1093
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1100
  /**
1101
  * Save AirMail message action
1102
  *
1103
+ * @return null
1104
  */
1105
  public function saveMessageAction()
1106
  {
1110
 
1111
  if ($data) {
1112
  try {
1113
+ $data = Mage::getModel('core/input_filter_maliciousCode')->filter($data);
1114
  $template = $this->_initTemplate('template_id');
1115
  $message = $this->_initMessage();
1116
 
1117
  if (!$template->getId() && !$message->getTemplateId()) {
1118
+ $this->_getSession()->addError($this->__('Template for new AirMail Message does not exist.'));
 
 
1119
  $this->_redirect('*/*/queue');
1120
  return;
1121
  }
1127
  if ($deviceType == Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID
1128
  && $data['type'] == Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL
1129
  ) {
1130
+ $this->_getSession()->addError($this->__('Android doesn\'t support AirMail message type.'));
 
 
1131
  $redirectParams = $this->_getQueueMessageParams($message);
1132
  $action = $message->getId() ? 'editQueue' : 'queueMessage';
1133
  $this->_redirect('*/*/' . $action, $redirectParams);
1219
  /**
1220
  * Temlate grid
1221
  *
1222
+ * @return null
1223
  */
1224
  public function templateAction()
1225
  {
1231
  /**
1232
  * Create new template action
1233
  *
1234
+ * @return null
1235
  */
1236
  public function newTemplateAction()
1237
  {
1241
  /**
1242
  * Edit template action
1243
  *
1244
+ * @return null
1245
  */
1246
  public function editTemplateAction()
1247
  {
1249
 
1250
  $applicationsFound = Mage::helper('xmlconnect')->getApplicationOptions();
1251
  if (!$template->getId() && empty($applicationsFound)) {
1252
+ $this->_getSession()->addError($this->__('At last one application has to be created.'));
 
 
1253
  $this->_redirect('*/*/template');
1254
  return;
1255
  }
1262
  /**
1263
  * Save template action
1264
  *
1265
+ * @return null
1266
  */
1267
  public function saveTemplateAction()
1268
  {
1270
  $template = false;
1271
  $isError = false;
1272
  if ($data) {
1273
+ $data = Mage::getModel('core/input_filter_maliciousCode')->filter($data);
1274
  Mage::getSingleton('adminhtml/session')->setTemplateFormData($data);
1275
  try {
1276
  $id = $this->getRequest()->getParam('id');
1303
  /**
1304
  * Add message to queue action
1305
  *
1306
+ * @return null
1307
  */
1308
  public function queueMessageAction()
1309
  {
1311
  if (!$message->getId()) {
1312
  $template = $this->_initTemplate('template_id');
1313
  if (!$template->getId()) {
1314
+ $this->_getSession()->addError($this->__('Template for new AirMail Message does not exist.'));
 
 
1315
  $this->_redirect('*/*/template');
1316
  }
1317
  }
1318
 
1319
  if (isset($template)) {
1320
+ $applicationId = $template->getApplicationId();
1321
  } else {
1322
+ $applicationId = Mage::getModel('xmlconnect/template')->load($message->getTemplateId())->getApplicationId();
 
 
1323
  }
1324
 
1325
  /** @var $app Mage_XmlConnect_Model_Application */
1326
+ $app = Mage::getModel('xmlconnect/application')->load($applicationId);
1327
 
1328
  if(!$app->isNotificationsActive()) {
1329
  $this->_getSession()->addError(
1340
  } else {
1341
  $title = $this->__('New AirMail Message');
1342
  }
1343
+ $this->_addBreadcrumb($this->__('AirMail Message Queue'), $this->__('AirMail Message Queue'),
 
 
1344
  $this->getUrl('*/*/queue')
1345
  );
1346
  $this->_addBreadcrumb($title, $title);
1352
  /**
1353
  * Edit queue message action
1354
  *
1355
+ * @return null
1356
  */
1357
  public function editMessageAction()
1358
  {
app/code/core/Mage/XmlConnect/controllers/CartController.php CHANGED
@@ -36,7 +36,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
36
  /**
37
  * Shopping cart display action
38
  *
39
- * @return void
40
  */
41
  public function indexAction()
42
  {
@@ -64,7 +64,6 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
64
  * as modified bc he can has checkout page in another window.
65
  */
66
  $this->_getSession()->setCartWasUpdated(true);
67
-
68
  $this->loadLayout(false)->getLayout()->getBlock('xmlconnect.cart')->setMessages($messages);
69
  $this->renderLayout();
70
  } catch (Mage_Core_Exception $e) {
@@ -78,7 +77,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
78
  /**
79
  * Update shoping cart data action
80
  *
81
- * @return void
82
  */
83
  public function updateAction()
84
  {
@@ -94,11 +93,10 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
94
  }
95
  }
96
  $cart = $this->_getCart();
97
- if (! $cart->getCustomerSession()->getCustomer()->getId() && $cart->getQuote()->getCustomerId()) {
98
  $cart->getQuote()->setCustomerId(null);
99
  }
100
- $cart->updateItems($cartData)
101
- ->save();
102
  }
103
  $this->_getSession()->setCartWasUpdated(true);
104
  $this->_message($this->__('Cart has been updated.'), parent::MESSAGE_STATUS_SUCCESS);
@@ -136,7 +134,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
136
  /**
137
  * Add product to shopping cart action
138
  *
139
- * @return void
140
  */
141
  public function addAction()
142
  {
@@ -153,8 +151,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
153
  $product = null;
154
  $productId = (int) $this->getRequest()->getParam('product');
155
  if ($productId) {
156
- $_product = Mage::getModel('catalog/product')
157
- ->setStoreId(Mage::app()->getStore()->getId())
158
  ->load($productId);
159
  if ($_product->getId()) {
160
  $product = $_product;
@@ -173,7 +170,6 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
173
  if ($product->isConfigurable()) {
174
 
175
  $request = $this->_getProductRequest($params);
176
-
177
  /**
178
  * Hardcoded Configurable product default
179
  * Set min required qty for a product if it's need
@@ -198,7 +194,6 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
198
  }
199
 
200
  $cart->save();
201
-
202
  $this->_getSession()->setCartWasUpdated(true);
203
 
204
  if (isset($params['whishlist_id'])) {
@@ -235,7 +230,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
235
  if (isset($wishlistMessage)) {
236
  $this->_message($wishlistMessage, self::MESSAGE_STATUS_ERROR);
237
  } else {
238
- $productName = Mage::helper('core')->htmlEscape($product->getName());
239
  $message = $this->__('%s has been added to your cart.', $productName);
240
  if ($cart->getQuote()->getHasError()) {
241
  $message .= $this->__(' But cart has some errors.');
@@ -259,7 +254,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
259
  /**
260
  * Delete shoping cart item action
261
  *
262
- * @return void
263
  */
264
  public function deleteAction()
265
  {
@@ -280,7 +275,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
280
  /**
281
  * Initialize coupon
282
  *
283
- * @return void
284
  */
285
  public function couponAction()
286
  {
@@ -305,9 +300,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
305
 
306
  try {
307
  $this->_getQuote()->getShippingAddress()->setCollectShippingRates(true);
308
- $this->_getQuote()->setCouponCode(strlen($couponCode) ? $couponCode : '')
309
- ->collectTotals()
310
- ->save();
311
 
312
  if ($couponCode) {
313
  if ($couponCode == $this->_getQuote()->getCouponCode()) {
@@ -336,7 +329,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
336
  /**
337
  * Add Gift Card action
338
  *
339
- * @return void
340
  */
341
  public function addGiftcardAction()
342
  {
@@ -352,25 +345,17 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
352
  if (!empty($data['giftcard_code'])) {
353
  $code = $data['giftcard_code'];
354
  try {
355
- Mage::getModel('enterprise_giftcardaccount/giftcardaccount')
356
- ->loadByCode($code)
357
- ->addToCart();
358
  $this->_message(
359
- $this->__('Gift Card "%s" was added.', Mage::helper('core')->htmlEscape($code)),
360
  self::MESSAGE_STATUS_SUCCESS
361
  );
362
  return;
363
  } catch (Mage_Core_Exception $e) {
364
  Mage::dispatchEvent('enterprise_giftcardaccount_add', array('status' => 'fail', 'code' => $code));
365
- $this->_message(
366
- $e->getMessage(),
367
- self::MESSAGE_STATUS_ERROR
368
- );
369
  } catch (Exception $e) {
370
- $this->_message(
371
- $this->__('Cannot apply gift card.'),
372
- self::MESSAGE_STATUS_ERROR
373
- );
374
  Mage::logException($e);
375
  }
376
  } else {
@@ -382,17 +367,16 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
382
  /**
383
  * Remove Gift Card action
384
  *
385
- * @return void
386
  */
387
  public function removeGiftcardAction()
388
  {
389
- if ($code = $this->getRequest()->getParam('giftcard_code')) {
 
390
  try {
391
- Mage::getModel('enterprise_giftcardaccount/giftcardaccount')
392
- ->loadByCode($code)
393
- ->removeFromCart();
394
  $this->_message(
395
- $this->__('Gift Card "%s" was removed.', Mage::helper('core')->htmlEscape($code)),
396
  self::MESSAGE_STATUS_SUCCESS
397
  );
398
  } catch (Mage_Core_Exception $e) {
@@ -410,15 +394,12 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
410
  /**
411
  * Remove Store Credit action
412
  *
413
- * @return void
414
  */
415
  public function removeStoreCreditAction()
416
  {
417
  if (!Mage::helper('enterprise_customerbalance')->isEnabled()) {
418
- $this->_message(
419
- $this->__('Customer balance is disabled for current store'),
420
- self::MESSAGE_STATUS_ERROR
421
- );
422
  return;
423
  }
424
 
@@ -443,7 +424,7 @@ class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
443
  /**
444
  * Get shopping cart summary and flag is_virtual
445
  *
446
- * @return void
447
  */
448
  public function infoAction()
449
  {
36
  /**
37
  * Shopping cart display action
38
  *
39
+ * @return null
40
  */
41
  public function indexAction()
42
  {
64
  * as modified bc he can has checkout page in another window.
65
  */
66
  $this->_getSession()->setCartWasUpdated(true);
 
67
  $this->loadLayout(false)->getLayout()->getBlock('xmlconnect.cart')->setMessages($messages);
68
  $this->renderLayout();
69
  } catch (Mage_Core_Exception $e) {
77
  /**
78
  * Update shoping cart data action
79
  *
80
+ * @return null
81
  */
82
  public function updateAction()
83
  {
93
  }
94
  }
95
  $cart = $this->_getCart();
96
+ if (!$cart->getCustomerSession()->getCustomer()->getId() && $cart->getQuote()->getCustomerId()) {
97
  $cart->getQuote()->setCustomerId(null);
98
  }
99
+ $cart->updateItems($cartData)->save();
 
100
  }
101
  $this->_getSession()->setCartWasUpdated(true);
102
  $this->_message($this->__('Cart has been updated.'), parent::MESSAGE_STATUS_SUCCESS);
134
  /**
135
  * Add product to shopping cart action
136
  *
137
+ * @return null
138
  */
139
  public function addAction()
140
  {
151
  $product = null;
152
  $productId = (int) $this->getRequest()->getParam('product');
153
  if ($productId) {
154
+ $_product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())
 
155
  ->load($productId);
156
  if ($_product->getId()) {
157
  $product = $_product;
170
  if ($product->isConfigurable()) {
171
 
172
  $request = $this->_getProductRequest($params);
 
173
  /**
174
  * Hardcoded Configurable product default
175
  * Set min required qty for a product if it's need
194
  }
195
 
196
  $cart->save();
 
197
  $this->_getSession()->setCartWasUpdated(true);
198
 
199
  if (isset($params['whishlist_id'])) {
230
  if (isset($wishlistMessage)) {
231
  $this->_message($wishlistMessage, self::MESSAGE_STATUS_ERROR);
232
  } else {
233
+ $productName = Mage::helper('core')->escapeHtml($product->getName());
234
  $message = $this->__('%s has been added to your cart.', $productName);
235
  if ($cart->getQuote()->getHasError()) {
236
  $message .= $this->__(' But cart has some errors.');
254
  /**
255
  * Delete shoping cart item action
256
  *
257
+ * @return null
258
  */
259
  public function deleteAction()
260
  {
275
  /**
276
  * Initialize coupon
277
  *
278
+ * @return null
279
  */
280
  public function couponAction()
281
  {
300
 
301
  try {
302
  $this->_getQuote()->getShippingAddress()->setCollectShippingRates(true);
303
+ $this->_getQuote()->setCouponCode(strlen($couponCode) ? $couponCode : '')->collectTotals()->save();
 
 
304
 
305
  if ($couponCode) {
306
  if ($couponCode == $this->_getQuote()->getCouponCode()) {
329
  /**
330
  * Add Gift Card action
331
  *
332
+ * @return null
333
  */
334
  public function addGiftcardAction()
335
  {
345
  if (!empty($data['giftcard_code'])) {
346
  $code = $data['giftcard_code'];
347
  try {
348
+ Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->loadByCode($code)->addToCart();
 
 
349
  $this->_message(
350
+ $this->__('Gift Card "%s" was added.', Mage::helper('core')->escapeHtml($code)),
351
  self::MESSAGE_STATUS_SUCCESS
352
  );
353
  return;
354
  } catch (Mage_Core_Exception $e) {
355
  Mage::dispatchEvent('enterprise_giftcardaccount_add', array('status' => 'fail', 'code' => $code));
356
+ $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
 
 
 
357
  } catch (Exception $e) {
358
+ $this->_message($this->__('Cannot apply gift card.'), self::MESSAGE_STATUS_ERROR);
 
 
 
359
  Mage::logException($e);
360
  }
361
  } else {
367
  /**
368
  * Remove Gift Card action
369
  *
370
+ * @return null
371
  */
372
  public function removeGiftcardAction()
373
  {
374
+ $code = $this->getRequest()->getParam('giftcard_code');
375
+ if ($code) {
376
  try {
377
+ Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->loadByCode($code)->removeFromCart();
 
 
378
  $this->_message(
379
+ $this->__('Gift Card "%s" was removed.', Mage::helper('core')->escapeHtml($code)),
380
  self::MESSAGE_STATUS_SUCCESS
381
  );
382
  } catch (Mage_Core_Exception $e) {
394
  /**
395
  * Remove Store Credit action
396
  *
397
+ * @return null
398
  */
399
  public function removeStoreCreditAction()
400
  {
401
  if (!Mage::helper('enterprise_customerbalance')->isEnabled()) {
402
+ $this->_message($this->__('Customer balance is disabled for current store'), self::MESSAGE_STATUS_ERROR);
 
 
 
403
  return;
404
  }
405
 
424
  /**
425
  * Get shopping cart summary and flag is_virtual
426
  *
427
+ * @return null
428
  */
429
  public function infoAction()
430
  {
app/code/core/Mage/XmlConnect/controllers/CatalogController.php CHANGED
@@ -36,7 +36,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
36
  /**
37
  * Category list
38
  *
39
- * @return void
40
  */
41
  public function categoryAction()
42
  {
@@ -49,8 +49,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
49
  } catch (Exception $e) {
50
  Mage::logException($e);
51
  $this->_message(
52
- $this->__('An error occurred while loading categories.'),
53
- self::MESSAGE_STATUS_ERROR
54
  );
55
  }
56
  }
@@ -58,7 +57,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
58
  /**
59
  * Filter product list
60
  *
61
- * @return void
62
  */
63
  public function filtersAction()
64
  {
@@ -70,8 +69,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
70
  } catch (Exception $e) {
71
  Mage::logException($e);
72
  $this->_message(
73
- $this->__('An error occurred while loading category filters.'),
74
- self::MESSAGE_STATUS_ERROR
75
  );
76
  }
77
  }
@@ -79,7 +77,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
79
  /**
80
  * Product information
81
  *
82
- * @return void
83
  */
84
  public function productAction()
85
  {
@@ -98,7 +96,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
98
  /**
99
  * Product options list
100
  *
101
- * @return void
102
  */
103
  public function productOptionsAction()
104
  {
@@ -116,7 +114,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
116
  /**
117
  * Product gallery images list
118
  *
119
- * @return void
120
  */
121
  public function productGalleryAction()
122
  {
@@ -134,7 +132,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
134
  /**
135
  * Product reviews list
136
  *
137
- * @return void
138
  */
139
  public function productReviewsAction()
140
  {
@@ -152,7 +150,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
152
  /**
153
  * Add new review
154
  *
155
- * @return void
156
  */
157
  public function productReviewAction()
158
  {
@@ -170,7 +168,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
170
  /**
171
  * Perform search products
172
  *
173
- * @return void
174
  */
175
  public function searchAction()
176
  {
@@ -229,7 +227,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
229
  /**
230
  * Retrieve suggestions based on search query
231
  *
232
- * @return void
233
  */
234
  public function searchSuggestAction()
235
  {
@@ -297,14 +295,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
297
  $model->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
298
 
299
  Mage::register('send_to_friend_model', $model);
300
- /*
301
- if ($model->getMaxSendsToFriend()) {
302
- $this->_message($this->__('Messages cannot be sent more than %d times in an hour.',
303
- $model->getMaxSendsToFriend()),
304
- self::MESSAGE_STATUS_WARNING);
305
- return $this;
306
- }
307
- */
308
  $data = $this->getRequest()->getPost();
309
 
310
  if (!$data) {
@@ -323,8 +314,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio
323
  */
324
  $categoryId = $this->getRequest()->getParam('category_id', null);
325
  if ($categoryId) {
326
- $category = Mage::getModel('catalog/category')
327
- ->load($categoryId);
328
  $product->setCategory($category);
329
  Mage::register('current_category', $category);
330
  }
36
  /**
37
  * Category list
38
  *
39
+ * @return null
40
  */
41
  public function categoryAction()
42
  {
49
  } catch (Exception $e) {
50
  Mage::logException($e);
51
  $this->_message(
52
+ $this->__('An error occurred while loading categories.'), self::MESSAGE_STATUS_ERROR
 
53
  );
54
  }
55
  }
57
  /**
58
  * Filter product list
59
  *
60
+ * @return null
61
  */
62
  public function filtersAction()
63
  {
69
  } catch (Exception $e) {
70
  Mage::logException($e);
71
  $this->_message(
72
+ $this->__('An error occurred while loading category filters.'), self::MESSAGE_STATUS_ERROR
 
73
  );
74
  }
75
  }
77
  /**
78
  * Product information
79
  *
80
+ * @return null
81
  */
82
  public function productAction()
83
  {
96
  /**
97
  * Product options list
98
  *
99
+ * @return null
100
  */
101
  public function productOptionsAction()
102
  {
114
  /**
115
  * Product gallery images list
116
  *
117
+ * @return null
118
  */
119
  public function productGalleryAction()
120
  {
132
  /**
133
  * Product reviews list
134
  *
135
+ * @return null
136
  */
137
  public function productReviewsAction()
138
  {
150
  /**
151
  * Add new review
152
  *
153
+ * @return null
154
  */
155
  public function productReviewAction()
156
  {
168
  /**
169
  * Perform search products
170
  *
171
+ * @return null
172
  */
173
  public function searchAction()
174
  {
227
  /**
228
  * Retrieve suggestions based on search query
229
  *
230
+ * @return null
231
  */
232
  public function searchSuggestAction()
233
  {
295
  $model->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
296
 
297
  Mage::register('send_to_friend_model', $model);
298
+
 
 
 
 
 
 
 
299
  $data = $this->getRequest()->getPost();
300
 
301
  if (!$data) {
314
  */
315
  $categoryId = $this->getRequest()->getParam('category_id', null);
316
  if ($categoryId) {
317
+ $category = Mage::getModel('catalog/category')->load($categoryId);
 
318
  $product->setCategory($category);
319
  Mage::register('current_category', $category);
320
  }
app/code/core/Mage/XmlConnect/controllers/CheckoutController.php CHANGED
@@ -36,7 +36,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
36
  /**
37
  * Make sure customer is logged in
38
  *
39
- * @return void
40
  */
41
  public function preDispatch()
42
  {
@@ -67,7 +67,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
67
  /**
68
  * Onepage Checkout page
69
  *
70
- * @return void
71
  */
72
  public function indexAction()
73
  {
@@ -105,7 +105,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
105
  /**
106
  * Display customer new billing addrress form
107
  *
108
- * @return void
109
  */
110
  public function newBillingAddressFormAction()
111
  {
@@ -123,7 +123,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
123
  /**
124
  * Display customer new shipping addrress form
125
  *
126
- * @return void
127
  */
128
  public function newShippingAddressFormAction()
129
  {
@@ -141,7 +141,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
141
  /**
142
  * Billing addresses list action
143
  *
144
- * @return void
145
  */
146
  public function billingAddressAction()
147
  {
@@ -159,7 +159,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
159
  /**
160
  * Save billing address to current quote using onepage model
161
  *
162
- * @return void
163
  */
164
  public function saveBillingAddressAction()
165
  {
@@ -187,7 +187,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
187
  /**
188
  * Shipping addresses list action
189
  *
190
- * @return void
191
  */
192
  public function shippingAddressAction()
193
  {
@@ -205,7 +205,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
205
  /**
206
  * Save shipping address to current quote using onepage model
207
  *
208
- * @return void
209
  */
210
  public function saveShippingAddressAction()
211
  {
@@ -298,7 +298,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
298
  /**
299
  * Get shipping methods for current quote
300
  *
301
- * @return void
302
  */
303
  public function shippingMethodsAction()
304
  {
@@ -318,7 +318,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
318
  /**
319
  * Shipping method save action
320
  *
321
- * @return void
322
  */
323
  public function saveShippingMethodAction()
324
  {
@@ -329,16 +329,22 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
329
 
330
  $data = $this->getRequest()->getPost('shipping_method', '');
331
  $result = $this->getOnepage()->saveShippingMethod($data);
332
- if (!isset($result['error'])) {
 
 
 
 
 
 
333
  $this->_message($this->__('Shipping method has been set.'), self::MESSAGE_STATUS_SUCCESS);
334
- } else {
335
  if (!is_array($result['message'])) {
336
  $result['message'] = array($result['message']);
337
  }
338
  Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array(
339
- 'request' => $this->getRequest(),
340
- 'quote' => $this->getOnepage()->getQuote()
341
  ));
 
342
  $this->_message(implode('. ', $result['message']), self::MESSAGE_STATUS_ERROR);
343
  }
344
  }
@@ -347,7 +353,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
347
  /**
348
  * Save checkout method
349
  *
350
- * @return void
351
  */
352
  public function saveMethodAction()
353
  {
@@ -368,7 +374,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
368
  /**
369
  * Get payment methods action
370
  *
371
- * @return void
372
  */
373
  public function paymentMethodsAction()
374
  {
@@ -385,7 +391,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
385
  /**
386
  * Save payment action
387
  *
388
- * @return void
389
  */
390
  public function savePaymentAction()
391
  {
@@ -414,7 +420,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
414
  /**
415
  * Order summary info action
416
  *
417
- * @return void
418
  */
419
  public function orderReviewAction()
420
  {
@@ -433,7 +439,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti
433
  /**
434
  * Create order action
435
  *
436
- * @return void
437
  */
438
  public function saveOrderAction()
439
  {
36
  /**
37
  * Make sure customer is logged in
38
  *
39
+ * @return null
40
  */
41
  public function preDispatch()
42
  {
67
  /**
68
  * Onepage Checkout page
69
  *
70
+ * @return null
71
  */
72
  public function indexAction()
73
  {
105
  /**
106
  * Display customer new billing addrress form
107
  *
108
+ * @return null
109
  */
110
  public function newBillingAddressFormAction()
111
  {
123
  /**
124
  * Display customer new shipping addrress form
125
  *
126
+ * @return null
127
  */
128
  public function newShippingAddressFormAction()
129
  {
141
  /**
142
  * Billing addresses list action
143
  *
144
+ * @return null
145
  */
146
  public function billingAddressAction()
147
  {
159
  /**
160
  * Save billing address to current quote using onepage model
161
  *
162
+ * @return null
163
  */
164
  public function saveBillingAddressAction()
165
  {
187
  /**
188
  * Shipping addresses list action
189
  *
190
+ * @return null
191
  */
192
  public function shippingAddressAction()
193
  {
205
  /**
206
  * Save shipping address to current quote using onepage model
207
  *
208
+ * @return null
209
  */
210
  public function saveShippingAddressAction()
211
  {
298
  /**
299
  * Get shipping methods for current quote
300
  *
301
+ * @return null
302
  */
303
  public function shippingMethodsAction()
304
  {
318
  /**
319
  * Shipping method save action
320
  *
321
+ * @return null
322
  */
323
  public function saveShippingMethodAction()
324
  {
329
 
330
  $data = $this->getRequest()->getPost('shipping_method', '');
331
  $result = $this->getOnepage()->saveShippingMethod($data);
332
+ if (!$result) {
333
+
334
+ Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array(
335
+ 'request' => $this->getRequest(), 'quote' => $this->getOnepage()->getQuote()
336
+ ));
337
+ $this->getOnepage()->getQuote()->collectTotals()->save();
338
+
339
  $this->_message($this->__('Shipping method has been set.'), self::MESSAGE_STATUS_SUCCESS);
340
+ } elseif(isset($result['error'])) {
341
  if (!is_array($result['message'])) {
342
  $result['message'] = array($result['message']);
343
  }
344
  Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array(
345
+ 'request' => $this->getRequest(), 'quote' => $this->getOnepage()->getQuote()
 
346
  ));
347
+ $this->getOnepage()->getQuote()->collectTotals()->save();
348
  $this->_message(implode('. ', $result['message']), self::MESSAGE_STATUS_ERROR);
349
  }
350
  }
353
  /**
354
  * Save checkout method
355
  *
356
+ * @return null
357
  */
358
  public function saveMethodAction()
359
  {
374
  /**
375
  * Get payment methods action
376
  *
377
+ * @return null
378
  */
379
  public function paymentMethodsAction()
380
  {
391
  /**
392
  * Save payment action
393
  *
394
+ * @return null
395
  */
396
  public function savePaymentAction()
397
  {
420
  /**
421
  * Order summary info action
422
  *
423
+ * @return null
424
  */
425
  public function orderReviewAction()
426
  {
439
  /**
440
  * Create order action
441
  *
442
+ * @return null
443
  */
444
  public function saveOrderAction()
445
  {
app/code/core/Mage/XmlConnect/controllers/CmsController.php CHANGED
@@ -36,7 +36,7 @@ class Mage_XmlConnect_CmsController extends Mage_XmlConnect_Controller_Action
36
  /**
37
  * Declare content type header
38
  *
39
- * @return void
40
  */
41
  public function preDispatch()
42
  {
@@ -47,7 +47,7 @@ class Mage_XmlConnect_CmsController extends Mage_XmlConnect_Controller_Action
47
  /**
48
  * Category list
49
  *
50
- * @return void
51
  */
52
  public function pageAction()
53
  {
36
  /**
37
  * Declare content type header
38
  *
39
+ * @return null
40
  */
41
  public function preDispatch()
42
  {
47
  /**
48
  * Category list
49
  *
50
+ * @return null
51
  */
52
  public function pageAction()
53
  {
app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php CHANGED
@@ -36,7 +36,7 @@ class Mage_XmlConnect_ConfigurationController extends Mage_Core_Controller_Front
36
  /**
37
  * Declare content type header
38
  *
39
- * @return void
40
  */
41
  public function preDispatch()
42
  {
@@ -68,9 +68,7 @@ class Mage_XmlConnect_ConfigurationController extends Mage_Core_Controller_Front
68
  $app->setScreenSize($screenSize);
69
 
70
  if (!$app->getId()) {
71
- Mage::throwException(
72
- $this->__('App with specified code does not exist.')
73
- );
74
  }
75
 
76
  $app->loadConfiguration();
@@ -87,11 +85,11 @@ class Mage_XmlConnect_ConfigurationController extends Mage_Core_Controller_Front
87
  * Set application coolies: application code and device screen size.
88
  *
89
  * @param Mage_XmlConnect_Model_Application $app
90
- * @return void
91
  */
92
  protected function _initCookies(Mage_XmlConnect_Model_Application $app)
93
  {
94
- $cookieToSetArray = array (
95
  array(
96
  'cookieName' => Mage_XmlConnect_Model_Application::APP_CODE_COOKIE_NAME,
97
  'paramName' => Mage_XmlConnect_Model_Application::APP_CODE_COOKIE_NAME,
@@ -101,8 +99,8 @@ class Mage_XmlConnect_ConfigurationController extends Mage_Core_Controller_Front
101
  'cookieName' => Mage_XmlConnect_Model_Application::APP_SCREEN_SIZE_NAME,
102
  'paramName' => Mage_XmlConnect_Model_Application::APP_SCREEN_SIZE_NAME,
103
  'value' => $app->getScreenSize()
104
- )
105
- );
106
  foreach ($cookieToSetArray as $item) {
107
  if (!isset($_COOKIE[$item['cookieName']])
108
  || $_COOKIE[$item['cookieName']] != $this->getRequest()->getParam($item['paramName'])
@@ -112,13 +110,7 @@ class Mage_XmlConnect_ConfigurationController extends Mage_Core_Controller_Front
112
  */
113
  $cookieExpireOffset = 3600 * 24 * 30;
114
  Mage::getSingleton('core/cookie')->set(
115
- $item['cookieName'],
116
- $item['value'],
117
- $cookieExpireOffset,
118
- '/',
119
- null,
120
- null,
121
- true
122
  );
123
  }
124
  }
@@ -127,7 +119,7 @@ class Mage_XmlConnect_ConfigurationController extends Mage_Core_Controller_Front
127
  /**
128
  * Default action
129
  *
130
- * @return void
131
  */
132
  public function indexAction()
133
  {
@@ -150,14 +142,10 @@ class Mage_XmlConnect_ConfigurationController extends Mage_Core_Controller_Front
150
  $this->loadLayout(false);
151
  $this->renderLayout();
152
  } catch (Mage_Core_Exception $e) {
153
- $this->_message(
154
- $e->getMessage(),
155
- Mage_XmlConnect_Controller_Action::MESSAGE_STATUS_ERROR
156
- );
157
  } catch (Exception $e) {
158
  $this->_message(
159
- $this->__('Can\'t show configuration.'),
160
- Mage_XmlConnect_Controller_Action::MESSAGE_STATUS_ERROR
161
  );
162
  Mage::logException($e);
163
  }
@@ -168,9 +156,7 @@ class Mage_XmlConnect_ConfigurationController extends Mage_Core_Controller_Front
168
  *
169
  * @param string $text
170
  * @param string $status
171
- * @param string $type
172
- * @param string $action
173
- * @return void
174
  */
175
  protected function _message($text, $status)
176
  {
36
  /**
37
  * Declare content type header
38
  *
39
+ * @return null
40
  */
41
  public function preDispatch()
42
  {
68
  $app->setScreenSize($screenSize);
69
 
70
  if (!$app->getId()) {
71
+ Mage::throwException($this->__('App with specified code does not exist.'));
 
 
72
  }
73
 
74
  $app->loadConfiguration();
85
  * Set application coolies: application code and device screen size.
86
  *
87
  * @param Mage_XmlConnect_Model_Application $app
88
+ * @return null
89
  */
90
  protected function _initCookies(Mage_XmlConnect_Model_Application $app)
91
  {
92
+ $cookieToSetArray = array(
93
  array(
94
  'cookieName' => Mage_XmlConnect_Model_Application::APP_CODE_COOKIE_NAME,
95
  'paramName' => Mage_XmlConnect_Model_Application::APP_CODE_COOKIE_NAME,
99
  'cookieName' => Mage_XmlConnect_Model_Application::APP_SCREEN_SIZE_NAME,
100
  'paramName' => Mage_XmlConnect_Model_Application::APP_SCREEN_SIZE_NAME,
101
  'value' => $app->getScreenSize()
102
+ ));
103
+
104
  foreach ($cookieToSetArray as $item) {
105
  if (!isset($_COOKIE[$item['cookieName']])
106
  || $_COOKIE[$item['cookieName']] != $this->getRequest()->getParam($item['paramName'])
110
  */
111
  $cookieExpireOffset = 3600 * 24 * 30;
112
  Mage::getSingleton('core/cookie')->set(
113
+ $item['cookieName'], $item['value'], $cookieExpireOffset, '/', null, null, true
 
 
 
 
 
 
114
  );
115
  }
116
  }
119
  /**
120
  * Default action
121
  *
122
+ * @return null
123
  */
124
  public function indexAction()
125
  {
142
  $this->loadLayout(false);
143
  $this->renderLayout();
144
  } catch (Mage_Core_Exception $e) {
145
+ $this->_message($e->getMessage(), Mage_XmlConnect_Controller_Action::MESSAGE_STATUS_ERROR);
 
 
 
146
  } catch (Exception $e) {
147
  $this->_message(
148
+ $this->__('Can\'t show configuration.'), Mage_XmlConnect_Controller_Action::MESSAGE_STATUS_ERROR
 
149
  );
150
  Mage::logException($e);
151
  }
156
  *
157
  * @param string $text
158
  * @param string $status
159
+ * @return null
 
 
160
  */
161
  protected function _message($text, $status)
162
  {
app/code/core/Mage/XmlConnect/controllers/CustomerController.php CHANGED
@@ -34,9 +34,9 @@
34
  class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Action
35
  {
36
  /**
37
- * Customer authentification action
38
  *
39
- * @return void
40
  */
41
  public function loginAction()
42
  {
@@ -83,7 +83,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
83
  /**
84
  * Customer logout
85
  *
86
- * @return void
87
  */
88
  public function logoutAction()
89
  {
@@ -101,7 +101,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
101
  /**
102
  * Customer registration/edit account form
103
  *
104
- * @return void
105
  */
106
  public function formAction()
107
  {
@@ -111,19 +111,14 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
111
  if ($editFlag == 1) {
112
  if (!$this->_getSession()->isLoggedIn()) {
113
  $this->_message(
114
- $this->__('Customer not logged in.'),
115
- self::MESSAGE_STATUS_ERROR,
116
- array('logged_in' => '0')
117
  );
118
  return;
119
  }
120
  $customer = $this->_getSession()->getCustomer();
121
  }
122
 
123
- $this->loadLayout(false)
124
- ->getLayout()
125
- ->getBlock('xmlconnect.customer.form')
126
- ->setCustomer($customer);
127
  $this->renderLayout();
128
  } catch (Mage_Core_Exception $e) {
129
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
@@ -136,15 +131,13 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
136
  /**
137
  * Change customer data action
138
  *
139
- * @return void
140
  */
141
  public function editAction()
142
  {
143
  if (!$this->_getSession()->isLoggedIn()) {
144
  $this->_message(
145
- $this->__('Customer not logged in.'),
146
- self::MESSAGE_STATUS_ERROR,
147
- array('logged_in' => '0')
148
  );
149
  return;
150
  }
@@ -153,8 +146,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
153
 
154
  /* @var $customerForm Mage_Customer_Model_Form */
155
  $customerForm = Mage::getModel('customer/form');
156
- $customerForm->setFormCode('customer_account_edit')
157
- ->setEntity($customer);
158
 
159
  $customerData = $customerForm->extractData($this->getRequest());
160
 
@@ -228,7 +220,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
228
  /**
229
  * Save customer account
230
  *
231
- * @return void
232
  */
233
  public function saveAction()
234
  {
@@ -251,8 +243,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
251
 
252
  /* @var $customerForm Mage_Customer_Model_Form */
253
  $customerForm = Mage::getModel('customer/form');
254
- $customerForm->setFormCode('customer_account_create')
255
- ->setEntity($customer);
256
 
257
  $customerData = $customerForm->extractData($this->getRequest());
258
 
@@ -329,7 +320,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
329
  /**
330
  * Send new password to customer by specified email
331
  *
332
- * @return void
333
  */
334
  public function forgotPasswordAction()
335
  {
@@ -339,8 +330,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
339
  $this->_message($this->__('Invalid email address.'), self::MESSAGE_STATUS_ERROR);
340
  return;
341
  }
342
- $customer = Mage::getModel('customer/customer')
343
- ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
344
  ->loadByEmail($email);
345
 
346
  if ($customer->getId()) {
@@ -349,22 +339,19 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
349
  $customer->changePassword($newPassword, false);
350
  $customer->sendPasswordReminderEmail();
351
  $this->_message(
352
- $this->__('A new password has been sent.'),
353
- self::MESSAGE_STATUS_SUCCESS
354
  );
355
  return;
356
  } catch (Mage_Core_Exception $e) {
357
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
358
  } catch (Exception $e) {
359
  $this->_message(
360
- $this->__('Problem changing or sending password.'),
361
- self::MESSAGE_STATUS_ERROR
362
  );
363
  }
364
  } else {
365
  $this->_message(
366
- $this->__('This email address was not found in our records.'),
367
- self::MESSAGE_STATUS_ERROR
368
  );
369
  }
370
  } else {
@@ -375,15 +362,13 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
375
  /**
376
  * Customer addresses list
377
  *
378
- * @return void
379
  */
380
  public function addressAction()
381
  {
382
  if (!$this->_getSession()->isLoggedIn()) {
383
  $this->_message(
384
- $this->__('Customer not logged in.'),
385
- self::MESSAGE_STATUS_ERROR,
386
- array('logged_in' => '0')
387
  );
388
  return;
389
  }
@@ -395,10 +380,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
395
  } catch (Mage_Core_Exception $e) {
396
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
397
  } catch (Exception $e) {
398
- $this->_message(
399
- $this->__('Unable to load addresses.'),
400
- self::MESSAGE_STATUS_ERROR
401
- );
402
  Mage::logException($e);
403
  }
404
  } else {
@@ -413,16 +395,14 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
413
  /**
414
  * Customer add/edit address form
415
  *
416
- * @return void
417
  */
418
  public function addressFormAction()
419
  {
420
  try {
421
  if (!$this->_getSession()->isLoggedIn()) {
422
  $this->_message(
423
- $this->__('Customer not logged in.'),
424
- self::MESSAGE_STATUS_ERROR,
425
- array('logged_in' => '0')
426
  );
427
  return;
428
  }
@@ -436,18 +416,12 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
436
  if ($addressId) {
437
  $address->load($addressId);
438
  if ($address->getCustomerId() != $this->_getSession()->getCustomerId()) {
439
- $this->_message(
440
- $this->__('Specified address does not exist.'),
441
- self::MESSAGE_STATUS_ERROR
442
- );
443
  return;
444
  }
445
  }
446
 
447
- $this->loadLayout(false)
448
- ->getLayout()
449
- ->getBlock('xmlconnect.customer.address.form')
450
- ->setAddress($address);
451
 
452
  $this->renderLayout();
453
  } catch (Mage_Core_Exception $e) {
@@ -462,15 +436,13 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
462
  /**
463
  * Remove customer address
464
  *
465
- * @return void
466
  */
467
  public function deleteAddressAction()
468
  {
469
  if (!$this->_getSession()->isLoggedIn()) {
470
  $this->_message(
471
- $this->__('Customer not logged in.'),
472
- self::MESSAGE_STATUS_ERROR,
473
- array('logged_in' => '0')
474
  );
475
  return;
476
  }
@@ -482,25 +454,16 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
482
 
483
  // Validate address_id <=> customer_id
484
  if ($address->getCustomerId() != $this->_getSession()->getCustomerId()) {
485
- $this->_message(
486
- $this->__('Address does not belong to this customer.'),
487
- self::MESSAGE_STATUS_ERROR
488
- );
489
  return;
490
  }
491
 
492
  try {
493
  $address->delete();
494
- $this->_message(
495
- $this->__('Address has been deleted.'),
496
- self::MESSAGE_STATUS_SUCCESS
497
- );
498
  } catch (Exception $e) {
499
  Mage::logException($e);
500
- $this->_message(
501
- $this->__('An error occurred while deleting the address.'),
502
- self::MESSAGE_STATUS_ERROR
503
- );
504
  }
505
  }
506
  }
@@ -508,15 +471,13 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
508
  /**
509
  * Add/Save customer address
510
  *
511
- * @return void
512
  */
513
  public function saveAddressAction()
514
  {
515
  if (!$this->_getSession()->isLoggedIn()) {
516
  $this->_message(
517
- $this->__('Customer not logged in.'),
518
- self::MESSAGE_STATUS_ERROR,
519
- array('logged_in' => '0')
520
  );
521
  return;
522
  }
@@ -589,15 +550,13 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
589
  /**
590
  * Customer orders list
591
  *
592
- * @return void
593
  */
594
  public function orderListAction()
595
  {
596
  if (!$this->_getSession()->isLoggedIn()) {
597
  $this->_message(
598
- $this->__('Customer not logged in.'),
599
- self::MESSAGE_STATUS_ERROR,
600
- array('logged_in' => '0')
601
  );
602
  return;
603
  }
@@ -616,16 +575,14 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
616
  /**
617
  * Customer order details
618
  *
619
- * @return void
620
  */
621
  public function orderDetailsAction()
622
  {
623
  try {
624
  if (!$this->_getSession()->isLoggedIn()) {
625
  $this->_message(
626
- $this->__('Customer not logged in.'),
627
- self::MESSAGE_STATUS_ERROR,
628
- array('logged_in' => '0')
629
  );
630
  return;
631
  }
@@ -665,9 +622,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
665
  {
666
  $customerId = Mage::getSingleton('customer/session')->getCustomerId();
667
  $availableStates = Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates();
668
- if ($order->getId()
669
- && $order->getCustomerId()
670
- && ($order->getCustomerId() == $customerId)
671
  && in_array($order->getState(), $availableStates, true)
672
  ) {
673
  return true;
@@ -678,7 +633,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
678
  /**
679
  * Check if customer is loggined
680
  *
681
- * @return void
682
  */
683
  public function isLogginedAction()
684
  {
@@ -713,7 +668,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
713
  /**
714
  * Store Credit info
715
  *
716
- * @return void
717
  */
718
  public function storeCreditAction()
719
  {
@@ -742,7 +697,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
742
  /**
743
  * Check Gift card action
744
  *
745
- * @return void
746
  */
747
  public function giftcardCheckAction()
748
  {
@@ -779,7 +734,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
779
  /**
780
  * Redeem Gift card action
781
  *
782
- * @return void
783
  */
784
  public function giftcardRedeemAction()
785
  {
@@ -804,7 +759,7 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti
804
  ->setIsRedeemed(true)->redeem();
805
 
806
  $this->_message(
807
- $this->__('Gift Card "%s" was redeemed.', Mage::helper('core')->htmlEscape($code)),
808
  self::MESSAGE_STATUS_SUCCESS
809
  );
810
  }
34
  class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Action
35
  {
36
  /**
37
+ * Customer authentication action
38
  *
39
+ * @return null
40
  */
41
  public function loginAction()
42
  {
83
  /**
84
  * Customer logout
85
  *
86
+ * @return null
87
  */
88
  public function logoutAction()
89
  {
101
  /**
102
  * Customer registration/edit account form
103
  *
104
+ * @return null
105
  */
106
  public function formAction()
107
  {
111
  if ($editFlag == 1) {
112
  if (!$this->_getSession()->isLoggedIn()) {
113
  $this->_message(
114
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
115
  );
116
  return;
117
  }
118
  $customer = $this->_getSession()->getCustomer();
119
  }
120
 
121
+ $this->loadLayout(false)->getLayout()->getBlock('xmlconnect.customer.form')->setCustomer($customer);
 
 
 
122
  $this->renderLayout();
123
  } catch (Mage_Core_Exception $e) {
124
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
131
  /**
132
  * Change customer data action
133
  *
134
+ * @return null
135
  */
136
  public function editAction()
137
  {
138
  if (!$this->_getSession()->isLoggedIn()) {
139
  $this->_message(
140
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
141
  );
142
  return;
143
  }
146
 
147
  /* @var $customerForm Mage_Customer_Model_Form */
148
  $customerForm = Mage::getModel('customer/form');
149
+ $customerForm->setFormCode('customer_account_edit')->setEntity($customer);
 
150
 
151
  $customerData = $customerForm->extractData($this->getRequest());
152
 
220
  /**
221
  * Save customer account
222
  *
223
+ * @return null
224
  */
225
  public function saveAction()
226
  {
243
 
244
  /* @var $customerForm Mage_Customer_Model_Form */
245
  $customerForm = Mage::getModel('customer/form');
246
+ $customerForm->setFormCode('customer_account_create')->setEntity($customer);
 
247
 
248
  $customerData = $customerForm->extractData($this->getRequest());
249
 
320
  /**
321
  * Send new password to customer by specified email
322
  *
323
+ * @return null
324
  */
325
  public function forgotPasswordAction()
326
  {
330
  $this->_message($this->__('Invalid email address.'), self::MESSAGE_STATUS_ERROR);
331
  return;
332
  }
333
+ $customer = Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
 
334
  ->loadByEmail($email);
335
 
336
  if ($customer->getId()) {
339
  $customer->changePassword($newPassword, false);
340
  $customer->sendPasswordReminderEmail();
341
  $this->_message(
342
+ $this->__('A new password has been sent.'), self::MESSAGE_STATUS_SUCCESS
 
343
  );
344
  return;
345
  } catch (Mage_Core_Exception $e) {
346
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
347
  } catch (Exception $e) {
348
  $this->_message(
349
+ $this->__('Problem changing or sending password.'), self::MESSAGE_STATUS_ERROR
 
350
  );
351
  }
352
  } else {
353
  $this->_message(
354
+ $this->__('This email address was not found in our records.'), self::MESSAGE_STATUS_ERROR
 
355
  );
356
  }
357
  } else {
362
  /**
363
  * Customer addresses list
364
  *
365
+ * @return null
366
  */
367
  public function addressAction()
368
  {
369
  if (!$this->_getSession()->isLoggedIn()) {
370
  $this->_message(
371
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
372
  );
373
  return;
374
  }
380
  } catch (Mage_Core_Exception $e) {
381
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
382
  } catch (Exception $e) {
383
+ $this->_message($this->__('Unable to load addresses.'), self::MESSAGE_STATUS_ERROR);
 
 
 
384
  Mage::logException($e);
385
  }
386
  } else {
395
  /**
396
  * Customer add/edit address form
397
  *
398
+ * @return null
399
  */
400
  public function addressFormAction()
401
  {
402
  try {
403
  if (!$this->_getSession()->isLoggedIn()) {
404
  $this->_message(
405
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
406
  );
407
  return;
408
  }
416
  if ($addressId) {
417
  $address->load($addressId);
418
  if ($address->getCustomerId() != $this->_getSession()->getCustomerId()) {
419
+ $this->_message($this->__('Specified address does not exist.'), self::MESSAGE_STATUS_ERROR);
 
 
 
420
  return;
421
  }
422
  }
423
 
424
+ $this->loadLayout(false)->getLayout()->getBlock('xmlconnect.customer.address.form')->setAddress($address);
 
 
 
425
 
426
  $this->renderLayout();
427
  } catch (Mage_Core_Exception $e) {
436
  /**
437
  * Remove customer address
438
  *
439
+ * @return null
440
  */
441
  public function deleteAddressAction()
442
  {
443
  if (!$this->_getSession()->isLoggedIn()) {
444
  $this->_message(
445
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
446
  );
447
  return;
448
  }
454
 
455
  // Validate address_id <=> customer_id
456
  if ($address->getCustomerId() != $this->_getSession()->getCustomerId()) {
457
+ $this->_message($this->__('Address does not belong to this customer.'), self::MESSAGE_STATUS_ERROR);
 
 
 
458
  return;
459
  }
460
 
461
  try {
462
  $address->delete();
463
+ $this->_message($this->__('Address has been deleted.'), self::MESSAGE_STATUS_SUCCESS);
 
 
 
464
  } catch (Exception $e) {
465
  Mage::logException($e);
466
+ $this->_message($this->__('An error occurred while deleting the address.'), self::MESSAGE_STATUS_ERROR);
 
 
 
467
  }
468
  }
469
  }
471
  /**
472
  * Add/Save customer address
473
  *
474
+ * @return null
475
  */
476
  public function saveAddressAction()
477
  {
478
  if (!$this->_getSession()->isLoggedIn()) {
479
  $this->_message(
480
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
481
  );
482
  return;
483
  }
550
  /**
551
  * Customer orders list
552
  *
553
+ * @return null
554
  */
555
  public function orderListAction()
556
  {
557
  if (!$this->_getSession()->isLoggedIn()) {
558
  $this->_message(
559
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
560
  );
561
  return;
562
  }
575
  /**
576
  * Customer order details
577
  *
578
+ * @return null
579
  */
580
  public function orderDetailsAction()
581
  {
582
  try {
583
  if (!$this->_getSession()->isLoggedIn()) {
584
  $this->_message(
585
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
586
  );
587
  return;
588
  }
622
  {
623
  $customerId = Mage::getSingleton('customer/session')->getCustomerId();
624
  $availableStates = Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates();
625
+ if ($order->getId() && $order->getCustomerId() && ($order->getCustomerId() == $customerId)
 
 
626
  && in_array($order->getState(), $availableStates, true)
627
  ) {
628
  return true;
633
  /**
634
  * Check if customer is loggined
635
  *
636
+ * @return null
637
  */
638
  public function isLogginedAction()
639
  {
668
  /**
669
  * Store Credit info
670
  *
671
+ * @return null
672
  */
673
  public function storeCreditAction()
674
  {
697
  /**
698
  * Check Gift card action
699
  *
700
+ * @return null
701
  */
702
  public function giftcardCheckAction()
703
  {
734
  /**
735
  * Redeem Gift card action
736
  *
737
+ * @return null
738
  */
739
  public function giftcardRedeemAction()
740
  {
759
  ->setIsRedeemed(true)->redeem();
760
 
761
  $this->_message(
762
+ $this->__('Gift Card "%s" was redeemed.', Mage::helper('core')->escapeHtml($code)),
763
  self::MESSAGE_STATUS_SUCCESS
764
  );
765
  }
app/code/core/Mage/XmlConnect/controllers/IndexController.php CHANGED
@@ -36,7 +36,7 @@ class Mage_XmlConnect_IndexController extends Mage_XmlConnect_Controller_Action
36
  /**
37
  * Default action
38
  *
39
- * @return void
40
  */
41
  public function indexAction()
42
  {
36
  /**
37
  * Default action
38
  *
39
+ * @return null
40
  */
41
  public function indexAction()
42
  {
app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php CHANGED
@@ -87,7 +87,7 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
87
  /**
88
  * Make sure customer is logged in
89
  *
90
- * @return void
91
  */
92
  public function preDispatch()
93
  {
@@ -96,9 +96,7 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
96
  && !Mage::getSingleton('checkout/session')->getQuote()->isAllowedGuestCheckout()
97
  ) {
98
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
99
- $this->_message(
100
- $this->__('Customer not logged in.'),
101
- self::MESSAGE_STATUS_ERROR,
102
  array('logged_in' => '0')
103
  );
104
  return;
@@ -116,16 +114,11 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
116
  $customer = Mage::getSingleton('customer/session')->getCustomer();
117
  if ($customer && $customer->getId()) {
118
  $this->_checkout->setCustomerWithAddressChange(
119
- $customer,
120
- null,
121
- $this->_getQuote()->getShippingAddress()
122
  );
123
  }
124
 
125
- $token = $this->_checkout->start(
126
- Mage::getUrl('*/*/return'),
127
- Mage::getUrl('*/*/cancel')
128
- );
129
 
130
  if ($token) {
131
  $this->_initToken($token);
@@ -135,18 +128,12 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
135
  $message->addChild('token', $token);
136
  $this->getResponse()->setBody($message->asNiceXml());
137
  } else {
138
- $this->_message(
139
- $this->__('Token has not been set.'),
140
- self::MESSAGE_STATUS_ERROR
141
- );
142
  }
143
  } catch (Mage_Core_Exception $e) {
144
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
145
  } catch (Exception $e) {
146
- $this->_message(
147
- $this->__('Unable to start Mobile Express Checkout.'),
148
- self::MESSAGE_STATUS_ERROR
149
- );
150
  Mage::logException($e);
151
  }
152
  }
@@ -160,22 +147,13 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
160
  try {
161
  $this->_initCheckout();
162
  $this->_checkout->returnFromPaypal($this->_initToken());
163
-
164
- $this->_message(
165
- $this->__('Mobile Express Checkout processed successfully.'),
166
- self::MESSAGE_STATUS_SUCCESS
167
- );
168
  return;
169
- }
170
- catch (Mage_Core_Exception $e) {
171
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
172
- }
173
- catch (Exception $e) {
174
  Mage::logException($e);
175
- $this->_message(
176
- $this->__('Unable to initialize return action.'),
177
- self::MESSAGE_STATUS_ERROR
178
- );
179
  }
180
  }
181
 
@@ -196,27 +174,19 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
196
  $messageArray[] = $message;
197
  }
198
 
199
- $detailsBlock = $this->getLayout()
200
- ->getBlock('xmlconnect.cart.paypal.mecl.review');
201
  if (count($messageArray)) {
202
  $detailsBlock->setPaypalMessages($messageArray);
203
  }
204
 
205
- $detailsBlock->setQuote($this->_getQuote())
206
- ->getChild('details')->setQuote($this->_getQuote())
207
  ->getChild('totals')->setQuote($this->_getQuote());
208
-
209
  $this->renderLayout();
210
  return;
211
- }
212
- catch (Mage_Core_Exception $e) {
213
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
214
- }
215
- catch (Exception $e) {
216
- $this->_message(
217
- $this->__('Unable to initialize express checkout review.'),
218
- self::MESSAGE_STATUS_ERROR
219
- );
220
  Mage::logException($e);
221
  }
222
  }
@@ -231,16 +201,12 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
231
  $this->_checkout->prepareOrderReview($this->_initToken());
232
  $this->loadLayout(false);
233
 
234
- $this->getLayout()
235
- ->getBlock('xmlconnect.cart.paypal.mecl.shippingmethods')
236
- ->setQuote($this->_getQuote());
237
  $this->renderLayout();
238
  return;
239
- }
240
- catch (Mage_Core_Exception $e) {
241
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
242
- }
243
- catch (Exception $e) {
244
  $this->_message(
245
  $this->__('Unable to initialize express checkout shipping method list.'),
246
  self::MESSAGE_STATUS_ERROR
@@ -257,29 +223,16 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
257
  try {
258
  $this->_initCheckout();
259
  if ($this->getRequest()->getParam('shipping_method', false)) {
260
- $this->_checkout->updateShippingMethod(
261
- $this->getRequest()->getParam('shipping_method')
262
- );
263
- $this->_message(
264
- $this->__('Shipping method successfully updated'),
265
- self::MESSAGE_STATUS_SUCCESS
266
- );
267
  } else {
268
- $this->_message(
269
- $this->__('Shipping method is required'),
270
- self::MESSAGE_STATUS_ERROR
271
- );
272
  }
273
  return;
274
- }
275
- catch (Mage_Core_Exception $e) {
276
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
277
- }
278
- catch (Exception $e) {
279
- $this->_message(
280
- $this->__('Unable to update shipping method.'),
281
- self::MESSAGE_STATUS_ERROR
282
- );
283
  Mage::logException($e);
284
  }
285
  }
@@ -306,8 +259,7 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
306
  if ($order) {
307
  $orderId = $order->getId();
308
  $realOrderId = $order->getIncrementId();
309
- $session->setLastOrderId($order->getId())
310
- ->setLastRealOrderId($order->getIncrementId());
311
  }
312
 
313
  // recurring profiles may be created along with the order or without it
@@ -333,11 +285,9 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
333
  $message->addChild('order_id', $orderId);
334
  $this->getResponse()->setBody($message->asNiceXml());
335
  return;
336
- }
337
- catch (Mage_Core_Exception $e) {
338
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
339
- }
340
- catch (Exception $e) {
341
  $this->_message($this->__('Unable to place the order.'), self::MESSAGE_STATUS_ERROR);
342
  Mage::logException($e);
343
  }
@@ -356,17 +306,11 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
356
 
357
  if ($order && $order->getId() && $order->getQuoteId() == $this->_getCheckoutSession()->getQuoteId()) {
358
  $order->cancel()->save();
359
- $this->_getCheckoutSession()
360
- ->unsLastQuoteId()
361
- ->unsLastSuccessQuoteId()
362
- ->unsLastOrderId()
363
  ->unsLastRealOrderId();
364
  }
365
 
366
- $this->_message(
367
- $this->__('Mobile Express Checkout has been canceled.'),
368
- self::MESSAGE_STATUS_SUCCESS
369
- );
370
  } catch (Mage_Core_Exception $e) {
371
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
372
  } catch (Exception $e) {
@@ -379,7 +323,7 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
379
  * Instantiate quote and checkout
380
  *
381
  * @throws Mage_Core_Exception
382
- * @return void
383
  */
384
  protected function _initCheckout()
385
  {
@@ -394,8 +338,7 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
394
  $this->_getCheckoutSession()->setCartWasUpdated(false);
395
 
396
  $this->_checkout = Mage::getSingleton($this->_checkoutType, array(
397
- 'config' => $this->_config,
398
- 'quote' => $quote,
399
  ));
400
  }
401
 
@@ -426,6 +369,7 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
426
  * Search for proper checkout token in request or session or (un)set specified one
427
  * Combined getter/setter
428
  *
 
429
  * @param string $setToken
430
  * @return Mage_Paypal_ExpressController|string
431
  */
@@ -434,9 +378,7 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
434
  if (null !== $setToken) {
435
  if (false === $setToken) {
436
  if (!$this->_getSession()->getExpressCheckoutToken()) { // security measure for avoid unset token twice
437
- Mage::throwException(
438
- $this->__('PayPal Mobile Express Checkout Token does not exist.')
439
- );
440
  }
441
  $this->_getSession()->unsExpressCheckoutToken();
442
  } else {
@@ -444,11 +386,11 @@ class Mage_XmlConnect_Paypal_MeclController extends Mage_XmlConnect_Controller_A
444
  }
445
  return $this;
446
  }
447
- if ($setToken = $this->getRequest()->getParam('token')) {
 
 
448
  if ($setToken !== $this->_getSession()->getExpressCheckoutToken()) {
449
- Mage::throwException(
450
- $this->__('Wrong PayPal Mobile Express Checkout Token specified.')
451
- );
452
  }
453
  } else {
454
  $setToken = $this->_getSession()->getExpressCheckoutToken();
87
  /**
88
  * Make sure customer is logged in
89
  *
90
+ * @return null
91
  */
92
  public function preDispatch()
93
  {
96
  && !Mage::getSingleton('checkout/session')->getQuote()->isAllowedGuestCheckout()
97
  ) {
98
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
99
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR,
 
 
100
  array('logged_in' => '0')
101
  );
102
  return;
114
  $customer = Mage::getSingleton('customer/session')->getCustomer();
115
  if ($customer && $customer->getId()) {
116
  $this->_checkout->setCustomerWithAddressChange(
117
+ $customer, null, $this->_getQuote()->getShippingAddress()
 
 
118
  );
119
  }
120
 
121
+ $token = $this->_checkout->start(Mage::getUrl('*/*/return'), Mage::getUrl('*/*/cancel'));
 
 
 
122
 
123
  if ($token) {
124
  $this->_initToken($token);
128
  $message->addChild('token', $token);
129
  $this->getResponse()->setBody($message->asNiceXml());
130
  } else {
131
+ $this->_message($this->__('Token has not been set.'), self::MESSAGE_STATUS_ERROR);
 
 
 
132
  }
133
  } catch (Mage_Core_Exception $e) {
134
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
135
  } catch (Exception $e) {
136
+ $this->_message($this->__('Unable to start Mobile Express Checkout.'), self::MESSAGE_STATUS_ERROR);
 
 
 
137
  Mage::logException($e);
138
  }
139
  }
147
  try {
148
  $this->_initCheckout();
149
  $this->_checkout->returnFromPaypal($this->_initToken());
150
+ $this->_message($this->__('Mobile Express Checkout processed successfully.'), self::MESSAGE_STATUS_SUCCESS);
 
 
 
 
151
  return;
152
+ } catch (Mage_Core_Exception $e) {
 
153
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
154
+ } catch (Exception $e) {
 
155
  Mage::logException($e);
156
+ $this->_message($this->__('Unable to initialize return action.'), self::MESSAGE_STATUS_ERROR);
 
 
 
157
  }
158
  }
159
 
174
  $messageArray[] = $message;
175
  }
176
 
177
+ $detailsBlock = $this->getLayout()->getBlock('xmlconnect.cart.paypal.mecl.review');
 
178
  if (count($messageArray)) {
179
  $detailsBlock->setPaypalMessages($messageArray);
180
  }
181
 
182
+ $detailsBlock->setQuote($this->_getQuote())->getChild('details')->setQuote($this->_getQuote())
 
183
  ->getChild('totals')->setQuote($this->_getQuote());
 
184
  $this->renderLayout();
185
  return;
186
+ } catch (Mage_Core_Exception $e) {
 
187
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
188
+ } catch (Exception $e) {
189
+ $this->_message($this->__('Unable to initialize express checkout review.'), self::MESSAGE_STATUS_ERROR);
 
 
 
 
190
  Mage::logException($e);
191
  }
192
  }
201
  $this->_checkout->prepareOrderReview($this->_initToken());
202
  $this->loadLayout(false);
203
 
204
+ $this->getLayout()->getBlock('xmlconnect.cart.paypal.mecl.shippingmethods')->setQuote($this->_getQuote());
 
 
205
  $this->renderLayout();
206
  return;
207
+ } catch (Mage_Core_Exception $e) {
 
208
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
209
+ } catch (Exception $e) {
 
210
  $this->_message(
211
  $this->__('Unable to initialize express checkout shipping method list.'),
212
  self::MESSAGE_STATUS_ERROR
223
  try {
224
  $this->_initCheckout();
225
  if ($this->getRequest()->getParam('shipping_method', false)) {
226
+ $this->_checkout->updateShippingMethod($this->getRequest()->getParam('shipping_method'));
227
+ $this->_message($this->__('Shipping method successfully updated'), self::MESSAGE_STATUS_SUCCESS);
 
 
 
 
 
228
  } else {
229
+ $this->_message($this->__('Shipping method is required'), self::MESSAGE_STATUS_ERROR);
 
 
 
230
  }
231
  return;
232
+ } catch (Mage_Core_Exception $e) {
 
233
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
234
+ } catch (Exception $e) {
235
+ $this->_message($this->__('Unable to update shipping method.'), self::MESSAGE_STATUS_ERROR);
 
 
 
 
236
  Mage::logException($e);
237
  }
238
  }
259
  if ($order) {
260
  $orderId = $order->getId();
261
  $realOrderId = $order->getIncrementId();
262
+ $session->setLastOrderId($order->getId())->setLastRealOrderId($order->getIncrementId());
 
263
  }
264
 
265
  // recurring profiles may be created along with the order or without it
285
  $message->addChild('order_id', $orderId);
286
  $this->getResponse()->setBody($message->asNiceXml());
287
  return;
288
+ } catch (Mage_Core_Exception $e) {
 
289
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
290
+ } catch (Exception $e) {
 
291
  $this->_message($this->__('Unable to place the order.'), self::MESSAGE_STATUS_ERROR);
292
  Mage::logException($e);
293
  }
306
 
307
  if ($order && $order->getId() && $order->getQuoteId() == $this->_getCheckoutSession()->getQuoteId()) {
308
  $order->cancel()->save();
309
+ $this->_getCheckoutSession()->unsLastQuoteId()->unsLastSuccessQuoteId()->unsLastOrderId()
 
 
 
310
  ->unsLastRealOrderId();
311
  }
312
 
313
+ $this->_message($this->__('Mobile Express Checkout has been canceled.'), self::MESSAGE_STATUS_SUCCESS);
 
 
 
314
  } catch (Mage_Core_Exception $e) {
315
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
316
  } catch (Exception $e) {
323
  * Instantiate quote and checkout
324
  *
325
  * @throws Mage_Core_Exception
326
+ * @return null
327
  */
328
  protected function _initCheckout()
329
  {
338
  $this->_getCheckoutSession()->setCartWasUpdated(false);
339
 
340
  $this->_checkout = Mage::getSingleton($this->_checkoutType, array(
341
+ 'config' => $this->_config, 'quote' => $quote
 
342
  ));
343
  }
344
 
369
  * Search for proper checkout token in request or session or (un)set specified one
370
  * Combined getter/setter
371
  *
372
+ * @throws Mage_Core_Exception
373
  * @param string $setToken
374
  * @return Mage_Paypal_ExpressController|string
375
  */
378
  if (null !== $setToken) {
379
  if (false === $setToken) {
380
  if (!$this->_getSession()->getExpressCheckoutToken()) { // security measure for avoid unset token twice
381
+ Mage::throwException($this->__('PayPal Mobile Express Checkout Token does not exist.'));
 
 
382
  }
383
  $this->_getSession()->unsExpressCheckoutToken();
384
  } else {
386
  }
387
  return $this;
388
  }
389
+
390
+ $setToken = $this->getRequest()->getParam('token');
391
+ if ($setToken) {
392
  if ($setToken !== $this->_getSession()->getExpressCheckoutToken()) {
393
+ Mage::throwException($this->__('Wrong PayPal Mobile Express Checkout Token specified.'));
 
 
394
  }
395
  } else {
396
  $setToken = $this->_getSession()->getExpressCheckoutToken();
app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php CHANGED
@@ -50,7 +50,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
50
  /**
51
  * Make sure customer is logged in
52
  *
53
- * @return void
54
  */
55
  public function preDispatch()
56
  {
@@ -60,9 +60,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
60
  ) {
61
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
62
  $this->_message(
63
- $this->__('Customer not logged in.'),
64
- self::MESSAGE_STATUS_ERROR,
65
- array('logged_in' => '0')
66
  );
67
  return;
68
  }
@@ -71,15 +69,14 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
71
  /**
72
  * Start MEP Checkout
73
  *
74
- * @return void
75
  */
76
  public function indexAction()
77
  {
78
  try {
79
  if (is_object(Mage::getConfig()->getNode('modules/Enterprise_GiftCardAccount'))) {
80
  $giftcardInfoBlock = $this->getLayout()->addBlock(
81
- 'enterprise_giftcardaccount/checkout_onepage_payment_additional',
82
- 'giftcard_info'
83
  );
84
 
85
  if (intval($giftcardInfoBlock->getAppliedGiftCardAmount())) {
@@ -93,18 +90,12 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
93
 
94
  $this->_initCheckout();
95
  $this->_checkout->initCheckout();
96
- $this->_message(
97
- $this->__('Checkout has been initialized.'),
98
- self::MESSAGE_STATUS_SUCCESS
99
- );
100
  return;
101
  } catch (Mage_Core_Exception $e) {
102
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
103
  } catch (Exception $e) {
104
- $this->_message(
105
- $this->__('Unable to start MEP Checkout.'),
106
- self::MESSAGE_STATUS_ERROR
107
- );
108
  Mage::logException($e);
109
  }
110
  }
@@ -112,7 +103,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
112
  /**
113
  * Save shipping address to current quote using onepage model
114
  *
115
- * @return void
116
  */
117
  public function saveShippingAddressAction()
118
  {
@@ -150,10 +141,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
150
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
151
  Mage::logException($e);
152
  } catch (Exception $e) {
153
- $this->_message(
154
- $this->__('Unable to save shipping address.'),
155
- self::MESSAGE_STATUS_ERROR
156
- );
157
  Mage::logException($e);
158
  }
159
  }
@@ -161,7 +149,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
161
  /**
162
  * Get shipping methods for current quote
163
  *
164
- * @return void
165
  */
166
  public function shippingMethodsAction()
167
  {
@@ -172,10 +160,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
172
  } catch (Mage_Core_Exception $e) {
173
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
174
  } catch (Exception $e) {
175
- $this->_message(
176
- $this->__('Unable to get shipping methods list.'),
177
- self::MESSAGE_STATUS_ERROR
178
- );
179
  Mage::logException($e);
180
  }
181
  }
@@ -183,7 +168,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
183
  /**
184
  * Shipping method save action
185
  *
186
- * @return void
187
  */
188
  public function saveShippingMethodAction()
189
  {
@@ -195,12 +180,9 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
195
  try {
196
  $this->_initCheckout();
197
  $data = $this->getRequest()->getPost('shipping_method', '');
198
- $this->_getQuote()->getShippingAddress()
199
- ->setShippingMethod($data)
200
- ->setCollectShippingRates(true)
201
- ->save();
202
-
203
  $result = $this->_checkout->saveShippingMethod($data);
 
204
  if (!isset($result['error'])) {
205
  /** @var $message Mage_XmlConnect_Model_Simplexml_Element */
206
  $message = Mage::getModel('xmlconnect/simplexml_element', '<message></message>');
@@ -211,15 +193,8 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
211
  } else {
212
  $quoteAddress = $this->_getQuote()->getShippingAddress();
213
  }
214
- $taxAmount = Mage::helper('core')->currency(
215
- $quoteAddress->getBaseTaxAmount(),
216
- false,
217
- false
218
- );
219
- $message->addChild(
220
- 'tax_amount',
221
- Mage::helper('xmlconnect')->formatPriceForXml($taxAmount)
222
- );
223
  $this->_getQuote()->collectTotals()->save();
224
  $this->getResponse()->setBody($message->asNiceXml());
225
  } else {
@@ -231,10 +206,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
231
  } catch (Mage_Core_Exception $e) {
232
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
233
  } catch (Exception $e) {
234
- $this->_message(
235
- $this->__('Unable to save shipping method.'),
236
- self::MESSAGE_STATUS_ERROR
237
- );
238
  Mage::logException($e);
239
  }
240
  }
@@ -242,7 +214,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
242
  /**
243
  * Shopping cart totals
244
  *
245
- * @return void
246
  */
247
  public function cartTotalsAction()
248
  {
@@ -262,7 +234,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
262
  /**
263
  * Submit the order
264
  *
265
- * @return void
266
  */
267
  public function saveOrderAction()
268
  {
@@ -283,9 +255,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
283
  $data = $this->getRequest()->getPost('payment', array());
284
 
285
  if (Mage::getSingleton('customer/session')->isLoggedIn()) {
286
- $data['payer'] = Mage::getSingleton('customer/session')
287
- ->getCustomer()
288
- ->getEmail();
289
  }
290
 
291
  $this->_checkout->savePayment($data);
@@ -324,7 +294,7 @@ class Mage_XmlConnect_Paypal_MepController extends Mage_XmlConnect_Controller_Ac
324
  * Instantiate quote and checkout
325
  *
326
  * @throws Mage_Core_Exception
327
- * @return void
328
  */
329
  protected function _initCheckout()
330
  {
50
  /**
51
  * Make sure customer is logged in
52
  *
53
+ * @return null
54
  */
55
  public function preDispatch()
56
  {
60
  ) {
61
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
62
  $this->_message(
63
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
64
  );
65
  return;
66
  }
69
  /**
70
  * Start MEP Checkout
71
  *
72
+ * @return null
73
  */
74
  public function indexAction()
75
  {
76
  try {
77
  if (is_object(Mage::getConfig()->getNode('modules/Enterprise_GiftCardAccount'))) {
78
  $giftcardInfoBlock = $this->getLayout()->addBlock(
79
+ 'enterprise_giftcardaccount/checkout_onepage_payment_additional', 'giftcard_info'
 
80
  );
81
 
82
  if (intval($giftcardInfoBlock->getAppliedGiftCardAmount())) {
90
 
91
  $this->_initCheckout();
92
  $this->_checkout->initCheckout();
93
+ $this->_message($this->__('Checkout has been initialized.'), self::MESSAGE_STATUS_SUCCESS);
 
 
 
94
  return;
95
  } catch (Mage_Core_Exception $e) {
96
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
97
  } catch (Exception $e) {
98
+ $this->_message($this->__('Unable to start MEP Checkout.'), self::MESSAGE_STATUS_ERROR);
 
 
 
99
  Mage::logException($e);
100
  }
101
  }
103
  /**
104
  * Save shipping address to current quote using onepage model
105
  *
106
+ * @return null
107
  */
108
  public function saveShippingAddressAction()
109
  {
141
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
142
  Mage::logException($e);
143
  } catch (Exception $e) {
144
+ $this->_message($this->__('Unable to save shipping address.'), self::MESSAGE_STATUS_ERROR);
 
 
 
145
  Mage::logException($e);
146
  }
147
  }
149
  /**
150
  * Get shipping methods for current quote
151
  *
152
+ * @return null
153
  */
154
  public function shippingMethodsAction()
155
  {
160
  } catch (Mage_Core_Exception $e) {
161
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
162
  } catch (Exception $e) {
163
+ $this->_message($this->__('Unable to get shipping methods list.'), self::MESSAGE_STATUS_ERROR);
 
 
 
164
  Mage::logException($e);
165
  }
166
  }
168
  /**
169
  * Shipping method save action
170
  *
171
+ * @return null
172
  */
173
  public function saveShippingMethodAction()
174
  {
180
  try {
181
  $this->_initCheckout();
182
  $data = $this->getRequest()->getPost('shipping_method', '');
183
+ $this->_getQuote()->getShippingAddress()->setShippingMethod($data)->setCollectShippingRates(true)->save();
 
 
 
 
184
  $result = $this->_checkout->saveShippingMethod($data);
185
+
186
  if (!isset($result['error'])) {
187
  /** @var $message Mage_XmlConnect_Model_Simplexml_Element */
188
  $message = Mage::getModel('xmlconnect/simplexml_element', '<message></message>');
193
  } else {
194
  $quoteAddress = $this->_getQuote()->getShippingAddress();
195
  }
196
+ $taxAmount = Mage::helper('core')->currency($quoteAddress->getBaseTaxAmount(), false, false);
197
+ $message->addChild('tax_amount', Mage::helper('xmlconnect')->formatPriceForXml($taxAmount));
 
 
 
 
 
 
 
198
  $this->_getQuote()->collectTotals()->save();
199
  $this->getResponse()->setBody($message->asNiceXml());
200
  } else {
206
  } catch (Mage_Core_Exception $e) {
207
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
208
  } catch (Exception $e) {
209
+ $this->_message($this->__('Unable to save shipping method.'), self::MESSAGE_STATUS_ERROR);
 
 
 
210
  Mage::logException($e);
211
  }
212
  }
214
  /**
215
  * Shopping cart totals
216
  *
217
+ * @return null
218
  */
219
  public function cartTotalsAction()
220
  {
234
  /**
235
  * Submit the order
236
  *
237
+ * @return null
238
  */
239
  public function saveOrderAction()
240
  {
255
  $data = $this->getRequest()->getPost('payment', array());
256
 
257
  if (Mage::getSingleton('customer/session')->isLoggedIn()) {
258
+ $data['payer'] = Mage::getSingleton('customer/session')->getCustomer()->getEmail();
 
 
259
  }
260
 
261
  $this->_checkout->savePayment($data);
294
  * Instantiate quote and checkout
295
  *
296
  * @throws Mage_Core_Exception
297
+ * @return null
298
  */
299
  protected function _initCheckout()
300
  {
app/code/core/Mage/XmlConnect/controllers/PbridgeController.php CHANGED
@@ -70,7 +70,7 @@ class Mage_XmlConnect_PbridgeController extends Mage_Core_Controller_Front_Actio
70
  * Index Action.
71
  * Forward to result action
72
  *
73
- * @return void
74
  */
75
  public function indexAction()
76
  {
@@ -80,7 +80,7 @@ class Mage_XmlConnect_PbridgeController extends Mage_Core_Controller_Front_Actio
80
  /**
81
  * Result Action
82
  *
83
- * @return void
84
  */
85
  public function resultAction()
86
  {
70
  * Index Action.
71
  * Forward to result action
72
  *
73
+ * @return null
74
  */
75
  public function indexAction()
76
  {
80
  /**
81
  * Result Action
82
  *
83
+ * @return null
84
  */
85
  public function resultAction()
86
  {
app/code/core/Mage/XmlConnect/controllers/ReviewController.php CHANGED
@@ -40,26 +40,17 @@ class Mage_XmlConnect_ReviewController extends Mage_XmlConnect_Controller_Action
40
  */
41
  protected function _initProduct()
42
  {
43
- Mage::dispatchEvent(
44
- 'review_controller_product_init_before',
45
- array('controller_action' => $this)
46
- );
47
 
48
  $productId = (int) $this->getRequest()->getParam('id');
49
  $product = $this->_loadProduct($productId);
50
 
51
  try {
52
- Mage::dispatchEvent(
53
- 'review_controller_product_init',
54
- array('product' => $product)
55
- );
56
- Mage::dispatchEvent(
57
- 'review_controller_product_init_after',
58
- array(
59
- 'product' => $product,
60
- 'controller_action' => $this
61
- )
62
- );
63
  } catch (Mage_Core_Exception $e) {
64
  Mage::logException($e);
65
  return false;
@@ -81,14 +72,9 @@ class Mage_XmlConnect_ReviewController extends Mage_XmlConnect_Controller_Action
81
  return false;
82
  }
83
 
84
- $product = Mage::getModel('catalog/product')
85
- ->setStoreId(Mage::app()->getStore()->getId())
86
- ->load($productId);
87
  /** @var $product Mage_Catalog_Model_Product */
88
- if (!$product->getId()
89
- || !$product->isVisibleInCatalog()
90
- || !$product->isVisibleInSiteVisibility()
91
- ) {
92
  return false;
93
  }
94
 
@@ -107,9 +93,7 @@ class Mage_XmlConnect_ReviewController extends Mage_XmlConnect_Controller_Action
107
  */
108
  protected function _checkGuestAllowed()
109
  {
110
- if (Mage::getSingleton('customer/session')->isLoggedIn()
111
- || Mage::helper('review')->getIsGuestAllowToWrite()
112
- ) {
113
  return true;
114
  }
115
 
@@ -123,7 +107,7 @@ class Mage_XmlConnect_ReviewController extends Mage_XmlConnect_Controller_Action
123
  /**
124
  * Get review form
125
  *
126
- * @return void
127
  */
128
  public function formAction()
129
  {
@@ -145,7 +129,7 @@ class Mage_XmlConnect_ReviewController extends Mage_XmlConnect_Controller_Action
145
  /**
146
  * Save product review
147
  *
148
- * @return void
149
  */
150
  public function saveAction()
151
  {
@@ -160,30 +144,25 @@ class Mage_XmlConnect_ReviewController extends Mage_XmlConnect_Controller_Action
160
  if ($product && !empty($data)) {
161
  /** @var $review Mage_Review_Model_Review */
162
  $review = Mage::getModel('review/review')->setData($data);
163
-
164
  $validate = $review->validate();
 
165
  if ($validate === true) {
166
  try {
167
  $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))
168
- ->setEntityPkValue($product->getId())
169
- ->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)
170
  ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
171
  ->setStoreId(Mage::app()->getStore()->getId())
172
- ->setStores(array(Mage::app()->getStore()->getId()))
173
- ->save();
174
 
175
  foreach ($rating as $ratingId => $optionId) {
176
- Mage::getModel('rating/rating')
177
- ->setRatingId($ratingId)
178
- ->setReviewId($review->getId())
179
  ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
180
  ->addOptionVote($optionId, $product->getId());
181
  }
182
 
183
  $review->aggregate();
184
  $this->_message(
185
- $this->__('Your review has been accepted for moderation.'),
186
- self::MESSAGE_STATUS_SUCCESS
187
  );
188
  } catch (Exception $e) {
189
  $this->_message($this->__('Unable to post the review.'), self::MESSAGE_STATUS_ERROR);
@@ -210,6 +189,6 @@ class Mage_XmlConnect_ReviewController extends Mage_XmlConnect_Controller_Action
210
  */
211
  private function _trimDot($text)
212
  {
213
- return trim((string)$text, " \n\r\t.");
214
  }
215
  }
40
  */
41
  protected function _initProduct()
42
  {
43
+ Mage::dispatchEvent('review_controller_product_init_before', array('controller_action' => $this));
 
 
 
44
 
45
  $productId = (int) $this->getRequest()->getParam('id');
46
  $product = $this->_loadProduct($productId);
47
 
48
  try {
49
+ Mage::dispatchEvent('review_controller_product_init', array('product' => $product));
50
+ Mage::dispatchEvent('review_controller_product_init_after', array(
51
+ 'product' => $product,
52
+ 'controller_action' => $this
53
+ ));
 
 
 
 
 
 
54
  } catch (Mage_Core_Exception $e) {
55
  Mage::logException($e);
56
  return false;
72
  return false;
73
  }
74
 
75
+ $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($productId);
 
 
76
  /** @var $product Mage_Catalog_Model_Product */
77
+ if (!$product->getId() || !$product->isVisibleInCatalog() || !$product->isVisibleInSiteVisibility()) {
 
 
 
78
  return false;
79
  }
80
 
93
  */
94
  protected function _checkGuestAllowed()
95
  {
96
+ if (Mage::getSingleton('customer/session')->isLoggedIn() || Mage::helper('review')->getIsGuestAllowToWrite()) {
 
 
97
  return true;
98
  }
99
 
107
  /**
108
  * Get review form
109
  *
110
+ * @return null
111
  */
112
  public function formAction()
113
  {
129
  /**
130
  * Save product review
131
  *
132
+ * @return null
133
  */
134
  public function saveAction()
135
  {
144
  if ($product && !empty($data)) {
145
  /** @var $review Mage_Review_Model_Review */
146
  $review = Mage::getModel('review/review')->setData($data);
 
147
  $validate = $review->validate();
148
+
149
  if ($validate === true) {
150
  try {
151
  $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))
152
+ ->setEntityPkValue($product->getId())->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)
 
153
  ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
154
  ->setStoreId(Mage::app()->getStore()->getId())
155
+ ->setStores(array(Mage::app()->getStore()->getId()))->save();
 
156
 
157
  foreach ($rating as $ratingId => $optionId) {
158
+ Mage::getModel('rating/rating')->setRatingId($ratingId)->setReviewId($review->getId())
 
 
159
  ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
160
  ->addOptionVote($optionId, $product->getId());
161
  }
162
 
163
  $review->aggregate();
164
  $this->_message(
165
+ $this->__('Your review has been accepted for moderation.'), self::MESSAGE_STATUS_SUCCESS
 
166
  );
167
  } catch (Exception $e) {
168
  $this->_message($this->__('Unable to post the review.'), self::MESSAGE_STATUS_ERROR);
189
  */
190
  private function _trimDot($text)
191
  {
192
+ return trim($text, " \n\r\t.");
193
  }
194
  }
app/code/core/Mage/XmlConnect/controllers/WishlistController.php CHANGED
@@ -36,7 +36,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
36
  /**
37
  * Check if customer is logged in
38
  *
39
- * @return void
40
  */
41
  public function preDispatch()
42
  {
@@ -44,9 +44,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
44
  if (!$this->_getCustomerSession()->isLoggedIn()) {
45
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
46
  $this->_message(
47
- $this->__('Customer not logged in.'),
48
- self::MESSAGE_STATUS_ERROR,
49
- array('logged_in' => '0')
50
  );
51
  return ;
52
  }
@@ -86,7 +84,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
86
  /**
87
  * Display customer wishlist
88
  *
89
- * @return void
90
  */
91
  public function indexAction()
92
  {
@@ -108,7 +106,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
108
  /**
109
  * Adding new item
110
  *
111
- * @return void
112
  */
113
  public function addAction()
114
  {
@@ -134,19 +132,15 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
134
  $buyRequest = new Varien_Object($this->getRequest()->getParams());
135
  $result = $wishlist->addNewItem($product, $buyRequest);
136
  if (strlen(trim((string)$request->getParam('description')))) {
137
- $result->setDescription($request->getParam('description'))
138
- ->save();
139
  }
140
  $wishlist->save();
141
 
142
- Mage::dispatchEvent(
143
- 'wishlist_add_product',
144
- array(
145
- 'wishlist' => $wishlist,
146
- 'product' => $product,
147
- 'item' => $result
148
- )
149
- );
150
 
151
  Mage::helper('wishlist')->calculate();
152
 
@@ -159,8 +153,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
159
  } catch (Exception $e) {
160
  Mage::logException($e);
161
  $this->_message(
162
- $this->__('An error occurred while adding item to wishlist.'),
163
- self::MESSAGE_STATUS_ERROR
164
  );
165
  }
166
  }
@@ -168,7 +161,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
168
  /**
169
  * Remove item
170
  *
171
- * @return void
172
  */
173
  public function removeAction()
174
  {
@@ -196,7 +189,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
196
  /**
197
  * Clear wishlist action
198
  *
199
- * @return void
200
  */
201
  public function clearAction()
202
  {
@@ -213,8 +206,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
213
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
214
  } catch(Exception $e) {
215
  $this->_message(
216
- $this->__('An error occurred while removing items from wishlist.'),
217
- self::MESSAGE_STATUS_ERROR
218
  );
219
  }
220
 
@@ -224,7 +216,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
224
  /**
225
  * Update wishlist item comments
226
  *
227
- * @return void
228
  */
229
  public function updateAction()
230
  {
@@ -283,7 +275,7 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
283
  * If Product has required options - item removed from wishlist and redirect
284
  * to product view page with message about needed defined required options
285
  *
286
- * @return void
287
  */
288
  public function cartAction()
289
  {
@@ -307,17 +299,11 @@ class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Acti
307
  $cart->save()->getQuote()->collectTotals();
308
  $wishlist->save();
309
  Mage::helper('wishlist')->calculate();
310
- $this->_message(
311
- $this->__('Item has been added to cart.'),
312
- self::MESSAGE_STATUS_SUCCESS
313
- );
314
 
315
  } catch (Mage_Core_Exception $e) {
316
  if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {
317
- $this->_message(
318
- $this->__('Product(s) currently out of stock.'),
319
- self::MESSAGE_STATUS_ERROR
320
- );
321
  } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS
322
  || $e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_IS_GROUPED_PRODUCT
323
  ) {
36
  /**
37
  * Check if customer is logged in
38
  *
39
+ * @return null
40
  */
41
  public function preDispatch()
42
  {
44
  if (!$this->_getCustomerSession()->isLoggedIn()) {
45
  $this->setFlag('', self::FLAG_NO_DISPATCH, true);
46
  $this->_message(
47
+ $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0')
 
 
48
  );
49
  return ;
50
  }
84
  /**
85
  * Display customer wishlist
86
  *
87
+ * @return null
88
  */
89
  public function indexAction()
90
  {
106
  /**
107
  * Adding new item
108
  *
109
+ * @return null
110
  */
111
  public function addAction()
112
  {
132
  $buyRequest = new Varien_Object($this->getRequest()->getParams());
133
  $result = $wishlist->addNewItem($product, $buyRequest);
134
  if (strlen(trim((string)$request->getParam('description')))) {
135
+ $result->setDescription($request->getParam('description'))->save();
 
136
  }
137
  $wishlist->save();
138
 
139
+ Mage::dispatchEvent('wishlist_add_product', array(
140
+ 'wishlist' => $wishlist,
141
+ 'product' => $product,
142
+ 'item' => $result
143
+ ));
 
 
 
144
 
145
  Mage::helper('wishlist')->calculate();
146
 
153
  } catch (Exception $e) {
154
  Mage::logException($e);
155
  $this->_message(
156
+ $this->__('An error occurred while adding item to wishlist.'), self::MESSAGE_STATUS_ERROR
 
157
  );
158
  }
159
  }
161
  /**
162
  * Remove item
163
  *
164
+ * @return null
165
  */
166
  public function removeAction()
167
  {
189
  /**
190
  * Clear wishlist action
191
  *
192
+ * @return null
193
  */
194
  public function clearAction()
195
  {
206
  $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
207
  } catch(Exception $e) {
208
  $this->_message(
209
+ $this->__('An error occurred while removing items from wishlist.'), self::MESSAGE_STATUS_ERROR
 
210
  );
211
  }
212
 
216
  /**
217
  * Update wishlist item comments
218
  *
219
+ * @return null
220
  */
221
  public function updateAction()
222
  {
275
  * If Product has required options - item removed from wishlist and redirect
276
  * to product view page with message about needed defined required options
277
  *
278
+ * @return null
279
  */
280
  public function cartAction()
281
  {
299
  $cart->save()->getQuote()->collectTotals();
300
  $wishlist->save();
301
  Mage::helper('wishlist')->calculate();
302
+ $this->_message($this->__('Item has been added to cart.'), self::MESSAGE_STATUS_SUCCESS);
 
 
 
303
 
304
  } catch (Mage_Core_Exception $e) {
305
  if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {
306
+ $this->_message($this->__('Product(s) currently out of stock.'), self::MESSAGE_STATUS_ERROR);
 
 
 
307
  } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS
308
  || $e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_IS_GROUPED_PRODUCT
309
  ) {
app/code/core/Mage/XmlConnect/etc/config.xml CHANGED
@@ -28,7 +28,7 @@
28
  <config>
29
  <modules>
30
  <Mage_XmlConnect>
31
- <version>1.4.0.14</version>
32
  <innerVersion>22.1</innerVersion>
33
  </Mage_XmlConnect>
34
  </modules>
@@ -36,10 +36,11 @@
36
  <models>
37
  <xmlconnect>
38
  <class>Mage_XmlConnect_Model</class>
39
- <resourceModel>xmlconnect_mysql4</resourceModel>
40
  </xmlconnect>
41
- <xmlconnect_mysql4>
42
- <class>Mage_XmlConnect_Model_Mysql4</class>
 
43
  <entities>
44
  <application><table>xmlconnect_application</table></application>
45
  <history><table>xmlconnect_history</table></history>
@@ -48,7 +49,7 @@
48
  <template><table>xmlconnect_notification_template</table></template>
49
  <configData><table>xmlconnect_config_data</table></configData>
50
  </entities>
51
- </xmlconnect_mysql4>
52
  </models>
53
  <blocks>
54
  <xmlconnect>
@@ -64,7 +65,7 @@
64
  <xmlconnect_setup>
65
  <setup>
66
  <module>Mage_XmlConnect</module>
67
- <class>Mage_XmlConnect_Model_Mysql4_Setup</class>
68
  </setup>
69
  </xmlconnect_setup>
70
  </resources>
@@ -386,6 +387,7 @@
386
  </screen_size>
387
  <xmlconnect>
388
  <mobile_application>
 
389
  <magentocommerce_url>www.magentocommerce.com/products/index.php/mobile/activate/index/key/</magentocommerce_url>
390
  <activation_key_url>http://www.magentocommerce.com/product/mobile</activation_key_url>
391
  <resubmission_key_url>http://www.magentocommerce.com/product/mobile#resubmission</resubmission_key_url>
28
  <config>
29
  <modules>
30
  <Mage_XmlConnect>
31
+ <version>1.6.0.0</version>
32
  <innerVersion>22.1</innerVersion>
33
  </Mage_XmlConnect>
34
  </modules>
36
  <models>
37
  <xmlconnect>
38
  <class>Mage_XmlConnect_Model</class>
39
+ <resourceModel>xmlconnect_resource</resourceModel>
40
  </xmlconnect>
41
+ <xmlconnect_resource>
42
+ <class>Mage_XmlConnect_Model_Resource</class>
43
+ <deprecatedNode>xmlconnect_mysql4</deprecatedNode>
44
  <entities>
45
  <application><table>xmlconnect_application</table></application>
46
  <history><table>xmlconnect_history</table></history>
49
  <template><table>xmlconnect_notification_template</table></template>
50
  <configData><table>xmlconnect_config_data</table></configData>
51
  </entities>
52
+ </xmlconnect_resource>
53
  </models>
54
  <blocks>
55
  <xmlconnect>
65
  <xmlconnect_setup>
66
  <setup>
67
  <module>Mage_XmlConnect</module>
68
+ <class>Mage_XmlConnect_Model_Resource_Setup</class>
69
  </setup>
70
  </xmlconnect_setup>
71
  </resources>
387
  </screen_size>
388
  <xmlconnect>
389
  <mobile_application>
390
+ <curl_ssl_verifypeer>1</curl_ssl_verifypeer>
391
  <magentocommerce_url>www.magentocommerce.com/products/index.php/mobile/activate/index/key/</magentocommerce_url>
392
  <activation_key_url>http://www.magentocommerce.com/product/mobile</activation_key_url>
393
  <resubmission_key_url>http://www.magentocommerce.com/product/mobile#resubmission</resubmission_key_url>
app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /** @var $installer Mage_XmlConnect_Model_Resource_Setup */
28
+ $installer = $this;
29
+ $installer->startSetup();
30
+
31
+ /**
32
+ * Create table 'xmlconnect_application'
33
+ */
34
+ $appTableName = $installer->getTable('xmlconnect/application');
35
+ $table = $installer->getConnection()
36
+ ->newTable($appTableName)
37
+ ->addColumn('application_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
38
+ 'identity' => true,
39
+ 'unsigned' => true,
40
+ 'nullable' => false,
41
+ 'primary' => true,
42
+ ), 'Application Id')
43
+ ->addColumn('name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
44
+ 'nullable' => false,
45
+ ), 'Application Name')
46
+ ->addColumn('code', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array(
47
+ 'nullable' => false,
48
+ ), 'Application Code')
49
+ ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array(
50
+ 'nullable' => false,
51
+ ), 'Device Type')
52
+ ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
53
+ 'unsigned' => true,
54
+ ), 'Store Id')
55
+ ->addColumn('active_from', Varien_Db_Ddl_Table::TYPE_DATE, null, array(
56
+ ), 'Active From')
57
+ ->addColumn('active_to', Varien_Db_Ddl_Table::TYPE_DATE, null, array(
58
+ ), 'Active To')
59
+ ->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
60
+ ), 'Updated At')
61
+ ->addColumn('status', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
62
+ 'unsigned' => true,
63
+ 'nullable' => false,
64
+ 'default' => '0',
65
+ ), 'Status')
66
+ ->addColumn('browsing_mode', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
67
+ 'unsigned' => true,
68
+ 'default' => '0',
69
+ ), 'Browsing Mode')
70
+ ->addIndex(
71
+ $installer->getIdxName($appTableName, array('code'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE),
72
+ array('code'),
73
+ array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
74
+ )
75
+ ->addForeignKey(
76
+ $installer->getFkName($appTableName, 'store_id', $installer->getTable('core/store'), 'store_id'),
77
+ 'store_id',
78
+ $installer->getTable('core/store'),
79
+ 'store_id',
80
+ Varien_Db_Ddl_Table::ACTION_SET_NULL,
81
+ Varien_Db_Ddl_Table::ACTION_SET_NULL
82
+ )
83
+ ->setComment('Xmlconnect Application');
84
+ $installer->getConnection()->createTable($table);
85
+
86
+ /**
87
+ * Create table 'xmlconnect_config_data'
88
+ */
89
+ $configTableName = $installer->getTable('xmlconnect/configData');
90
+ $configTable = $installer->getConnection()
91
+ ->newTable($configTableName)
92
+ ->addColumn('application_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
93
+ 'unsigned' => true,
94
+ 'nullable' => false,
95
+ ), 'Application Id')
96
+ ->addColumn('category', Varien_Db_Ddl_Table::TYPE_TEXT, 60, array(
97
+ 'nullable' => false,
98
+ 'default' => 'default',
99
+ ), 'Category')
100
+ ->addColumn('path', Varien_Db_Ddl_Table::TYPE_TEXT, 250, array(
101
+ 'nullable' => false,
102
+ ), 'Path')
103
+ ->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(
104
+ 'nullable' => false,
105
+ ), 'Value')
106
+ ->addIndex(
107
+ $installer->getIdxName(
108
+ $configTableName,
109
+ array('application_id', 'category', 'path'),
110
+ Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
111
+ ),
112
+ array('application_id', 'category', 'path'),
113
+ array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
114
+ )
115
+ ->addForeignKey(
116
+ $installer->getFkName($configTableName, 'application_id', $appTableName, 'application_id'),
117
+ 'application_id',
118
+ $appTableName,
119
+ 'application_id',
120
+ Varien_Db_Ddl_Table::ACTION_CASCADE,
121
+ Varien_Db_Ddl_Table::ACTION_CASCADE
122
+ )
123
+ ->setComment('Xmlconnect Configuration Data');
124
+ $installer->getConnection()->createTable($configTable);
125
+
126
+ /**
127
+ * Create table 'xmlconnect_history'
128
+ */
129
+ $historyTableName = $installer->getTable('xmlconnect/history');
130
+ $historyTable = $installer->getConnection()
131
+ ->newTable($historyTableName)
132
+ ->addColumn('history_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
133
+ 'identity' => true,
134
+ 'unsigned' => true,
135
+ 'nullable' => false,
136
+ 'primary' => true,
137
+ ), 'History Id')
138
+ ->addColumn('application_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
139
+ 'unsigned' => true,
140
+ 'nullable' => false,
141
+ ), 'Application Id')
142
+ ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
143
+ ), 'Created At')
144
+ ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
145
+ 'unsigned' => true,
146
+ ), 'Store Id')
147
+ ->addColumn('params', Varien_Db_Ddl_Table::TYPE_BLOB, '64K', array(
148
+ ), 'Params')
149
+ ->addColumn('title', Varien_Db_Ddl_Table::TYPE_TEXT, 200, array(
150
+ 'nullable' => false,
151
+ ), 'Title')
152
+ ->addColumn('activation_key', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
153
+ 'nullable' => false,
154
+ ), 'Activation Key')
155
+ ->addColumn('name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
156
+ 'nullable' => false,
157
+ ), 'Application Name')
158
+ ->addColumn('code', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array(
159
+ 'nullable' => false,
160
+ ), 'Application Code')
161
+ ->addForeignKey(
162
+ $installer->getFkName($historyTableName, 'application_id', $appTableName, 'application_id'),
163
+ 'application_id',
164
+ $appTableName,
165
+ 'application_id',
166
+ Varien_Db_Ddl_Table::ACTION_CASCADE,
167
+ Varien_Db_Ddl_Table::ACTION_CASCADE
168
+ )
169
+ ->setComment('Xmlconnect History');
170
+ $installer->getConnection()->createTable($historyTable);
171
+
172
+ $entityTypeId = $installer->getEntityTypeId('catalog_category');
173
+ $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
174
+ $attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
175
+
176
+ $installer->addAttribute('catalog_category', 'thumbnail', array(
177
+ 'type' => 'varchar',
178
+ 'label' => 'Thumbnail Image',
179
+ 'input' => 'image',
180
+ 'backend' => 'catalog/category_attribute_backend_image',
181
+ 'required' => false,
182
+ 'sort_order' => 4,
183
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
184
+ 'group' => 'General Information'
185
+ ));
186
+
187
+ /**
188
+ * Create table 'xmlconnect_notification_template'
189
+ */
190
+ $templateTableName = $installer->getTable('xmlconnect/template');
191
+ $templateTable = $installer->getConnection()
192
+ ->newTable($templateTableName)
193
+ ->addColumn('template_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
194
+ 'identity' => true,
195
+ 'unsigned' => true,
196
+ 'nullable' => false,
197
+ 'primary' => true,
198
+ ), 'Template Id')
199
+ ->addColumn('name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
200
+ 'nullable' => false,
201
+ ), 'Template Name')
202
+ ->addColumn('push_title', Varien_Db_Ddl_Table::TYPE_TEXT, 140, array(
203
+ 'nullable' => false,
204
+ ), 'Push Notification Title')
205
+ ->addColumn('message_title', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
206
+ 'nullable' => false,
207
+ ), 'Message Title')
208
+ ->addColumn('content', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(
209
+ 'nullable' => false,
210
+ ), 'Message Content')
211
+ ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
212
+ ), 'Created At')
213
+ ->addColumn('modified_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
214
+ ), 'Modified At')
215
+ ->addColumn('application_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
216
+ 'unsigned' => true,
217
+ 'nullable' => false,
218
+ ), 'Application Id')
219
+ ->addForeignKey(
220
+ $installer->getFkName($templateTableName, 'application_id', $appTableName, 'application_id'),
221
+ 'application_id',
222
+ $appTableName,
223
+ 'application_id',
224
+ Varien_Db_Ddl_Table::ACTION_CASCADE,
225
+ Varien_Db_Ddl_Table::ACTION_CASCADE
226
+ )
227
+ ->setComment('Xmlconnect Notification Template');
228
+ $installer->getConnection()->createTable($templateTable);
229
+
230
+
231
+ /**
232
+ * Create table 'xmlconnect_queue'
233
+ */
234
+ $queueTableName = $installer->getTable('xmlconnect/queue');
235
+ $queueTable = $installer->getConnection()
236
+ ->newTable($queueTableName)
237
+ ->addColumn('queue_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
238
+ 'identity' => true,
239
+ 'unsigned' => true,
240
+ 'nullable' => false,
241
+ 'primary' => true,
242
+ ), 'Queue Id')
243
+ ->addColumn('create_time', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
244
+ ), 'Created At')
245
+ ->addColumn('exec_time', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
246
+ ), 'Scheduled Execution Time')
247
+ ->addColumn('template_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
248
+ 'unsigned' => true,
249
+ 'nullable' => false,
250
+ ), 'Template Id')
251
+ ->addColumn('push_title', Varien_Db_Ddl_Table::TYPE_TEXT, 140, array(
252
+ 'nullable' => false,
253
+ ), 'Push Notification Title')
254
+ ->addColumn('message_title', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
255
+ 'default' => ''
256
+ ), 'Message Title')
257
+ ->addColumn('content', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(
258
+ 'default' => ''
259
+ ), 'Message Content')
260
+ ->addColumn('status', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
261
+ 'unsigned' => true,
262
+ 'nullable' => false,
263
+ 'default' => 0
264
+ ), 'Status')
265
+ ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 12, array(
266
+ 'nullable' => false,
267
+ ), 'Type of Notification')
268
+ ->addForeignKey(
269
+ $installer->getFkName($queueTableName, 'template_id', $templateTableName, 'template_id'),
270
+ 'template_id',
271
+ $templateTableName,
272
+ 'template_id',
273
+ Varien_Db_Ddl_Table::ACTION_CASCADE,
274
+ Varien_Db_Ddl_Table::ACTION_CASCADE
275
+ )
276
+ ->setComment('Xmlconnect Notification Queue');
277
+ $installer->getConnection()->createTable($queueTable);
278
+
279
+ $installer->endSetup();
app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.13-1.4.0.14.php CHANGED
@@ -36,28 +36,49 @@
36
  $installer = $this;
37
  $installer->startSetup();
38
 
39
- $configTable = $installer->getTable('xmlconnect/configData');
40
-
41
- $installer->run("CREATE TABLE `{$configTable}` (
42
- `application_id` smallint(5) unsigned NOT NULL,
43
- `category` varchar( 60 ) NOT NULL DEFAULT 'default',
44
- `path` varchar( 250 ) NOT NULL,
45
- `value` TEXT NOT NULL
46
- ) ENGINE = INNODB DEFAULT CHARSET=utf8;");
47
-
48
- $installer->getConnection()->addKey(
49
- $configTable,
50
- 'UNQ_XMLCONNECT_CONFIG',
51
- array('application_id', 'category', 'path'),
52
- 'unique'
53
- );
54
-
55
- $installer->getConnection()->addConstraint(
56
- 'FK_APPLICATION_ID',
57
- $configTable,
58
- 'application_id',
59
- $installer->getTable('xmlconnect/application'),
60
- 'application_id'
61
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
  $installer->endSetup();
36
  $installer = $this;
37
  $installer->startSetup();
38
 
39
+ /**
40
+ * Create table 'xmlconnect_config_data'
41
+ */
42
+ $configTableName = $installer->getTable('xmlconnect/configData');
43
+ $configTable = $installer->getConnection()
44
+ ->newTable($configTableName)
45
+ ->addColumn('application_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
46
+ 'unsigned' => true,
47
+ 'nullable' => false,
48
+ ), 'Application Id')
49
+ ->addColumn('category', Varien_Db_Ddl_Table::TYPE_TEXT, 60, array(
50
+ 'nullable' => false,
51
+ 'default' => 'default',
52
+ ), 'Category')
53
+ ->addColumn('path', Varien_Db_Ddl_Table::TYPE_TEXT, 250, array(
54
+ 'nullable' => false,
55
+ ), 'Path')
56
+ ->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(
57
+ 'nullable' => false,
58
+ ), 'Value')
59
+ ->addIndex(
60
+ $installer->getIdxName(
61
+ $configTableName,
62
+ array('application_id', 'category', 'path'),
63
+ Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
64
+ ),
65
+ array('application_id', 'category', 'path'),
66
+ array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
67
+ )
68
+ ->addForeignKey(
69
+ $installer->getFkName(
70
+ $configTableName,
71
+ 'application_id',
72
+ $installer->getTable('xmlconnect/application'),
73
+ 'application_id'
74
+ ),
75
+ 'application_id',
76
+ $installer->getTable('xmlconnect/application'),
77
+ 'application_id',
78
+ Varien_Db_Ddl_Table::ACTION_CASCADE,
79
+ Varien_Db_Ddl_Table::ACTION_CASCADE
80
+ )
81
+ ->setComment('Xmlconnect Configuration Data');
82
+ $installer->getConnection()->createTable($configTable);
83
 
84
  $installer->endSetup();
app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.9-1.4.0.10.php CHANGED
@@ -27,11 +27,6 @@
27
  $installer = $this;
28
  $installer->startSetup();
29
 
30
- $installer->getConnection()->changeColumn(
31
- $installer->getTable('xmlconnect/queue'),
32
- 'exec_time',
33
- 'exec_time',
34
- 'TIMESTAMP NULL DEFAULT NULL'
35
- );
36
 
37
  $installer->endSetup();
27
  $installer = $this;
28
  $installer->startSetup();
29
 
30
+ $installer->getConnection()->changeColumn($installer->getTable('xmlconnect/queue'), 'exec_time', 'exec_time', 'TIMESTAMP NULL DEFAULT NULL');
 
 
 
 
 
31
 
32
  $installer->endSetup();
app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php ADDED
@@ -0,0 +1,501 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_XmlConnect
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /** @var $installer Mage_XmlConnect_Model_Resource_Setup */
28
+ $installer = $this;
29
+
30
+ $installer->startSetup();
31
+
32
+ $appTableName = $installer->getTable('xmlconnect/application');
33
+ $configTableName = $installer->getTable('xmlconnect/configData');
34
+ $historyTableName = $installer->getTable('xmlconnect/history');
35
+ $templateTableName = $installer->getTable('xmlconnect/template');
36
+ $queueTableName = $installer->getTable('xmlconnect/queue');
37
+
38
+ /**
39
+ * Drop foreign keys
40
+ */
41
+ $installer->getConnection()->dropForeignKey(
42
+ $appTableName,
43
+ 'FK_XMLCONNECT_APPLICAION_STORE'
44
+ );
45
+
46
+ $installer->getConnection()->dropForeignKey(
47
+ $historyTableName,
48
+ 'FK_XMLCONNECT_HISTORY_APPLICATION'
49
+ );
50
+
51
+ $installer->getConnection()->dropForeignKey(
52
+ $templateTableName,
53
+ 'FK_APP_CODE'
54
+ );
55
+
56
+ $installer->getConnection()->dropForeignKey(
57
+ $queueTableName,
58
+ 'FK_TEMPLATE_ID'
59
+ );
60
+
61
+ $installer->getConnection()->dropForeignKey(
62
+ $configTableName,
63
+ 'FK_31EE36D814216200D7C0723145AC510E'
64
+ );
65
+
66
+ /**
67
+ * Drop indexes
68
+ */
69
+ $installer->getConnection()->dropIndex(
70
+ $appTableName,
71
+ 'FK_XMLCONNECT_APPLICAION_STORE'
72
+ );
73
+
74
+ $installer->getConnection()->dropIndex(
75
+ $historyTableName,
76
+ 'FK_XMLCONNECT_HISTORY_APPLICATION'
77
+ );
78
+
79
+ $installer->getConnection()->dropIndex(
80
+ $appTableName,
81
+ 'UNQ_XMLCONNECT_APPLICATION_CODE'
82
+ );
83
+
84
+ $installer->getConnection()->dropIndex(
85
+ $configTableName,
86
+ 'UNQ_XMLCONNECT_CONFIG_DATA_APPLICATION_ID_CATEGORY_PATH'
87
+ );
88
+
89
+ /**
90
+ * Modify fields for 'xmlconnect_notification_template'
91
+ */
92
+ $installer->getConnection()->changeColumn(
93
+ $templateTableName,
94
+ 'id',
95
+ 'template_id',
96
+ array(
97
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
98
+ 'identity' => true,
99
+ 'unsigned' => true,
100
+ 'nullable' => false,
101
+ 'primary' => true,
102
+ 'comment' => 'History Id'
103
+ )
104
+ );
105
+
106
+ $installer->getConnection()->addColumn($templateTableName, 'application_id', array(
107
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
108
+ 'unsigned' => true,
109
+ 'nullable' => false,
110
+ 'comment' => 'Application Id'
111
+ )
112
+ );
113
+
114
+ $installer->getConnection()->dropColumn($templateTableName, 'app_code');
115
+
116
+ /**
117
+ * Modify fields for 'xmlconnect_queue'
118
+ */
119
+ $installer->getConnection()->changeColumn(
120
+ $queueTableName,
121
+ 'id',
122
+ 'queue_id',
123
+ array(
124
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
125
+ 'identity' => true,
126
+ 'unsigned' => true,
127
+ 'nullable' => false,
128
+ 'primary' => true,
129
+ 'comment' => 'Queue Id'
130
+ )
131
+ );
132
+
133
+ $installer->getConnection()->dropColumn($queueTableName, 'app_code');
134
+
135
+ /**
136
+ * Change columns
137
+ */
138
+ $tables = array(
139
+ /**
140
+ * Modify table 'xmlconnect_application'
141
+ */
142
+ $appTableName => array(
143
+ 'columns' => array(
144
+ 'application_id' => array(
145
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
146
+ 'identity' => true,
147
+ 'unsigned' => true,
148
+ 'nullable' => false,
149
+ 'primary' => true,
150
+ 'comment' => 'Application Id'
151
+ ),
152
+ 'name' => array(
153
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
154
+ 'length' => 255,
155
+ 'nullable' => false,
156
+ 'comment' => 'Application Name'
157
+ ),
158
+ 'code' => array(
159
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
160
+ 'length' => 32,
161
+ 'nullable' => false,
162
+ 'comment' => 'Application Code'
163
+ ),
164
+ 'type' => array(
165
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
166
+ 'length' => 32,
167
+ 'nullable' => false,
168
+ 'comment' => 'Device Type'
169
+ ),
170
+ 'store_id' => array(
171
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
172
+ 'unsigned' => true,
173
+ 'comment' => 'Store Id'
174
+ ),
175
+ 'active_from' => array(
176
+ 'type' => Varien_Db_Ddl_Table::TYPE_DATE,
177
+ 'comment' => 'Active From'
178
+ ),
179
+ 'active_to' => array(
180
+ 'type' => Varien_Db_Ddl_Table::TYPE_DATE,
181
+ 'comment' => 'Active To'
182
+ ),
183
+ 'updated_at' => array(
184
+ 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
185
+ 'nullable' => true,
186
+ 'default' => null,
187
+ 'comment' => 'Updated At'
188
+ ),
189
+ 'status' => array(
190
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
191
+ 'unsigned' => true,
192
+ 'nullable' => false,
193
+ 'default' => '0',
194
+ 'comment' => 'Status'
195
+ ),
196
+ 'browsing_mode' => array(
197
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
198
+ 'unsigned' => true,
199
+ 'default' => '0',
200
+ 'comment' => 'Browsing Mode'
201
+ )
202
+ ),
203
+ 'comment' => 'Xmlconnect Application'
204
+ ),
205
+ /**
206
+ * Modify table 'xmlconnect_config_data'
207
+ */
208
+ $configTableName => array(
209
+ 'columns' => array(
210
+ 'application_id' => array(
211
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
212
+ 'unsigned' => true,
213
+ 'nullable' => false,
214
+ 'comment' => 'Application Id'
215
+ ),
216
+ 'category' => array(
217
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
218
+ 'length' => 60,
219
+ 'nullable' => false,
220
+ 'default' => 'default',
221
+ 'comment' => 'Category'
222
+ ),
223
+ 'path' => array(
224
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
225
+ 'length' => 250,
226
+ 'nullable' => false,
227
+ 'comment' => 'Path'
228
+ ),
229
+ 'value' => array(
230
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
231
+ 'length' => '64k',
232
+ 'nullable' => false,
233
+ 'comment' => 'Value'
234
+ ),
235
+ ),
236
+ 'comment' => 'Xmlconnect Configuration Data'
237
+ ),
238
+ /**
239
+ * Modify table 'xmlconnect_history'
240
+ */
241
+ $historyTableName => array(
242
+ 'columns' => array(
243
+ 'history_id' => array(
244
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
245
+ 'identity' => true,
246
+ 'unsigned' => true,
247
+ 'nullable' => false,
248
+ 'primary' => true,
249
+ 'comment' => 'History Id'
250
+ ),
251
+ 'application_id' => array(
252
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
253
+ 'unsigned' => true,
254
+ 'nullable' => false,
255
+ 'comment' => 'Application Id'
256
+ ),
257
+ 'created_at' => array(
258
+ 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
259
+ 'nullable' => true,
260
+ 'default' => null,
261
+ 'comment' => 'Created At'
262
+ ),
263
+ 'store_id' => array(
264
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
265
+ 'unsigned' => true,
266
+ 'comment' => 'Store Id'
267
+ ),
268
+ 'params' => array(
269
+ 'type' => Varien_Db_Ddl_Table::TYPE_BLOB,
270
+ 'length' => '64k',
271
+ 'comment' => 'Params'
272
+ ),
273
+ 'title' => array(
274
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
275
+ 'length' => 200,
276
+ 'nullable' => false,
277
+ 'comment' => 'Title'
278
+ ),
279
+ 'activation_key' => array(
280
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
281
+ 'length' => 255,
282
+ 'nullable' => false,
283
+ 'comment' => 'Activation Key'
284
+ ),
285
+ 'name' => array(
286
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
287
+ 'length' => 255,
288
+ 'nullable' => false,
289
+ 'comment' => 'Application Name'
290
+ ),
291
+ 'code' => array(
292
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
293
+ 'length' => 32,
294
+ 'nullable' => false,
295
+ 'comment' => 'Application Code'
296
+ ),
297
+ ),
298
+ 'comment' => 'Xmlconnect History'
299
+ ),
300
+ /**
301
+ * Modify table 'xmlconnect_notification_template'
302
+ */
303
+ $templateTableName => array(
304
+ 'columns' => array(
305
+ 'template_id' => array(
306
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
307
+ 'identity' => true,
308
+ 'unsigned' => true,
309
+ 'nullable' => false,
310
+ 'primary' => true,
311
+ 'comment' => 'Template Id'
312
+ ),
313
+ 'application_id' => array(
314
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
315
+ 'unsigned' => true,
316
+ 'nullable' => false,
317
+ 'comment' => 'Application Id'
318
+ ),
319
+ 'name' => array(
320
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
321
+ 'length' => 255,
322
+ 'nullable' => false,
323
+ 'comment' => 'Template Name'
324
+ ),
325
+ 'push_title' => array(
326
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
327
+ 'length' => 140,
328
+ 'nullable' => false,
329
+ 'comment' => 'Push Notification Title'
330
+ ),
331
+ 'message_title' => array(
332
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
333
+ 'length' => 255,
334
+ 'nullable' => false,
335
+ 'comment' => 'Message Title'
336
+ ),
337
+ 'content' => array(
338
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
339
+ 'length' => '64k',
340
+ 'nullable' => false,
341
+ 'comment' => 'Message Content'
342
+ ),
343
+ 'created_at' => array(
344
+ 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
345
+ 'nullable' => true,
346
+ 'default' => null,
347
+ 'comment' => 'Created At'
348
+ ),
349
+ 'modified_at' => array(
350
+ 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
351
+ 'nullable' => true,
352
+ 'default' => null,
353
+ 'comment' => 'Modified At'
354
+ ),
355
+ ),
356
+ 'comment' => 'Xmlconnect Notification Template'
357
+ ),
358
+ /**
359
+ * Modify table 'xmlconnect_queue'
360
+ */
361
+ $queueTableName => array(
362
+ 'columns' => array(
363
+ 'queue_id' => array(
364
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
365
+ 'identity' => true,
366
+ 'unsigned' => true,
367
+ 'nullable' => false,
368
+ 'primary' => true,
369
+ 'comment' => 'Queue Id'
370
+ ),
371
+ 'create_time' => array(
372
+ 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
373
+ 'nullable' => true,
374
+ 'default' => null,
375
+ 'comment' => 'Created At'
376
+ ),
377
+ 'exec_time' => array(
378
+ 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
379
+ 'nullable' => true,
380
+ 'default' => null,
381
+ 'comment' => 'Scheduled Execution Time'
382
+ ),
383
+ 'template_id' => array(
384
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
385
+ 'unsigned' => true,
386
+ 'nullable' => false,
387
+ 'comment' => 'Template Id'
388
+ ),
389
+ 'push_title' => array(
390
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
391
+ 'length' => 140,
392
+ 'nullable' => false,
393
+ 'comment' => 'Push Notification Title'
394
+ ),
395
+ 'message_title' => array(
396
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
397
+ 'length' => 255,
398
+ 'nullable' => true,
399
+ 'default' => '',
400
+ 'comment' => 'Message Title'
401
+ ),
402
+ 'content' => array(
403
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
404
+ 'length' => '64k',
405
+ 'nullable' => true,
406
+ 'default' => '',
407
+ 'comment' => 'Message Content'
408
+ ),
409
+ 'push_title' => array(
410
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
411
+ 'length' => 140,
412
+ 'nullable' => false,
413
+ 'comment' => 'Push Notification Title'
414
+ ),
415
+ 'status' => array(
416
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
417
+ 'unsigned' => true,
418
+ 'nullable' => false,
419
+ 'default' => 0,
420
+ 'comment' => 'Status'
421
+ ),
422
+ 'type' => array(
423
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
424
+ 'length' => 12,
425
+ 'nullable' => false,
426
+ 'comment' => 'Type of Notification'
427
+ ),
428
+ ),
429
+ 'comment' => 'Xmlconnect Notification Queue'
430
+ )
431
+ );
432
+
433
+ $installer->getConnection()->modifyTables($tables);
434
+
435
+ /**
436
+ * Add indexes
437
+ */
438
+ $installer->getConnection()->addIndex(
439
+ $appTableName,
440
+ $installer->getIdxName($appTableName, array('code'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE),
441
+ array('code'),
442
+ Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
443
+ );
444
+
445
+ $installer->getConnection()->addIndex(
446
+ $configTableName,
447
+ $installer->getIdxName(
448
+ $configTableName,
449
+ array('application_id', 'category', 'path'),
450
+ Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
451
+ ),
452
+ array('application_id', 'category', 'path'),
453
+ Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
454
+ );
455
+
456
+ /**
457
+ * Add foreign keys
458
+ */
459
+ $installer->getConnection()->addForeignKey(
460
+ $installer->getFkName($appTableName, 'store_id', $installer->getTable('core/store'), 'store_id'),
461
+ $appTableName,
462
+ 'store_id',
463
+ $installer->getTable('core/store'),
464
+ 'store_id',
465
+ Varien_Db_Ddl_Table::ACTION_SET_NULL,
466
+ Varien_Db_Ddl_Table::ACTION_SET_NULL
467
+ );
468
+
469
+ $installer->getConnection()->addForeignKey(
470
+ $installer->getFkName($configTableName, 'application_id', $appTableName, 'application_id'),
471
+ $configTableName,
472
+ 'application_id',
473
+ $appTableName,
474
+ 'application_id'
475
+ );
476
+
477
+ $installer->getConnection()->addForeignKey(
478
+ $installer->getFkName($historyTableName, 'application_id', $appTableName, 'application_id'),
479
+ $historyTableName,
480
+ 'application_id',
481
+ $appTableName,
482
+ 'application_id'
483
+ );
484
+
485
+ $installer->getConnection()->addForeignKey(
486
+ $installer->getFkName($templateTableName, 'application_id', $appTableName, 'application_id'),
487
+ $templateTableName,
488
+ 'application_id',
489
+ $appTableName,
490
+ 'application_id'
491
+ );
492
+
493
+ $installer->getConnection()->addForeignKey(
494
+ $installer->getFkName($queueTableName, 'template_id', $templateTableName, 'template_id'),
495
+ $queueTableName,
496
+ 'template_id',
497
+ $templateTableName,
498
+ 'template_id'
499
+ );
500
+
501
+ $installer->endSetup();
media/xmlconnect/system/ok.gif ADDED
Binary file
package.xml CHANGED
@@ -1,19 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Magento_Mobile</name>
4
- <version>1.5.0.0.22.1</version>
5
  <stability>stable</stability>
6
  <license>mixed</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Magento Mobile Xml Interface</summary>
10
  <description>An integration magento with mobile applications (e.g. iPhone, Android, iPad)</description>
11
- <notes>1.5.0.0.22.1 version of package
12
- internal svn revision #121425</notes>
13
- <authors><author><name>Magento Core Team</name><user>auto-converted</user><email>core@magentocommerce.com</email></author></authors>
14
  <date>2011-12-29</date>
15
- <time>10:43:37</time>
16
- <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="xmlconnect"><dir name="design_default"><file name="accordion_open.png" hash="4c89d903ebbc61ee295ef64a60724b10"/><file name="accordion_open_android.png" hash="7ef2f1d193990c3f4c2c90aae9ab3281"/><file name="accordion_open_android_l.png" hash="bc27688afbfd866c618477ea2c7bf0ee"/><file name="accordion_open_android_p.png" hash="2e4549cba575c12ef2a39c12e9ffe173"/><file name="accordion_open_ipad_l.png" hash="dcdda97da6556393b972d6dae8d6bac5"/><file name="accordion_open_ipad_p.png" hash="55cca08a0ab79047961858789ff8c3a7"/><file name="banner_1_2.png" hash="0637d31df6b5a434c9a332ee46122ef4"/><file name="banner_android.png" hash="02695661b8e50e1a001c3369622f322f"/><file name="banner_ipad.png" hash="c1d59a6ec67da1bb76c5142453da7acf"/><file name="banner_ipad_l.png" hash="04e850d481a9ae902f33fd8c1f89cbf0"/><file name="smallIcon_1_6.png" hash="c1ce9e289eaf2c0504d502928693bd89"/></dir><dir name="mobile_preview"><dir name="android"><file name="background_home_landscape.jpg" hash="1f79a1f42ca4e2cf6010ab6c3ef66aa4"/><file name="background_portrait.jpg" hash="197b15e6455ad1a85e1bad6595371fa3"/><file name="bg_button_up.gif" hash="204f590a88933c930b7fc92963accfab"/><file name="bg_catalog_filters.png" hash="7464191ebaf576b73a3c021eb1cfcc25"/><file name="bg_catalog_filters_shadow.png" hash="5021ad60917190026d85fae1d33bdaa9"/><file name="bg_cat_item.png" hash="2859b45c387b66243d4af2ba973b2ae1"/><file name="bg_frame.gif" hash="7062ed9b7563fc658f49ce7cfdd34f1c"/><file name="bg_header.png" hash="d4a46c8850d1d89259921b1c28b5bce1"/><file name="bg_header_catalog.png" hash="c1080cd18a89e21da18fdc6955bf6230"/><file name="bg_header_home.png" hash="dfce0445ca7c7a45c7914a986b596ce0"/><file name="bg_home_header.png" hash="8bc1887a0c5760cc47b77b8a7a320426"/><file name="bg_logo.png" hash="02695661b8e50e1a001c3369622f322f"/><file name="bg_page.png" hash="d65f1d123655c2eaf3bb4a1e6035a08d"/><file name="bg_star.png" hash="fc6de6c4e0ed3478b8840e1ab81da725"/><file name="bg_star_empty.png" hash="3f0421fb8c8f6c4be6ca501168a881e8"/><file name="bg_status_bar.png" hash="52b41106451ac34672f82338bbc5370c"/><file name="ico_account.png" hash="c1fd338c74fcf483155acbd37c430807"/><file name="ico_home.png" hash="2de37f640463b354d68945320bfe3e4f"/><file name="ico_search.png" hash="8b0dd17a3e9c3328e66204fe379c66aa"/><file name="product_image.png" hash="dd975b128ba303e0ae2adc9772e0433c"/><file name="product_image_1.jpg" hash="8994979d4dcc1f339c73cd1f44398a7d"/><file name="product_image_2.jpg" hash="26d6599bdb35d80b25a1e903b40cfa19"/><file name="product_image_3.jpg" hash="d7c6d05196a84341afe0025d01b9dc61"/><file name="product_image_4.jpg" hash="2a88ead3dbbeff1d40168db692841f2f"/></dir><dir name="custom_icons"><file name="account.png" hash="0498d73e47ed47179e5546dc15c17dc7"/><file name="actionsBg.jpg" hash="ee3db742cbec9a436ba46118c8a01303"/><file name="addToCart.png" hash="e33876648546e99d875ca92bd2cd78e9"/><file name="addToWishlist.png" hash="1018602b7c5e0e11f0427ace96fd7d52"/><file name="background.gif" hash="bd92833eb2eb32e4a0282cea153ac13f"/><file name="buttons.gif" hash="0cd19a9d9178976906161ea100cba958"/><file name="cart.png" hash="815b4c64fae21b4c162525ece76dc44d"/><file name="home.png" hash="9e473791b022b7c2dfc7d29b1b6de887"/><file name="image-bg.png" hash="14bde5cf8b00dc5f6c60e52a0fa964dc"/><file name="logo-small.png" hash="9b3477a4552bcb878b4943aae5351622"/><file name="rowBgIcon.gif" hash="9ee89b961ae2bb047672ba5d2d2677c6"/><file name="search.png" hash="10bfa7ec3361ce7cbcc5d25087f181eb"/><file name="shop.png" hash="e6639a9fdc143363da82a7d78e126f1c"/><file name="star-active.png" hash="d4ab959a92bda610527a3e3942c4c0b0"/><file name="star-inactive.png" hash="f7fb99710be4c03ac23b1206f20e761d"/><file name="tellAFriend.png" hash="46f8ef48b29f245977d66d9312d87e70"/><file name="viewDetails.png" hash="9bacc63bcc483d3db5614a026d9391f6"/><file name="viewGallery.png" hash="304f3d03949d07055bc056359fe17763"/></dir><dir name="gradients"><file name="footer.png" hash="31a2feed50ef9c8637b412c4211f8300"/><file name="header.png" hash="5386da930a944cd75562216249cce08a"/><file name="header2.png" hash="ad5a2dc6ec93914e925cfe2d43fb30a2"/><file name="header3.png" hash="920ad8c6903e90323a57fb02dca37280"/><file name="item-bg.png" hash="a14886d1f9e14284ac6b4f1b61e68646"/><file name="sort-bg.png" hash="b8053bb772e849909e5b87e4fd1ebbe4"/></dir><dir name="icons"><file name="account.png" hash="0498d73e47ed47179e5546dc15c17dc7"/><file name="cart.png" hash="815b4c64fae21b4c162525ece76dc44d"/><file name="home.png" hash="9e473791b022b7c2dfc7d29b1b6de887"/><file name="more.png" hash="f3662ae29923b87eba3a729192aa3df3"/><file name="page.png" hash="2291d77f21de042040bc0864be40138b"/><file name="search.png" hash="10bfa7ec3361ce7cbcc5d25087f181eb"/><file name="shop.png" hash="e6639a9fdc143363da82a7d78e126f1c"/></dir><dir name="ipad"><file name="background_home_landscape.jpg" hash="9e3ef117985113b804531142d539b60a"/><file name="background_portrait.jpg" hash="bdf9e034fd30b923086e6c622ea10451"/><file name="banner_image.png" hash="693bb9d118155a146b21ce9fcfba08da"/><file name="banner_image_l.png" hash="a070a40d57610b5cc7160fe894482a1c"/><file name="bg_catalog_header_hor.png" hash="f61a67aa288e1b8a8df7b4d4527c662e"/><file name="bg_content.jpg" hash="70ddfc8959d878d1231dc7cbee4a063c"/><file name="bg_filters_buttons.png" hash="02fcb0ed7a7268e9f64ebaf06235bc09"/><file name="bg_filters_tooltip.png" hash="3b05ca6e585acd3d766be01eeaa23d47"/><file name="bg_filters_wrap.png" hash="31288784fe95c67de9b45b44458b4155"/><file name="bg_filter_button.png" hash="728f1cd358446881ffd863eff12204a1"/><file name="bg_header.png" hash="e2cf5a575a27e6e4533e3c85e3472a82"/><file name="bg_home_content.jpg" hash="1d55a198279e4f2b163c98c18f699646"/><file name="bg_home_header.png" hash="00f2fbf96d2b915dcbcd921b0301ef3f"/><file name="bg_home_header_hor.png" hash="9bfef728ece003d5b3433d2623ea168c"/><file name="bg_home_products.png" hash="ac6a8a79b959a0c8298b1f607c0f0af8"/><file name="bg_home_shadow.png" hash="c54b071ca3e97a6ee67588ef74b7b44e"/><file name="bg_home_shadow_hor.png" hash="0d21a99c5c749d0e5070e3585ff4a23f"/><file name="bg_product_image.png" hash="4da74325c1a4ee1ca19b414e5d590f75"/><file name="bg_search.png" hash="6ee08d05d0c4ef9ed64b9914b821f408"/><file name="bg_sections.jpg" hash="0ee90005663aced09a9ce6385bdbce2c"/><file name="bg_status_bar.png" hash="17124d9d392bb8e37b202c80a595df54"/><file name="bg_status_bar_hor.png" hash="bd4a9f11ecb1c896145267731d8a951d"/><file name="i_cart.png" hash="1bbe0a0e54eed5bb14b9bfcce83da758"/><file name="i_info.png" hash="3f0fda8b294b67bf698badbcaa99150b"/><file name="i_login.png" hash="deb4089bdc61582c78c90ef192d577e8"/><file name="i_remove.png" hash="4923eb5e76b3c6ba6df5c667db816a0c"/><file name="logo.png" hash="49c19f59b459b6c0b3b99daa3fe7f932"/><file name="logo_big.png" hash="693bb9d118155a146b21ce9fcfba08da"/><file name="product_image.jpg" hash="2bb6c69129bcb18dc93e9f48605647c6"/><file name="sections_arrow.png" hash="7db7144083a31882e8a62cb9579f478f"/><file name="stars.png" hash="70d38cd9883d70e4f6b21ac4874b9868"/></dir><dir name="slider"><file name="actionsBg.jpg" hash="ee3db742cbec9a436ba46118c8a01303"/><file name="addToCart.png" hash="2a146be4bc63713df19cc353e030d44f"/><file name="addToWishlist.png" hash="9b23a4e0d9acfc79f314e9082f14c4de"/><file name="tellAFriend.png" hash="b7600fa2ae52bdb1d6bb86fe4d9f1773"/><file name="viewDetails.png" hash="90cf37c6dbbee1861350b4c05469e3ae"/><file name="viewGallery.png" hash="304f3d03949d07055bc056359fe17763"/></dir><dir name="sort_buttons"><file name="bg_button.png" hash="87d0f1b123f01c3aea3cb8a2b146306e"/><file name="buttons.gif" hash="2f14f1a3f0fb38790779c992a58654ae"/><file name="buttons.png" hash="b4a3f17370e03bf5d2a5cdf7800c25a7"/><file name="button_up.gif" hash="7ad527f99b9975d5634fb2d5cc99e6b3"/><file name="center-active.png" hash="5903988cd458cd794f23a212d51aa725"/><file name="center-inactive.png" hash="135b46aaa5c3b131a5a7e9c45c004e06"/><file name="filters.png" hash="3837ab6fcfe959833dd998533db1ca7f"/><file name="left-active.png" hash="86e94441b96a0d27d0b0a7e5108f86ed"/><file name="left-inactive.png" hash="0ddcb75aa9971cca39a5a65b4bdff8c4"/><file name="right-active.png" hash="320740ff608187301b06a96eab2f9e8e"/><file name="right-inactive.png" hash="cac4b39ab380353ffd5fdbcedb6e0a0a"/></dir><file name="1.gif" hash="817fd84187db3eee00799b0acf316457"/><file name="2.gif" hash="1a842d8f3ac25cfcdeab6c86dd8fea89"/><file name="3.gif" hash="207cd55e968c284bd52c86efdcdda1c7"/><file name="actionsBackground.png" hash="11faa8baee72f3e6a9a02a83915c8658"/><file name="actionsBg.png" hash="9acccd1980f17006942d74a718ebd7da"/><file name="arrow.png" hash="837259a7c365e46034dca728bffe9070"/><file name="background.gif" hash="bd92833eb2eb32e4a0282cea153ac13f"/><file name="background.png" hash="3717f4b4ba725701e2a0604129a3a815"/><file name="banner.png" hash="0637d31df6b5a434c9a332ee46122ef4"/><file name="btn-l.png" hash="92b2454528e9d39119038777cf53329c"/><file name="btn-r.png" hash="8c6aa9fd9203bc10822e0505f11e0c4d"/><file name="buttons.php" hash="a04839d41cf73d4c70b498ec75ff2bd4"/><file name="circle.png" hash="f4c116cb0554bf936d3b9ee38b7f3d1f"/><file name="grid.png" hash="23faa3f5572cdeb597c2bceedd93a7f8"/><file name="image-bg.png" hash="a588b9cced95a25fc18e28c775d9a001"/><file name="imageFrame.php" hash="f5a1298dfc6cb70cb486b55820f5ab21"/><file name="info.png" hash="3f0d2ed85b81e8251f294457c6bfa404"/><file name="lightStar.php" hash="cba0a7c5f28a1bbc764761f4fc581fe3"/><file name="lightStar.png" hash="b5dc40d5b793dae6a069357f49cccc24"/><file name="lightStar2.png" hash="75928926a6112540c9cb073157cb7d95"/><file name="lines-h.png" hash="ea3d95812c9838affc6df2f3a3cb1977"/><file name="lines-v.png" hash="9e3ffee29ba28477d50da9642019bc0a"/><file name="login-btn-left-alt.png" hash="71bb6c7d24252aace27bee711d7616f4"/><file name="login-btn-left.png" hash="cbbf9afc6e9fc433f57270e88b63f351"/><file name="login-btn-right.png" hash="438fcc598d012bf6d33184e95accfd24"/><file name="login-btn.png" hash="051ee2c1a8ce3f7b8de3293cd2e2ed85"/><file name="logo-small.png" hash="9b3477a4552bcb878b4943aae5351622"/><file name="logo_25.png" hash="ba41ed568d916175c32803b614442447"/><file name="men.png" hash="46d7d1773118ef0a27353e8a9f6719fe"/><file name="mm-frame.gif" hash="eebf30806f1dbf2118e7ec39a016c86d"/><file name="mobile-catalog.css" hash="80cbd74984354df2d86f4ad68b9123a3"/><file name="mobile-home.css" hash="b57641c73c4eae08e0a02cd7291d9465"/><file name="rowBgIcon.gif" hash="9ee89b961ae2bb047672ba5d2d2677c6"/><file name="slider.gif" hash="c6b87bf15b85b18c0515e2cbefaabe60"/><file name="smallIcon.png" hash="e76d2a6364042f41b3f35fc8cdc9c0ee"/><file name="star-active.png" hash="d4ab959a92bda610527a3e3942c4c0b0"/><file name="star-inactive.png" hash="f7fb99710be4c03ac23b1206f20e761d"/><file name="t-shirt.gif" hash="7505efdaabf13c4f8e26f7cfe15c8c96"/><file name="t-shirt.png" hash="46d7d1773118ef0a27353e8a9f6719fe"/><file name="women.png" hash="46d7d1773118ef0a27353e8a9f6719fe"/><file name="youth.png" hash="46d7d1773118ef0a27353e8a9f6719fe"/></dir><file name="dropdown-arrow.gif" hash="332e99ca6b4d1e0d39972e04fb0b2395"/><file name="empty.png" hash="23dc9dc3c4751f83c2df7a5c42668824"/><file name="full-arrow-left.gif" hash="8ec91b60d38d1a16cba7670f2088a5c7"/><file name="full-arrow.gif" hash="36ddff0fca1c7d8900cb3633e0a30cea"/><file name="gel_green.png" hash="591959d831e8e42c9175d12a88f0bae2"/><file name="gel_red.png" hash="db442c023014df9da32b84bc1bb5a39f"/><file name="l-arrow.gif" hash="ee49f7eab64657b5131953acef0238fd"/><file name="loading.gif" hash="5d25806dac7cbee5f894b13144783866"/><file name="r-arrow.gif" hash="d0429a9781e915fc9d9ca8875c470d32"/><file name="small_logo.gif" hash="d5c8be7c0f16aac2549759c0228492d6"/><file name="swatch_black.gif" hash="fd31d6a3a435c8ad1f7c43f346bb47e4"/><file name="swatch_custom.gif" hash="fb34791a48366957a141e12b563888c2"/><file name="swatch_default.gif" hash="fb34791a48366957a141e12b563888c2"/><file name="swatch_funk_leaf.gif" hash="f1d3ba87efb742b47da879a6f48909c4"/><file name="swatch_hot_red.gif" hash="d9363d45dc2993c2fdc3ea43c5b6f71c"/><file name="swatch_sky_blue.gif" hash="ded1455db119d09a3aedd7474fd1875a"/><file name="swatch_user_custom.gif" hash="a24f31421a1ff56d1be0845f9a7c7020"/><file name="switch-arrow.gif" hash="dc7243962b341f366cd072d486687e6a"/><file name="tab_account.png" hash="27101fbaa78a07426be4768acc4c53ff"/><file name="tab_account_android.png" hash="77605cbc87f75ca17e91a5393765ceb1"/><file name="tab_account_ipad.png" hash="2997de5402195d0720309b73c6446fab"/><file name="tab_cart.png" hash="e803f760ee81cb35183f1122f388b774"/><file name="tab_cart_android.png" hash="477e97f8d03ea8aa674e952709f86578"/><file name="tab_empty.png" hash="bdd4cc355566e8861b2c45424ad94516"/><file name="tab_home.png" hash="dfa104e4da74e4a55d3c98d6ee0f7122"/><file name="tab_home_active.png" hash="bba5eb9bb724c84c1ede9e6f4bec3575"/><file name="tab_home_android.png" hash="1fefc6b070cc21b31b43194a7d85f9d9"/><file name="tab_info_android.png" hash="67fc19d8d926f7aede482f5a7083fc71"/><file name="tab_more.png" hash="2803359cb3e795bf67457e727aa16020"/><file name="tab_page.png" hash="ca05dbc42f944b8d4255f6675f6dd93a"/><file name="tab_search.png" hash="2cf29dbe325558353621b4241543204f"/><file name="tab_search_android.png" hash="932c2c568872fd9e119367c887f0539a"/><file name="tab_shop.png" hash="f36be0d3d27f2b37626247d3f6a55e2a"/><file name="tab_shop_active.png" hash="de907d6a52d477d4319649f9b0e2e4aa"/><file name="tab_shop_android.png" hash="e119fcd20f8cba856d550a64d775ddbb"/><file name="tmp-icon.gif" hash="58b759aecf3bdae26d5aaff7a0be5c90"/><file name="xmlconnect_tab.png" hash="cd99a7e01a42a6c82d866f7684faeb95"/></dir></dir><dir name="xmlconnect"><dir name="fonts"><file name="android_icons-webfont.eot" hash="2fc917efbfb3c933ccfddc108ef05f33"/><file name="android_icons-webfont.svg" hash="e8cb2b5ef019bbc2885c97ed0caaf2a0"/><file name="android_icons-webfont.ttf" hash="bc567dd7a381093fbb652c58cbad9430"/><file name="android_icons-webfont.woff" hash="8310b54d55bf84a8a3f3a86c22a51aef"/><file name="stars-webfont.eot" hash="019beb4b8ec19447657cf3106138bbe3"/><file name="stars-webfont.svg" hash="20cf0312c0b951d173d4531ea18abc6f"/><file name="stars-webfont.ttf" hash="d63d95e9adaf775f410437535622bf60"/><file name="stars-webfont.woff" hash="526d9756131c94139f0f1df5272197fd"/></dir><file name="boxes.css" hash="9afcff3669e4286e565894da7f7ee4e3"/><file name="dropdown.css" hash="e5388a1fd90df2a2e3860516adef0367"/><file name="mobile-android.css" hash="c932d2898a1ffd5545cfd76699260125"/><file name="mobile-catalog.css" hash="ca7c4c2c7643ca1249e00bbd45980fd2"/><file name="mobile-home.css" hash="b10c97acf5ac07c40d1db72b9d413841"/><file name="mobile-ipad-catalog.css" hash="2b35f47bb153c659640dd37beac277f1"/><file name="mobile-ipad-home.css" hash="270c8e4c8111de6c6173f9b6883c85ec"/><file name="styles.css" hash="c87a56ddc3001a2e357d648695855f5f"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="xmlconnect"><dir name="catalog"><dir name="category"><dir name="placeholder"><file name="image.jpg" hash="097ab8a3051bc037ea3de0e17f440540"/><file name="small_image.jpg" hash="f825d16f97a640453553c79c48ebaa73"/><file name="thumbnail.jpg" hash="b2b682d28a08a748a73d2cda70ab5a57"/></dir></dir></dir><file name="tab_account.png" hash="0498d73e47ed47179e5546dc15c17dc7"/><file name="tab_cart.png" hash="9055ba76e256a51d3fee53a8c41d5226"/><file name="tab_home.png" hash="07d0af93e167b9366d3d4fb3d6cdb31c"/><file name="tab_more.png" hash="b9fc21feb8d7655bc9c2985c37b0de2f"/><file name="tab_page.png" hash="ca05dbc42f944b8d4255f6675f6dd93a"/><file name="tab_search.png" hash="25e880eb2a4d06828e2e1c3f32d22400"/><file name="tab_shop.png" hash="fe602fc2e7093efef5ecc0b027a32d91"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="xmlconnect.xml" hash="3bcc520298d90ea72c85de89a44e607b"/></dir><dir name="template"><dir name="xmlconnect"><dir name="edit"><dir name="tab"><dir name="design"><dir name="preview"><file name="catalog_android.phtml" hash="591050ccc493b364fb895055c986cd86"/><file name="catalog_hor_ipad.phtml" hash="a289faccee351af884d5628ecb07a5c3"/><file name="catalog_ipad.phtml" hash="ebe5ed4da38c4b16263c1f3b5d3c95c4"/><file name="catalog_iphone.phtml" hash="3446aa0942ef6e1fd4846b68c0141ae1"/><file name="home_android.phtml" hash="f3ec85295af00953503dd0dfd3b07715"/><file name="home_hor_ipad.phtml" hash="bb06939e0ce07a268a09c6fb62c6e368"/><file name="home_ipad.phtml" hash="fc1622ae6ce681b96e5f9394259f57a6"/><file name="home_iphone.phtml" hash="55f8d4382b9c55787f4b8f7645c92b70"/><file name="productinfo_iphone.phtml" hash="99c2fd2107ad06e625384b56182fd316"/><file name="tab_items_android.phtml" hash="d0b925bbc89f510aac004ffc1b33062a"/><file name="tab_items_ipad.phtml" hash="8ca8d864408bb880b6f6a9999b0e4d26"/><file name="tab_items_iphone.phtml" hash="406b98b55565fb58c1a3e3dc90922d6e"/></dir><file name="preview_android.phtml" hash="665e283d03607df92a19b704a6249091"/><file name="preview_ipad.phtml" hash="65ffa0ca65f4ec79cae7fc0ccc26455b"/><file name="preview_iphone.phtml" hash="bf8058aeec27e381c3843d239ac82180"/></dir><file name="design.phtml" hash="78814e106947fefd781c9d25de89ace2"/></dir></dir><dir name="form"><dir name="element"><dir name="country"><file name="androidmarket.phtml" hash="053e69572e7b8850f3f96f22c5d5f9f7"/><file name="istore.phtml" hash="275af872365061838828011b0398db02"/></dir><file name="addrow.phtml" hash="46fddf6c4b452a6c529499de2c2f1323"/><file name="app_tabs_android.phtml" hash="92df75ceecedd911eed98ae8703ac83a"/><file name="app_tabs_ipad.phtml" hash="43649f88a29fe3691e5525d5c32756fe"/><file name="app_tabs_iphone.phtml" hash="4936c1e64fe3da857b1108ab44a8598d"/><file name="themes.phtml" hash="9eb56bd1ce4651b28fe8f40fcdde48ed"/></dir></dir><dir name="mobile"><file name="notification_helper.phtml" hash="db58d2fce2f496bfdaa7d04954627efd"/></dir><dir name="submission"><file name="app_icons_preview.phtml" hash="4d4f0f78338338d15605777df69be0e7"/><file name="container.phtml" hash="c576009dd87ddd55ce8b023587128806"/></dir><dir name="template"><file name="preview.phtml" hash="bd26b9a350f430e4a6905133db031bfc"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="xmlconnect.xml" hash="ea972c3a22b447b702eec153a3f3a874"/></dir><dir name="template"><dir name="xmlconnect"><dir name="pbridge"><file name="result.phtml" hash="412b98ba988d6049098414f8cbce09b6"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mage_XmlConnect.csv" hash="29db96ab0fe9b5ec94dac6542a3ab618"/></dir></target><target name="mageweb"><dir name="js"><dir name="jscolor"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="demo.html" hash="edf71251cb2be20322d2efb00aee86a6"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="b65a1505390592ac6c0177d6b84774e0"/></dir></dir></target><target name="magecore"><dir name="Mage"><dir name="XmlConnect"><dir name="Block"><dir name="Adminhtml"><dir name="History"><file name="Grid.php" hash="6308d26ad2e05740eb6991e3257000bb"/></dir><dir name="Mobile"><dir name="Edit"><dir name="Tab"><dir name="Design"><dir name="Accordion"><file name="Images.php" hash="5229cee37fc9cc89dbd8f32b3a4434e6"/><file name="Tabs.php" hash="caf8302b277ea18303213d43764ed28e"/><file name="Themes.php" hash="9d6dec2260396ad8798202ee1ba6eddc"/></dir><file name="Accordion.php" hash="daf3ddb3a6c9229dad32279e4b691b1a"/><file name="Preview.php" hash="dd1c33fc43745d2158a29fe542233b44"/><file name="Themes.php" hash="6ae0e49f82cc094f5dd9315887f9e14d"/></dir><dir name="Submission"><file name="History.php" hash="1bf1ca22e91880a17bd0020baecd4c8f"/></dir><file name="Cache.php" hash="607618d233c5dab9415475b4ad61bb59"/><file name="Content.php" hash="2e67d807374eecdafac94823cfdc63cb"/><file name="Design.php" hash="f90d65ffa27e94916da616afc8e221f2"/><file name="Flurryanalytics.php" hash="89ad25f1adf60b1e4232ba29f7f5ad64"/><file name="General.php" hash="4bf60b4d629f4b9952998ae4070ab623"/><file name="Notification.php" hash="beae607b96d8b6f98cd7022185cc8bdd"/><file name="Payment.php" hash="0b7f6bd130dcab67f25f6e91450d2c65"/><file name="Settings.php" hash="82c672adcaafe6e795268fe86340925f"/><file name="Social.php" hash="995bb1c3f994ca89bc71d1d2aaadf0d7"/></dir><file name="Form.php" hash="9e9957b476bbd1fb3952c4e4b706b2df"/><file name="Submission.php" hash="029403d08204bd9f964adc98af0d435a"/><file name="Tabs.php" hash="0d72c2e64a1173c2992c7a8f3dbf11f8"/></dir><dir name="Form"><dir name="Element"><file name="Addrow.php" hash="71e222b534aa23880065618cda412260"/><file name="Color.php" hash="24c6b153ce8f2649b1a05477f4c3e7b8"/><file name="Country.php" hash="3b83f00f657eb7dd867ea75f4abdf88d"/><file name="Datetime.php" hash="92cf9dfafa11da7d8ab75c9423925bd5"/><file name="Font.php" hash="dec4888c88e4c6dbbf76486267e38518"/><file name="Image.php" hash="cf494edb2cc4527d622a8091247d304a"/><file name="Page.php" hash="825acf20d00a34454c66a4c951452b69"/><file name="Tabs.php" hash="6115f3e6782e47c8949c55be4475bdd7"/><file name="Theme.php" hash="21fee731b3a652cf71f08abbff175c05"/></dir></dir><dir name="Grid"><dir name="Renderer"><file name="Bool.php" hash="f1baaf5e240ca3cc63a6da9935175790"/><file name="Type.php" hash="b6337cfe77db1a45ff431143055e405f"/></dir></dir><dir name="Preview"><file name="Content.php" hash="69bf38fd148410c3814beacf1317b5c7"/><file name="Tabitems.php" hash="e5e0f60bc074765c8cefd99f78832711"/></dir><dir name="Submission"><dir name="Renderer"><dir name="Country"><file name="Androidmarket.php" hash="481eac62f66724a28a582d134252fda7"/><file name="Istore.php" hash="ce072e5248b0c2fe715f50542df3370c"/></dir></dir><dir name="Tab"><dir name="Container"><file name="Submission.php" hash="94ec8a46ff9c9271c03df4850690ca89"/></dir><file name="Container.php" hash="bd10d3d94dbe4d422e84be6fe2c1ace6"/></dir><file name="Form.php" hash="aa5991aeba94abc34a4818afb8b6cf8d"/><file name="Tabs.php" hash="030ddf84029b44dd6093fad755d4e7e9"/></dir><dir name="Widget"><file name="Form.php" hash="2bd91c9af96eaf42d1484b263857772b"/></dir><file name="Edit.php" hash="bb11de03ea1b302fb38a06013bfb8b1a"/><file name="Grid.php" hash="8ca26959087f2a12d5f9aa3bf1fc650b"/><file name="Submission.php" hash="c37035f19250ddcbf3e8c8b3227f99d8"/></dir><dir name="Queue"><dir name="Edit"><file name="Form.php" hash="b19085649fc95114bb14f9e2770f84ce"/></dir><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="06c1c06834fad162e09badd802066148"/><file name="Application.php" hash="874a8634ffd63025061bb74833bab9d8"/><file name="Id.php" hash="5a3bd6f7130ff4354884635d1246452c"/><file name="Msgtitle.php" hash="0b4710291f331cf3840cad4ccc26ca09"/><file name="Pushtitle.php" hash="e0725a10e0150cb9c6719a41712a15b5"/><file name="Status.php" hash="3b6d6c7d3104f0201e2431bad9bafacb"/><file name="Template.php" hash="31d623d9873431816847dc246466904e"/></dir></dir><file name="Edit.php" hash="917d5a952c18c9c718587a51f899681f"/><file name="Grid.php" hash="4129ef90b9c3a79e4492f49569025b36"/></dir><dir name="Template"><dir name="Edit"><file name="Form.php" hash="6f333660b1365f657d45eb95f17d3f11"/></dir><dir name="Grid"><dir name="Renderer"><file name="Application.php" hash="cdae7056f704834da9e400277411ac0b"/></dir></dir><dir name="Preview"><file name="Form.php" hash="1e374a00f79d85e3f14c7342577dcef7"/></dir><file name="Edit.php" hash="063f75ad4a742fff0223e1c8442b4a97"/><file name="Grid.php" hash="3f53fcf95cd6aaadfeecc8fde7d2c925"/><file name="Preview.php" hash="891acec6c53c94b2f2dbc892c9fb80dc"/></dir><file name="History.php" hash="d00a4acfccbd558e64ffe4eecb731d9a"/><file name="Mobile.php" hash="8b65767102a85340128f9388a96b6cf2"/><file name="Queue.php" hash="e13f7f2fa44867d5580b7d0e38542bae"/><file name="Template.php" hash="2a577c9a452528e44f69b730cef9f9a1"/></dir><dir name="Cart"><dir name="Item"><dir name="Renderer"><file name="Configurable.php" hash="55eb93a62e002ec0c6c1778d13cab566"/><file name="Grouped.php" hash="46290fe4e7338f0640022f591f0dfb25"/></dir><file name="Renderer.php" hash="9085653f9e59a1f70ca9c23d6df83a4b"/></dir><dir name="Paypal"><dir name="Mecl"><file name="Details.php" hash="6a49316d593a0dd7ed1cfb18449533a2"/><file name="Review.php" hash="650c4907b56681e8f083d5d68962429a"/><file name="Shippingmethods.php" hash="b2973168b72ad1d7f5872394cfab3be2"/></dir><dir name="Mep"><file name="Totals.php" hash="93443d605d376447177cdb541561801f"/></dir></dir><file name="Crosssell.php" hash="0c1db847be1d7b7bbfbc043d2f4bb348"/><file name="Info.php" hash="574c54a69e4cd9007cd290f6676d65b1"/><file name="Totals.php" hash="d7504ced47770d9791e68e91b120c26c"/></dir><dir name="Catalog"><dir name="Category"><file name="Info.php" hash="9dd1d0109dd30edb081e8102c0edc0ab"/></dir><dir name="Product"><dir name="Options"><file name="Bundle.php" hash="53a6852f89eacf99a8092982beec72b3"/><file name="Configurable.php" hash="7ea31d8474deded21ce8b9a3044e5d16"/><file name="Giftcard.php" hash="118eaa05629f5d6d0b930c635c436e1b"/><file name="Grouped.php" hash="676430aba221de564397677d105d7e0a"/><file name="Simple.php" hash="d3fac669f96f237994e17ec48f45f207"/><file name="Virtual.php" hash="1d92b50e412eb3b524989b91047866be"/></dir><dir name="Price"><file name="Bundle.php" hash="52c7302ed4b38b0397b90d095c91d49c"/><file name="Default.php" hash="5f6964db4ff14d0bad5a4bd3d81a7b1f"/><file name="Giftcard.php" hash="0a4406e3cf6ce2614b11ffffe861419f"/></dir><dir name="Review"><file name="List.php" hash="cf4dd3ff039ce29b48bbb02a1123cf48"/></dir><file name="Attributes.php" hash="c05c430e5b9ddd720699810701b9aab7"/><file name="Gallery.php" hash="90dde1dd4788129c61ddc2a407b53393"/><file name="List.php" hash="8855bcc844ed9cd9fc27536a038eb2e2"/><file name="Options.php" hash="4f68f22500907d076831e188a09ec621"/><file name="Price.php" hash="0d2a385ad233ddc0d8396b5ca518c1f7"/><file name="Related.php" hash="e8a9c85bb1202f96e37f09eef35f23b9"/><file name="Review.php" hash="050803ea65e033deed0119190c3a6b2f"/></dir><dir name="Search"><file name="Suggest.php" hash="694a443827045d13f36faf1ccd5a209f"/></dir><file name="Category.php" hash="7344d02ee2a8c768c142d23970853393"/><file name="Filters.php" hash="7b127377b15ab68802f8a923fe12457f"/><file name="Product.php" hash="62a4e19f4509134e44fa50f540c61af1"/><file name="Search.php" hash="9529e7700aac595162fdeabe712fad28"/></dir><dir name="Checkout"><dir name="Address"><file name="Billing.php" hash="6197d08fe7a8b02ac6b7dfebee4697f1"/><file name="Form.php" hash="0b7bc7b45da55fef44b2cfd6b5570192"/><file name="Shipping.php" hash="4ea2e1b74eea75c067402e874698284f"/></dir><dir name="Order"><dir name="Review"><file name="Info.php" hash="c503b03f667cb2d8b4569677016d6ff1"/></dir><file name="Review.php" hash="8ff677073d7ed80c5b3a614f081525c3"/></dir><dir name="Payment"><dir name="Method"><dir name="Info"><dir name="Paypal"><file name="Abstract.php" hash="eecd9663dd46170f031403489fedac04"/><file name="Express.php" hash="39ca54d07363a21ebf229aaebec3b43b"/><file name="Mecl.php" hash="b9b729c007d612130a18f5dc7ba86ffc"/></dir><dir name="Pbridge"><dir name="Paypal"><file name="Direct.php" hash="11e9b36e36405e189d1c06fec7636c1f"/></dir><dir name="Paypaluk"><file name="Direct.php" hash="c38fcd3cd36895aa497f1219a6dec898"/></dir><file name="Authorizenet.php" hash="cf5211dedc06d6b04846afbb4b4d4d63"/><file name="Verisign.php" hash="91d69684cb6ac34dcb4021035eebaa0e"/></dir><file name="Authorizenet.php" hash="6ab4881c9f8a724772010f1b5ac52413"/><file name="Ccsave.php" hash="1293a63444fc5fc6f7e3b5bdce6d4b3c"/><file name="Checkmo.php" hash="fe242a4b553c97aca5efc7e39297c038"/><file name="Free.php" hash="52e2e116a868d5ac7cdb92446ccb9a97"/><file name="Purchaseorder.php" hash="bac365deb5b3558a0d8097d4e5417ff1"/></dir><dir name="Paypal"><file name="Direct.php" hash="05c0d9c1b3d8f57517b884840df0e3bb"/><file name="Payflow.php" hash="a4c64680185e88465a02030b001ce13b"/></dir><dir name="Pbridge"><file name="Abstract.php" hash="dbb02cdcb87999369b4a1943b6bc937b"/><file name="Authorizenet.php" hash="162304f1a2fcfb2bc9c92dc237609c7e"/><file name="Paypal.php" hash="696dc7a3f6c2ae3dbfeed07d202950b8"/><file name="Paypaluk.php" hash="0a536fb05595ca453f61206460290673"/><file name="Verisign.php" hash="ac966ac970a2682f5a2e6550b38234b4"/></dir><file name="Authorizenet.php" hash="b5759b2cc22e8a3af770d30ab2a5e4a5"/><file name="Ccsave.php" hash="d309eea8c6caee17c30842485f9fa50d"/><file name="Checkmo.php" hash="2eab8d64fda491a82c7d45f2b7d08025"/><file name="List.php" hash="31d99e77da7215cab05796cec5e32677"/><file name="Purchaseorder.php" hash="954fcdbf2ea90f26e7c1ccdacf6c358c"/></dir></dir><dir name="Pbridge"><file name="Result.php" hash="36e50da241533ff7b6a1723f9380955c"/></dir><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="1b7a437e6178fd11499e49d9e04c9499"/><file name="Avaliable.php" hash="158864e02b649fd2b8e46c288334e7f6"/></dir></dir><file name="Agreements.php" hash="55888ff73730fa75d912d5da0ccdaf5c"/></dir><dir name="Cms"><file name="Page.php" hash="c313dfacd7ec573fd368dd16f6b27e77"/></dir><dir name="Customer"><dir name="Address"><file name="Form.php" hash="5b1d2d21070851bdf08abceb33b0110b"/><file name="List.php" hash="8356a63ab08159ee3d3b5c88941691b1"/></dir><dir name="Form"><dir name="Renderer"><file name="Boolean.php" hash="b0d44c40031c33eb745c6fb083c8dc89"/><file name="Date.php" hash="4736c5297e42d5e7fab0e774621404d7"/><file name="File.php" hash="58f6e57392bc59e1da3fed66f72347a2"/><file name="Image.php" hash="9bc7912da0785550d74b06cce6c9508a"/><file name="Multiline.php" hash="95b60b5e57159ddb135dc04735b4a95c"/><file name="Multiselect.php" hash="42593dfde88fccbef918f3fbc251857b"/><file name="Select.php" hash="7dc00e458b3a597b1648cad6bc27bb2b"/><file name="Text.php" hash="306b809aa46e8223159207a6c0af5e62"/><file name="Textarea.php" hash="433372a193997217402e088782c8bbca"/></dir></dir><dir name="Order"><dir name="Item"><dir name="Renderer"><file name="Bundle.php" hash="bbdd153b287048af0f8c82ba65a2db11"/><file name="Default.php" hash="3c9d7ee2c9706fbadf540e728527c38f"/><file name="Downloadable.php" hash="b7181b2775939c2436c02baa85a1658a"/><file name="Giftcard.php" hash="d0d8e40206e0248f006932606ef3673a"/><file name="Grouped.php" hash="62e51c1aa3fbde5c7cef0f4c47042618"/></dir></dir><dir name="Totals"><dir name="Customerbalance"><file name="Refunded.php" hash="3e914d57eeead8089c18a854ce5c1479"/></dir><file name="Customerbalance.php" hash="8e4bb1223a493e5da4feed076ec8b421"/><file name="Giftcards.php" hash="2c8a2e3125903f7bf36f222e49fb9278"/><file name="Tax.php" hash="f4c8bfed2d3fb616897b8bfe4f0c1f3b"/></dir><file name="Details.php" hash="afce96b7b2ed1cf1e9c734f56c0ed6cc"/><file name="Items.php" hash="d413636c4b44ed2695cc3c47d01f4afb"/><file name="List.php" hash="ee5b1f5b8be7f4eb4e2e465e844f424d"/><file name="Totals.php" hash="51a5e731114e884a4abe008f11956080"/></dir><file name="Form.php" hash="657a4d5b50a9772cf9ca186cd3a417d3"/><file name="GiftcardCheck.php" hash="8be2d2976a0f26f196dcbf3efd526bea"/><file name="Storecredit.php" hash="4b474edade192b17dcedd85ecfe67485"/></dir><dir name="Review"><file name="Form.php" hash="926259d9bc8327c97a4cbe94def1a03a"/></dir><file name="Cart.php" hash="5e7fdd48329dc308cf9549a4b427a6d2"/><file name="Catalog.php" hash="afcbc956ff73bc85bc4611e0c500e23e"/><file name="Configuration.php" hash="59fc6a0fb6e25940fb2d87b58c49c7f1"/><file name="Home.php" hash="c3895dcacd1acc18caa80a181a390a52"/><file name="Wishlist.php" hash="4fd0b6b39ed2727818e688025d94eb3c"/></dir><dir name="Controller"><file name="Action.php" hash="37773c040e4013371544239aea5cc9da"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MobileController.php" hash="5d1fd6c141d30dde5ff6fa0bf39cc150"/></dir><dir name="Paypal"><file name="MeclController.php" hash="fb71a4d237ac247a91dc9f5d7004181c"/><file name="MepController.php" hash="2be98561a9fc87151109541b2516e9c0"/></dir><file name="CartController.php" hash="d65db2f5bc64f23c70ed22c0c79600f5"/><file name="CatalogController.php" hash="d82538985b1b88c73943deb66f82faa9"/><file name="CheckoutController.php" hash="80f6a74bb5dd03a9d82b325ca3bbfe08"/><file name="CmsController.php" hash="361fe45962259aeb554c3c05f35d54ec"/><file name="ConfigurationController.php" hash="2c0a6a94075f059519840572bfbda706"/><file name="CustomerController.php" hash="e48d0443acbd731c6ed7a5b6c0f14a44"/><file name="IndexController.php" hash="c39be37ba7b6b7b72a26fa0e2ef47e2e"/><file name="PbridgeController.php" hash="c7268ab4986d54ef7711390b3b7b45cd"/><file name="ReviewController.php" hash="a7cd9a6fbbc182faf55c399974de99b4"/><file name="WishlistController.php" hash="0130e34c122bab5b9d64803febb2aaa2"/></dir><dir name="etc"><dir name="themes"><file name="custom.xml" hash="cba253341e035e5892cc3ed577fae710"/><file name="default.xml" hash="7a23e5840bd5a7a1f3cf4b9d16c30d63"/><file name="funk_leaf.xml" hash="d143fb6570214bdf5489e5f53770eded"/><file name="hot_red.xml" hash="f6480993958f16e4206048172985ca06"/><file name="sky_blue.xml" hash="cb128be3f0ef9088b23d3947daf29cf8"/></dir><file name="adminhtml.xml" hash="33642773574f36356937e18a3043589f"/><file name="config.xml" hash="4df35ed4df8da133afab08b3015c8a0a"/><file name="system.xml" hash="759fbe862cf96d79eca093de0dd68320"/></dir><dir name="Helper"><dir name="Catalog"><dir name="Category"><file name="Image.php" hash="0ee0ee7e164bd3d4010b12a07e2e75ab"/></dir></dir><dir name="Customer"><dir name="Form"><file name="Renderer.php" hash="699e9e71cea5b32ea290b9a203cc2ab0"/></dir><file name="Order.php" hash="f029067e3a3213a995af2c5df05b59ed"/></dir><file name="Android.php" hash="25010379b5d9786b4c22bf32892ea7a2"/><file name="Data.php" hash="e9d6c74e212624188568f2920caaef4e"/><file name="Image.php" hash="40ea38416f7bb1c1c7cc66f8b1af0ec7"/><file name="Ipad.php" hash="921d412fe4579adf77280362652a0d8b"/><file name="Iphone.php" hash="ed7f28e8a85ce206fd10be26b0ae1e31"/><file name="Payment.php" hash="5b54eccc95ea5c57d8c9ef5d934bc094"/><file name="Theme.php" hash="8b58268b3c755efb662c27ef7fba8136"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Currency"><file name="Default.php" hash="758caf789cef878fb21f4551d7858463"/></dir><file name="Baseurl.php" hash="65f8ab647d9ab17eac023da2ab9a8b8d"/></dir></dir></dir></dir><dir name="Catalog"><dir name="Category"><dir name="Media"><file name="Config.php" hash="fd88aeb90a45d8c0c6392cf5f8f70dc8"/></dir><file name="Image.php" hash="1b2bace07cc99d365ee038960c9877a9"/></dir></dir><dir name="Input"><dir name="Filter"><file name="MaliciousCode.php" hash="d5d500781af7b07e11baf5cbef0eb0ce"/></dir></dir><dir name="Mysql4"><dir name="Application"><file name="Collection.php" hash="2be10e2eb68fd639fefaca00ab871707"/></dir><dir name="Cms"><dir name="Page"><file name="Collection.php" hash="096d160ee850caa72e432938ae2b40be"/></dir></dir><dir name="ConfigData"><file name="Collection.php" hash="cca431230655fd7f85bd4c866018e997"/></dir><dir name="Filter"><file name="Collection.php" hash="9a03d40ddc51c62d5570521c6692046b"/></dir><dir name="History"><file name="Collection.php" hash="51ad48285cdde01f4c72df81aab88a39"/></dir><dir name="Queue"><file name="Collection.php" hash="4e9ddc30978a23485d4ebc0a82525981"/></dir><dir name="Template"><file name="Collection.php" hash="b24088ed79ec2ae5e832e0c1ab7bfada"/></dir><file name="Application.php" hash="754902c7551a817d2a37bc5894b45e74"/><file name="ConfigData.php" hash="5f7515094ff90df80ff428535e2f548f"/><file name="History.php" hash="7f98de19717b14af7f661eba1d0e7290"/><file name="Queue.php" hash="b2965b8e71ea9a552af0282259441ba8"/><file name="Setup.php" hash="cd7c56fb9a87d2bf3d69c4802692b671"/><file name="Template.php" hash="8c4b78bfd4869ec4424610f9a433e5e2"/></dir><dir name="Payment"><dir name="Method"><dir name="Paypal"><file name="Config.php" hash="bceb1a29c8f22fcd8ac576c99615446c"/><file name="Mecl.php" hash="54c7fa2f6c2798a7c322919f860fb31c"/><file name="Mep.php" hash="5ed8f4b4348885b04d05dfd30ca5414c"/></dir></dir></dir><dir name="Paypal"><dir name="Mecl"><file name="Checkout.php" hash="3d95962fabb68583110851c1feab0958"/></dir><dir name="Mep"><file name="Checkout.php" hash="e5d9a3f5bf7fe229fad33851121b32ee"/></dir></dir><dir name="Preview"><file name="Abstract.php" hash="d06405e2c57270ac210a5961034065a8"/><file name="Android.php" hash="e5274a740dc0afaedd881f6479ffbdef"/><file name="Ipad.php" hash="98200566632dde66b5ac40991a781d18"/><file name="Iphone.php" hash="9739bf1fd78c1377faa91042af30a045"/></dir><dir name="Simplexml"><dir name="Form"><dir name="Element"><dir name="Renderer"><file name="Interface.php" hash="9b314b65fe1eeb81ccfc6ed6047c8e5e"/></dir><dir name="Validator"><file name="Abstract.php" hash="145396845cf2f7d4f27291cc16e57f55"/><file name="Rule.php" hash="c632915311d7f0913ef76b1d40fac395"/></dir><file name="Abstract.php" hash="72f79ef1701e5666c7d5d97509efefea"/><file name="Checkbox.php" hash="9de46a951f58eaf77328589b91da2fef"/><file name="Collection.php" hash="7ee2575d3dfd6800da0df80bfeab55f5"/><file name="CountryListSelect.php" hash="93fc2ec9b73c2583e41d74ca6ddc11f7"/><file name="Date.php" hash="6fe4f1fb15550526221d7030fafea071"/><file name="Email.php" hash="2bff11cf0cd07abf6ea042e414d6d899"/><file name="Fieldset.php" hash="24ec910f64e0da488ada268c4f5da50d"/><file name="File.php" hash="d089c6caee1a04a3a9a0b5af84caf154"/><file name="Image.php" hash="500204087a9c2b3eff2ae603be71552d"/><file name="Multiline.php" hash="c9ab79577fd28be36b24ec006e1fd457"/><file name="Multiselect.php" hash="d5a3f2dc6eec83dbc367e79f1f30581f"/><file name="Select.php" hash="94da9503599604da1dbf2dbc03af9c72"/><file name="Text.php" hash="d6a4b452f7219cc5da07867fd3d8cc48"/><file name="Textarea.php" hash="e82df346b8046ae24a8efe23ea965069"/><file name="Validator.php" hash="00870fbba161e9a2d49a69d4f3229d1d"/></dir><file name="Abstract.php" hash="9abcf326213c39cf374163e422d94759"/></dir><file name="Element.php" hash="ae5371037a96954026a9f4bf9d9929a4"/><file name="Form.php" hash="0ae8eea47cc9a7b38e7154d2d536fc1e"/></dir><file name="Application.php" hash="5a38363e67cf2148fba1eb5a20a1f7db"/><file name="ConfigData.php" hash="bf6289065cc32ff9d9d4f460991b4fe9"/><file name="History.php" hash="0eb86f02d6f85f23419457229e6c525c"/><file name="Observer.php" hash="c8d3d58742b21f7dab04d41ae0d26fe1"/><file name="Queue.php" hash="87669399632961eee5bf5cba47fef40e"/><file name="Tabs.php" hash="2b6ea4c0c21dc059990aa2216172412d"/><file name="Template.php" hash="e5ce25084397ff36b94e3d177b6bf8b2"/><file name="Theme.php" hash="29cb0e46b9bc1fa823b48a14cc264083"/></dir><dir name="sql"><dir name="xmlconnect_setup"><file name="mysql4-data-upgrade-1.4.0.13-1.4.0.14.php" hash="4080ff59c5bea460530f4eeaa5ab1e4b"/><file name="mysql4-install-1.4.0.8.php" hash="d722f3f741af029773ebaf514c522b0f"/><file name="mysql4-upgrade-1.4.0.8-1.4.0.9.php" hash="7f6bc966e741f00c44919aa6d4307b8c"/><file name="mysql4-upgrade-1.4.0.9-1.4.0.10.php" hash="b7fec601f2bf620e60c7284c2cf6634e"/><file name="mysql4-upgrade-1.4.0.10-1.4.0.11.php" hash="cf2afadfee0b21d1c2d02071303edfc1"/><file name="mysql4-upgrade-1.4.0.11-1.4.0.12.php" hash="a1333a0c415cbc398cdd0671ab539102"/><file name="mysql4-upgrade-1.4.0.12-1.4.0.13.php" hash="a07f66c79bb1df1208c9000c3496ada1"/><file name="mysql4-upgrade-1.4.0.13-1.4.0.14.php" hash="3852cdcfa482f19981a2e8e1092909bf"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_XmlConnect.xml" hash="f57b14eccad90152c221e4f090a8801b"/></dir></target><target name="magemedia"><dir name="xmlconnect"><dir name="custom"><file name="ok.gif" hash="398f81b3983f802a99932eaf97ee0806"/></dir><dir name="original"><file name="ok.gif" hash="398f81b3983f802a99932eaf97ee0806"/></dir></dir></target></contents>
17
  <compatible/>
18
- <dependencies><required><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0.1</min><max>1.6.0.0</max></package></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Magento_Mobile</name>
4
+ <version>1.6.0.0.22.1</version>
5
  <stability>stable</stability>
6
  <license>mixed</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Magento Mobile Xml Interface</summary>
10
  <description>An integration magento with mobile applications (e.g. iPhone, Android, iPad)</description>
11
+ <notes>1.6.0.0.22.1 version of package internal svn revision #121425</notes>
12
+ <authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
 
13
  <date>2011-12-29</date>
14
+ <time>16:34:48</time>
15
+ <contents><target name="magecore"><dir name="Mage"><dir name="XmlConnect"><dir name="Block"><dir name="Adminhtml"><dir name="History"><file name="Grid.php" hash="6308d26ad2e05740eb6991e3257000bb"/></dir><file name="History.php" hash="d00a4acfccbd558e64ffe4eecb731d9a"/><dir name="Mobile"><dir name="Edit"><file name="Form.php" hash="9e9957b476bbd1fb3952c4e4b706b2df"/><file name="Submission.php" hash="029403d08204bd9f964adc98af0d435a"/><dir name="Tab"><file name="Cache.php" hash="607618d233c5dab9415475b4ad61bb59"/><file name="Content.php" hash="2e67d807374eecdafac94823cfdc63cb"/><dir name="Design"><dir name="Accordion"><file name="Images.php" hash="5229cee37fc9cc89dbd8f32b3a4434e6"/><file name="Tabs.php" hash="caf8302b277ea18303213d43764ed28e"/><file name="Themes.php" hash="9d6dec2260396ad8798202ee1ba6eddc"/></dir><file name="Accordion.php" hash="daf3ddb3a6c9229dad32279e4b691b1a"/><file name="Preview.php" hash="dd1c33fc43745d2158a29fe542233b44"/><file name="Themes.php" hash="6ae0e49f82cc094f5dd9315887f9e14d"/></dir><file name="Design.php" hash="f90d65ffa27e94916da616afc8e221f2"/><file name="Flurryanalytics.php" hash="89ad25f1adf60b1e4232ba29f7f5ad64"/><file name="General.php" hash="4bf60b4d629f4b9952998ae4070ab623"/><file name="Notification.php" hash="beae607b96d8b6f98cd7022185cc8bdd"/><file name="Payment.php" hash="0b7f6bd130dcab67f25f6e91450d2c65"/><file name="Settings.php" hash="82c672adcaafe6e795268fe86340925f"/><file name="Social.php" hash="995bb1c3f994ca89bc71d1d2aaadf0d7"/><dir name="Submission"><file name="History.php" hash="1bf1ca22e91880a17bd0020baecd4c8f"/></dir></dir><file name="Tabs.php" hash="0d72c2e64a1173c2992c7a8f3dbf11f8"/></dir><file name="Edit.php" hash="083bdaffece7d75a645fcaa25d4e6b8e"/><dir name="Form"><dir name="Element"><file name="Addrow.php" hash="71e222b534aa23880065618cda412260"/><file name="Color.php" hash="24c6b153ce8f2649b1a05477f4c3e7b8"/><file name="Country.php" hash="e063d0ee7e62be71380d4c7de6ddeaa4"/><file name="Datetime.php" hash="92cf9dfafa11da7d8ab75c9423925bd5"/><file name="Font.php" hash="dec4888c88e4c6dbbf76486267e38518"/><file name="Image.php" hash="cf494edb2cc4527d622a8091247d304a"/><file name="Page.php" hash="825acf20d00a34454c66a4c951452b69"/><file name="Tabs.php" hash="6115f3e6782e47c8949c55be4475bdd7"/><file name="Theme.php" hash="21fee731b3a652cf71f08abbff175c05"/></dir></dir><dir name="Grid"><dir name="Renderer"><file name="Bool.php" hash="f1baaf5e240ca3cc63a6da9935175790"/><file name="Type.php" hash="b6337cfe77db1a45ff431143055e405f"/></dir></dir><file name="Grid.php" hash="8ca26959087f2a12d5f9aa3bf1fc650b"/><dir name="Preview"><file name="Content.php" hash="771869a996b1630b8bba3293eae9d768"/><file name="Tabitems.php" hash="b9e66e1c2d30c70b353fcbbddabcd13a"/></dir><dir name="Submission"><file name="Form.php" hash="aa5991aeba94abc34a4818afb8b6cf8d"/><dir name="Renderer"><dir name="Country"><file name="Androidmarket.php" hash="cc5322cad4892b477d23ff8798ac885d"/><file name="Istore.php" hash="83f84cf61a3b2dab063773c57270c215"/></dir></dir><dir name="Tab"><dir name="Container"><file name="Submission.php" hash="94ec8a46ff9c9271c03df4850690ca89"/></dir><file name="Container.php" hash="bd10d3d94dbe4d422e84be6fe2c1ace6"/></dir><file name="Tabs.php" hash="030ddf84029b44dd6093fad755d4e7e9"/></dir><file name="Submission.php" hash="f15232c6891c6699dfc89b826b54c74d"/><dir name="Widget"><file name="Form.php" hash="2bd91c9af96eaf42d1484b263857772b"/></dir></dir><file name="Mobile.php" hash="8b65767102a85340128f9388a96b6cf2"/><dir name="Queue"><dir name="Edit"><file name="Form.php" hash="b19085649fc95114bb14f9e2770f84ce"/></dir><file name="Edit.php" hash="7b835f7247160ca048e28dffa976ce01"/><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="06c1c06834fad162e09badd802066148"/><file name="Application.php" hash="c563b1f5d6cb4fff511bc6cbfdcebe7c"/><file name="Id.php" hash="5a3bd6f7130ff4354884635d1246452c"/><file name="Msgtitle.php" hash="4d89f7f6a6252260f61b673c6cac1e34"/><file name="Pushtitle.php" hash="c411360431127611c84da7690b5c48c2"/><file name="Status.php" hash="78c46092eb556a263dfca7d5bc4941db"/><file name="Template.php" hash="a36ed9dcdc7f3f331452cee2bb508482"/></dir></dir><file name="Grid.php" hash="c21e2f659fae94041dd85f2cf8311440"/></dir><file name="Queue.php" hash="e13f7f2fa44867d5580b7d0e38542bae"/><dir name="Template"><dir name="Edit"><file name="Form.php" hash="d8376335dfd08945ed420d358d55c718"/></dir><file name="Edit.php" hash="3a9d98efc35de2dcd2873b3e8c85c669"/><dir name="Grid"><dir name="Renderer"><file name="Application.php" hash="95ae4bd5b89f3892a5c5ad56c3bdb01a"/><file name="Name.php" hash="19d2a32db0812cde722596ba77da7d4a"/></dir></dir><file name="Grid.php" hash="86953da0489ccb85af67d65ae90c1914"/><dir name="Preview"><file name="Form.php" hash="1e374a00f79d85e3f14c7342577dcef7"/></dir><file name="Preview.php" hash="891acec6c53c94b2f2dbc892c9fb80dc"/></dir><file name="Template.php" hash="2a577c9a452528e44f69b730cef9f9a1"/></dir><dir name="Cart"><file name="Crosssell.php" hash="cac5b576fbcd5a63939a489fe18ace18"/><file name="Info.php" hash="fd227e03835a46895163bda3d5f2d957"/><dir name="Item"><dir name="Renderer"><file name="Configurable.php" hash="4cd9ea96f9d65dd832cc457cf66af8df"/><file name="Grouped.php" hash="46290fe4e7338f0640022f591f0dfb25"/></dir><file name="Renderer.php" hash="51ec2a5cca0555f176896b6fbd190a0a"/></dir><dir name="Paypal"><dir name="Mecl"><file name="Details.php" hash="0d51b2e7ba7db3f59e35177ceda93b4b"/><file name="Review.php" hash="4248999c6f9365485a7dd70f50a6d397"/><file name="Shippingmethods.php" hash="341086f8de7e34ca0daddf366e328c1c"/></dir><dir name="Mep"><file name="Totals.php" hash="93443d605d376447177cdb541561801f"/></dir></dir><file name="Totals.php" hash="85618be93e74263e8dc3bf7af4f88b1f"/></dir><file name="Cart.php" hash="2e7f2c5d8882d6fff434591377a0a185"/><dir name="Catalog"><dir name="Category"><file name="Info.php" hash="9dd1d0109dd30edb081e8102c0edc0ab"/></dir><file name="Category.php" hash="d7b72224fcd7d12dfdac5328637cdfa6"/><file name="Filters.php" hash="7b127377b15ab68802f8a923fe12457f"/><dir name="Product"><file name="Attributes.php" hash="c7c402bdc9dd92c7638e2bde8e457e27"/><file name="Gallery.php" hash="ab473c894636e20bb2316f592c8b03ac"/><file name="List.php" hash="ee6888e02e82b1558d1bd6eeec764d88"/><dir name="Options"><file name="Bundle.php" hash="444e284a6817caca17f224d69d717568"/><file name="Configurable.php" hash="374f3a24529d09aca806d78c2ec900b1"/><file name="Giftcard.php" hash="83cb56ff4b9158489c321a79061e4754"/><file name="Grouped.php" hash="6d154aa3e2bb5d804c7a174b63da7ddd"/><file name="Simple.php" hash="848290eb597b773baf7232dbd3a06d5c"/><file name="Virtual.php" hash="4748e41479698b19e9532226707394cd"/></dir><file name="Options.php" hash="1d93727beb71508dc76de0574007200a"/><dir name="Price"><file name="Bundle.php" hash="e85ea1191bffc6baaa93f063cf882d0e"/><file name="Default.php" hash="110ebd7cbd008ee6a5c05c7790237a3c"/><file name="Giftcard.php" hash="4f6fefdda02ccc0dddbfe2cf56d12ee8"/></dir><file name="Price.php" hash="0d2a385ad233ddc0d8396b5ca518c1f7"/><file name="Related.php" hash="fb814245fdbffc47647be133f67351f9"/><dir name="Review"><file name="List.php" hash="69da6bc8d8b7f24a789b68f579d467d9"/></dir><file name="Review.php" hash="0e55734f9e238366bac7f0afb5b87086"/></dir><file name="Product.php" hash="8d6746dbc28c14c987923cad5fefdc32"/><dir name="Search"><file name="Suggest.php" hash="694a443827045d13f36faf1ccd5a209f"/></dir><file name="Search.php" hash="5257d8e0f5bf7d0ad6587e3cf419811b"/></dir><file name="Catalog.php" hash="afcbc956ff73bc85bc4611e0c500e23e"/><dir name="Checkout"><dir name="Address"><file name="Billing.php" hash="a2689122a497d47fe6ecba7b08394115"/><file name="Form.php" hash="94511f6d88221175b2ec13b7ef6b3ce4"/><file name="Shipping.php" hash="4ea2e1b74eea75c067402e874698284f"/></dir><file name="Agreements.php" hash="9d24bd41e1b1d444ef7baa6e57735102"/><dir name="Order"><dir name="Review"><file name="Info.php" hash="499f4f3ddf8e44d1cfc0df76abe176e9"/></dir><file name="Review.php" hash="8ff677073d7ed80c5b3a614f081525c3"/></dir><dir name="Payment"><dir name="Method"><file name="Authorizenet.php" hash="b5759b2cc22e8a3af770d30ab2a5e4a5"/><file name="Ccsave.php" hash="390cf89e313fe26c3c2b233f8e05a5b6"/><file name="Checkmo.php" hash="58f6daa861715458e1cfcb78367c9058"/><dir name="Info"><file name="Authorizenet.php" hash="e49ef865c9f3b91d6ad8c49520e4730c"/><file name="Ccsave.php" hash="402de4bc500ec54bcba710ff056d7466"/><file name="Checkmo.php" hash="b867d702932f0cc5b967e013ae11849a"/><file name="Free.php" hash="034edad300ff336fd44e38eeef1603b5"/><dir name="Paypal"><file name="Abstract.php" hash="cd63d870f51754c4f5a0a60fc08426e0"/><file name="Express.php" hash="39ca54d07363a21ebf229aaebec3b43b"/><file name="Mecl.php" hash="b9b729c007d612130a18f5dc7ba86ffc"/></dir><dir name="Pbridge"><file name="Authorizenet.php" hash="cf5211dedc06d6b04846afbb4b4d4d63"/><dir name="Paypal"><file name="Direct.php" hash="11e9b36e36405e189d1c06fec7636c1f"/></dir><dir name="Paypaluk"><file name="Direct.php" hash="c38fcd3cd36895aa497f1219a6dec898"/></dir><file name="Verisign.php" hash="e434a4cd17e0e1b54d90472b02cfde3c"/></dir><file name="Purchaseorder.php" hash="70cc06eaeda3046c298377763b657524"/></dir><file name="List.php" hash="4d9beec40811559a658a124d242c8b19"/><dir name="Paypal"><file name="Direct.php" hash="05c0d9c1b3d8f57517b884840df0e3bb"/><file name="Payflow.php" hash="6cb58928782e3216e6f497cb26d2cd15"/></dir><dir name="Pbridge"><file name="Abstract.php" hash="dbb02cdcb87999369b4a1943b6bc937b"/><file name="Authorizenet.php" hash="162304f1a2fcfb2bc9c92dc237609c7e"/><file name="Paypal.php" hash="696dc7a3f6c2ae3dbfeed07d202950b8"/><file name="Paypaluk.php" hash="0a536fb05595ca453f61206460290673"/><file name="Verisign.php" hash="ac966ac970a2682f5a2e6550b38234b4"/></dir><file name="Purchaseorder.php" hash="69d66e0bc581777757fcf21eb7c83fe5"/></dir></dir><dir name="Pbridge"><file name="Result.php" hash="36e50da241533ff7b6a1723f9380955c"/></dir><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="1b7a437e6178fd11499e49d9e04c9499"/></dir></dir></dir><dir name="Cms"><file name="Page.php" hash="c313dfacd7ec573fd368dd16f6b27e77"/></dir><file name="Configuration.php" hash="6a73ed59b14d287aeb2447b43e1e2f3b"/><dir name="Customer"><dir name="Address"><file name="Form.php" hash="cd10a1321650ed3c719a6086d4e73405"/><file name="List.php" hash="1038364f6c300d3eb8edccc87df1692a"/></dir><dir name="Form"><dir name="Renderer"><file name="Boolean.php" hash="97984783ca2e5725e0ee874a79b5d494"/><file name="Date.php" hash="781af40c78356a698ea5e0fdc4479672"/><file name="File.php" hash="38fca3a34090531ab380f6de0293407e"/><file name="Image.php" hash="b08fd3111a864ae9c8d968060796d83c"/><file name="Multiline.php" hash="39e37db8c8cf4aa12ef1f01c6922a315"/><file name="Multiselect.php" hash="42593dfde88fccbef918f3fbc251857b"/><file name="Select.php" hash="b0f2ebeef7c9eb0f5497ceea29f41500"/><file name="Text.php" hash="9c792fe96299bb8a5b4d0b4df6de5e6f"/><file name="Textarea.php" hash="08d59b7ee634b548833a6ba3db6e10ad"/></dir></dir><file name="Form.php" hash="657a4d5b50a9772cf9ca186cd3a417d3"/><file name="GiftcardCheck.php" hash="8d9e4127a7d7345664e4807793132516"/><dir name="Order"><file name="Details.php" hash="194fae111f3ecb0211be154d476cf815"/><dir name="Item"><dir name="Renderer"><file name="Bundle.php" hash="146de9b6053367906f89031d8f315dfc"/><file name="Default.php" hash="6a2fcfdc614478276c7d537db3f18e4a"/><file name="Downloadable.php" hash="e9c462638be4a7b034a7763a387cc82b"/><file name="Giftcard.php" hash="abe0acdf1c4a7e5a26f0d17c049d72ae"/><file name="Grouped.php" hash="3c3b69b38025ec1fab8b17160773da09"/></dir></dir><file name="Items.php" hash="2dc24fc0ccf791c25b1cf7294ea38009"/><file name="List.php" hash="3f0f27444b2f6d7949a71d5a02c53a54"/><dir name="Totals"><dir name="Customerbalance"><file name="Refunded.php" hash="107d4ff65cd45ab0b73007dd826aa4b2"/></dir><file name="Customerbalance.php" hash="3b69cdb3f1e6ae4cd05c2466a07f2dbc"/><file name="Giftcards.php" hash="0db91f73284e2768ca8e4ec82723158d"/><file name="Tax.php" hash="e7f45c089a4d6e7e268ba738823450a7"/></dir><file name="Totals.php" hash="1af69d55001469d3417b56ca61bc31d4"/></dir><file name="Storecredit.php" hash="6ea2a1a98edde6d90d0214888c1a6243"/></dir><file name="Home.php" hash="14b402ad2c47948f54de3050a20254d8"/><dir name="Review"><file name="Form.php" hash="c348b7840a95095d9a75f1ea68d24cc6"/></dir><file name="Wishlist.php" hash="4fd0b6b39ed2727818e688025d94eb3c"/></dir><dir name="Controller"><file name="Action.php" hash="2fedac2aacb526dca5994d2e4f0dbe9a"/></dir><dir name="Helper"><file name="Android.php" hash="9ab19ea2f88a3683bdb61092c077eed2"/><dir name="Catalog"><dir name="Category"><file name="Image.php" hash="daffc47fbf00270a89db7225160d898e"/></dir></dir><dir name="Customer"><dir name="Form"><file name="Renderer.php" hash="53f4dd72b728dd49cd8587731ff5ea92"/></dir><file name="Order.php" hash="0e5ebdb10c4f055ccdbc21099785cec9"/></dir><file name="Data.php" hash="706e275d84b8ec7487c77f2e510d8c9d"/><file name="Image.php" hash="e2c8c17a6e3e015238a6db4f74dd859e"/><file name="Ipad.php" hash="74558f39c00c3553ac7be9f25aeab88c"/><file name="Iphone.php" hash="c89f688aaf523a98787e80e27d920ce7"/><file name="Payment.php" hash="5b54eccc95ea5c57d8c9ef5d934bc094"/><file name="Theme.php" hash="0d9dfae90dccf14ae2c34a752a9e166b"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Baseurl.php" hash="5e015aa79db0e904d816064bc242147f"/><dir name="Currency"><file name="Default.php" hash="758caf789cef878fb21f4551d7858463"/></dir></dir></dir></dir></dir><file name="Application.php" hash="087b32f6b59663f14f172da328a0792b"/><dir name="Catalog"><dir name="Category"><file name="Image.php" hash="131c6944ee81ee9c2dd3bffc13afd7a6"/><dir name="Media"><file name="Config.php" hash="fd88aeb90a45d8c0c6392cf5f8f70dc8"/></dir></dir></dir><file name="ConfigData.php" hash="c6ab2c7f16c2793af3fc9a6abf49a2da"/><file name="History.php" hash="2b94c8e2485261230b94da52217fe7cd"/><dir name="Mysql4"><dir name="Application"><file name="Collection.php" hash="22fbd44c97d1341eec2316d88cdd615e"/></dir><file name="Application.php" hash="1cdcd21de7029fb1465bca854950f493"/><dir name="Cms"><dir name="Page"><file name="Collection.php" hash="160796a17f43a0c9008f644d2f940fbf"/></dir></dir><dir name="ConfigData"><file name="Collection.php" hash="daa0613586622c3cdd862f89c5cf6c32"/></dir><file name="ConfigData.php" hash="336e3efe5a1b04350d4c7ca0f73326b9"/><dir name="Filter"><file name="Collection.php" hash="3b820fa4fc65de422b40b90479ddd977"/></dir><dir name="History"><file name="Collection.php" hash="8d478c591ea67fff6a179f4e5bd96ec5"/></dir><file name="History.php" hash="b8265853f335e44fba51ea1fbc7e7d18"/><dir name="Queue"><file name="Collection.php" hash="5d975b1556e1f692e3e3ee8d4c3ae400"/></dir><file name="Queue.php" hash="5a8fc030e809b0382f5c016a147d577f"/><file name="Setup.php" hash="779fbf35b0332d076c940013fd480777"/><dir name="Template"><file name="Collection.php" hash="b9937ca4d53b92e3a40a8e21bfd19a00"/></dir><file name="Template.php" hash="7aa204a046c07ad13ba86e6ef2405bae"/></dir><file name="Observer.php" hash="88d0692e699b1a8ba10bc37998b941a9"/><dir name="Payment"><dir name="Method"><dir name="Paypal"><file name="Config.php" hash="528016e55c272aa5a76d5ab71dc60eec"/><file name="Mecl.php" hash="ca1326816719d3b4ecb8eec0740febf1"/><file name="Mep.php" hash="ce4386c3e4220c6c3fe7143763468a50"/></dir></dir></dir><dir name="Paypal"><dir name="Mecl"><file name="Checkout.php" hash="7ade034912745974e1e13f2013064249"/></dir><dir name="Mep"><file name="Checkout.php" hash="363013017df11a413f7cc1425bc9984e"/></dir></dir><dir name="Preview"><file name="Abstract.php" hash="6605fdd2ddbdf1c8f2141960623ac489"/><file name="Android.php" hash="e5274a740dc0afaedd881f6479ffbdef"/><file name="Ipad.php" hash="98200566632dde66b5ac40991a781d18"/><file name="Iphone.php" hash="9739bf1fd78c1377faa91042af30a045"/></dir><file name="Queue.php" hash="2dec0aab1b04d2f1bbc558e416a1961f"/><dir name="Resource"><dir name="Application"><file name="Collection.php" hash="f469b9311eed1869ab4771cd4644e8a4"/></dir><file name="Application.php" hash="f7e9a61d30a09125aecda1777f7f8217"/><dir name="Cms"><dir name="Page"><file name="Collection.php" hash="17d2490c388ebadb2e9e244d2a6c92f6"/></dir></dir><dir name="ConfigData"><file name="Collection.php" hash="b888d531f6aabead186e779278a32e45"/></dir><file name="ConfigData.php" hash="c2dfceb2a45d593bed08b71c084fb030"/><dir name="Filter"><file name="Collection.php" hash="65b01b209cca1026eecbc36a449820c4"/></dir><dir name="History"><file name="Collection.php" hash="d5cd90983aca3be9fef61fcf79ff4f44"/></dir><file name="History.php" hash="6cddea9286759842a8fe94eab64d9e2c"/><dir name="Queue"><file name="Collection.php" hash="dea2416240c3c53bb38fa2823bda72fd"/></dir><file name="Queue.php" hash="48ccc6046d3ed25da49f199725d1b415"/><file name="Setup.php" hash="f008ca344a6728ae65eeba8bee9688f1"/><dir name="Template"><file name="Collection.php" hash="fda2222cd56b29f6354c3dcf6cb307cb"/></dir><file name="Template.php" hash="733e6fed1873e296f86635690ce5d90f"/></dir><dir name="Simplexml"><file name="Element.php" hash="f92da3a42e833abacf2adf513465d601"/><dir name="Form"><file name="Abstract.php" hash="26e5bfc74f30d067f34598d7504a4572"/><dir name="Element"><file name="Abstract.php" hash="2cfe9056ca9ff57198170a14c98c656d"/><file name="Checkbox.php" hash="9de46a951f58eaf77328589b91da2fef"/><file name="Collection.php" hash="7ee2575d3dfd6800da0df80bfeab55f5"/><file name="CountryListSelect.php" hash="0035b48f6151a299455c23587c20324f"/><file name="Date.php" hash="6fe4f1fb15550526221d7030fafea071"/><file name="Email.php" hash="2bff11cf0cd07abf6ea042e414d6d899"/><file name="Fieldset.php" hash="f94aba784f49207a683398907960233f"/><file name="File.php" hash="d089c6caee1a04a3a9a0b5af84caf154"/><file name="Image.php" hash="500204087a9c2b3eff2ae603be71552d"/><file name="Multiline.php" hash="eead4b85fa6985e571f2aae2417bc7b7"/><file name="Multiselect.php" hash="8e39e8857c8e359c21ee4be3ded9eef1"/><dir name="Renderer"><file name="Interface.php" hash="9b314b65fe1eeb81ccfc6ed6047c8e5e"/></dir><file name="Select.php" hash="94da9503599604da1dbf2dbc03af9c72"/><file name="Text.php" hash="d6a4b452f7219cc5da07867fd3d8cc48"/><file name="Textarea.php" hash="e82df346b8046ae24a8efe23ea965069"/><dir name="Validator"><file name="Abstract.php" hash="c7183c507611fb44750db227caeaeee8"/><file name="Rule.php" hash="c632915311d7f0913ef76b1d40fac395"/></dir><file name="Validator.php" hash="00870fbba161e9a2d49a69d4f3229d1d"/></dir></dir><file name="Form.php" hash="3e97ee0391c9ad88a8e3f5ef54fe0348"/></dir><file name="Tabs.php" hash="2b6ea4c0c21dc059990aa2216172412d"/><file name="Template.php" hash="042438993d8155852d741f0febe16dbb"/><file name="Theme.php" hash="266c8d57f1eada059472c8fe4970403f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MobileController.php" hash="3f6b99da83b9e9be508bc009a040d7c1"/></dir><file name="CartController.php" hash="3464bb367e2e949ee556b64daf05d762"/><file name="CatalogController.php" hash="2f436f155f6a6790dc62791367e30b89"/><file name="CheckoutController.php" hash="c5b6ba7a60cb87c0abd6c6fe4e782942"/><file name="CmsController.php" hash="eca4c018f12bc4d2b01f7d2ebf5482f1"/><file name="ConfigurationController.php" hash="62fb3d3c122dc99238e4f0ec14a2a077"/><file name="CustomerController.php" hash="bdc5acadd27778ce1d48cbd09562258a"/><file name="IndexController.php" hash="5aa7a5b60904e3e693bc43285a6b6b5b"/><dir name="Paypal"><file name="MeclController.php" hash="37ab1181560f49f6f90e4e2c3932037d"/><file name="MepController.php" hash="60fcd82aa32d2d8eec42605ba1e0568c"/></dir><file name="PbridgeController.php" hash="d32081a1af606b64b9f535360d473215"/><file name="ReviewController.php" hash="bfd0de81d2f10e13749966248149968a"/><file name="WishlistController.php" hash="6b205a1af4eeaee52accd4cb63489dc9"/></dir><dir name="etc"><file name="adminhtml.xml" hash="33642773574f36356937e18a3043589f"/><file name="config.xml" hash="e83320e77dfb4138907b56724cd91bd1"/><file name="system.xml" hash="759fbe862cf96d79eca093de0dd68320"/><dir name="themes"><file name="custom.xml" hash="cba253341e035e5892cc3ed577fae710"/><file name="default.xml" hash="7a23e5840bd5a7a1f3cf4b9d16c30d63"/><file name="funk_leaf.xml" hash="d143fb6570214bdf5489e5f53770eded"/><file name="hot_red.xml" hash="f6480993958f16e4206048172985ca06"/><file name="sky_blue.xml" hash="cb128be3f0ef9088b23d3947daf29cf8"/></dir></dir><dir name="sql"><dir name="xmlconnect_setup"><file name="install-1.6.0.0.php" hash="d9e1d20675ff0991563c1370875374fc"/><file name="mysql4-data-upgrade-1.4.0.13-1.4.0.14.php" hash="4080ff59c5bea460530f4eeaa5ab1e4b"/><file name="mysql4-install-1.4.0.8.php" hash="d722f3f741af029773ebaf514c522b0f"/><file name="mysql4-upgrade-1.4.0.10-1.4.0.11.php" hash="cf2afadfee0b21d1c2d02071303edfc1"/><file name="mysql4-upgrade-1.4.0.11-1.4.0.12.php" hash="a1333a0c415cbc398cdd0671ab539102"/><file name="mysql4-upgrade-1.4.0.12-1.4.0.13.php" hash="a07f66c79bb1df1208c9000c3496ada1"/><file name="mysql4-upgrade-1.4.0.13-1.4.0.14.php" hash="043c912700fea0211cf58f012630b865"/><file name="mysql4-upgrade-1.4.0.8-1.4.0.9.php" hash="7f6bc966e741f00c44919aa6d4307b8c"/><file name="mysql4-upgrade-1.4.0.9-1.4.0.10.php" hash="4b49d5535e48255c793acd3b73e9aaf8"/><file name="mysql4-upgrade-1.5.9.9-1.6.0.0.php" hash="25e7959cddaf8de00b5cbef34bb84a0b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_XmlConnect.xml" hash="f57b14eccad90152c221e4f090a8801b"/></dir></target><target name="mageweb"><dir name="js"><dir name="jscolor"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="demo.html" hash="edf71251cb2be20322d2efb00aee86a6"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="b65a1505390592ac6c0177d6b84774e0"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="xmlconnect"><dir name="edit"><dir name="tab"><dir name="design"><dir name="preview"><file name="catalog_android.phtml" hash="591050ccc493b364fb895055c986cd86"/><file name="catalog_hor_ipad.phtml" hash="a289faccee351af884d5628ecb07a5c3"/><file name="catalog_ipad.phtml" hash="ebe5ed4da38c4b16263c1f3b5d3c95c4"/><file name="catalog_iphone.phtml" hash="3446aa0942ef6e1fd4846b68c0141ae1"/><file name="home_android.phtml" hash="f3ec85295af00953503dd0dfd3b07715"/><file name="home_hor_ipad.phtml" hash="bb06939e0ce07a268a09c6fb62c6e368"/><file name="home_ipad.phtml" hash="fc1622ae6ce681b96e5f9394259f57a6"/><file name="home_iphone.phtml" hash="55f8d4382b9c55787f4b8f7645c92b70"/><file name="productinfo_iphone.phtml" hash="99c2fd2107ad06e625384b56182fd316"/><file name="tab_items_android.phtml" hash="d0b925bbc89f510aac004ffc1b33062a"/><file name="tab_items_ipad.phtml" hash="8ca8d864408bb880b6f6a9999b0e4d26"/><file name="tab_items_iphone.phtml" hash="406b98b55565fb58c1a3e3dc90922d6e"/></dir><file name="preview_android.phtml" hash="665e283d03607df92a19b704a6249091"/><file name="preview_ipad.phtml" hash="65ffa0ca65f4ec79cae7fc0ccc26455b"/><file name="preview_iphone.phtml" hash="bf8058aeec27e381c3843d239ac82180"/></dir><file name="design.phtml" hash="78814e106947fefd781c9d25de89ace2"/></dir></dir><dir name="form"><dir name="element"><file name="addrow.phtml" hash="46fddf6c4b452a6c529499de2c2f1323"/><file name="app_tabs_android.phtml" hash="92df75ceecedd911eed98ae8703ac83a"/><file name="app_tabs_ipad.phtml" hash="43649f88a29fe3691e5525d5c32756fe"/><file name="app_tabs_iphone.phtml" hash="4936c1e64fe3da857b1108ab44a8598d"/><dir name="country"><file name="androidmarket.phtml" hash="053e69572e7b8850f3f96f22c5d5f9f7"/><file name="istore.phtml" hash="275af872365061838828011b0398db02"/></dir><file name="themes.phtml" hash="9eb56bd1ce4651b28fe8f40fcdde48ed"/></dir></dir><dir name="mobile"><file name="notification_helper.phtml" hash="db58d2fce2f496bfdaa7d04954627efd"/></dir><dir name="submission"><file name="app_icons_preview.phtml" hash="4d4f0f78338338d15605777df69be0e7"/><file name="container.phtml" hash="c576009dd87ddd55ce8b023587128806"/></dir><dir name="template"><file name="preview.phtml" hash="bd26b9a350f430e4a6905133db031bfc"/></dir></dir></dir><dir name="layout"><file name="xmlconnect.xml" hash="3bcc520298d90ea72c85de89a44e607b"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="xmlconnect.xml" hash="ea972c3a22b447b702eec153a3f3a874"/></dir><dir name="template"><dir name="xmlconnect"><dir><dir name="pbridge"><file name="result.phtml" hash="412b98ba988d6049098414f8cbce09b6"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mage_XmlConnect.csv" hash="29db96ab0fe9b5ec94dac6542a3ab618"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="xmlconnect"><file name="boxes.css" hash="9afcff3669e4286e565894da7f7ee4e3"/><file name="dropdown.css" hash="e5388a1fd90df2a2e3860516adef0367"/><dir name="fonts"><file name="android_icons-webfont.eot" hash="2fc917efbfb3c933ccfddc108ef05f33"/><file name="android_icons-webfont.svg" hash="e8cb2b5ef019bbc2885c97ed0caaf2a0"/><file name="android_icons-webfont.ttf" hash="bc567dd7a381093fbb652c58cbad9430"/><file name="android_icons-webfont.woff" hash="8310b54d55bf84a8a3f3a86c22a51aef"/><file name="stars-webfont.eot" hash="019beb4b8ec19447657cf3106138bbe3"/><file name="stars-webfont.svg" hash="20cf0312c0b951d173d4531ea18abc6f"/><file name="stars-webfont.ttf" hash="d63d95e9adaf775f410437535622bf60"/><file name="stars-webfont.woff" hash="526d9756131c94139f0f1df5272197fd"/></dir><file name="mobile-android.css" hash="c932d2898a1ffd5545cfd76699260125"/><file name="mobile-catalog.css" hash="ca7c4c2c7643ca1249e00bbd45980fd2"/><file name="mobile-home.css" hash="b10c97acf5ac07c40d1db72b9d413841"/><file name="mobile-ipad-catalog.css" hash="2b35f47bb153c659640dd37beac277f1"/><file name="mobile-ipad-home.css" hash="270c8e4c8111de6c6173f9b6883c85ec"/><file name="styles.css" hash="c87a56ddc3001a2e357d648695855f5f"/></dir><dir name="images"><dir name="xmlconnect"><dir name="design_default"><file name="accordion_open.png" hash="4c89d903ebbc61ee295ef64a60724b10"/><file name="accordion_open_android.png" hash="7ef2f1d193990c3f4c2c90aae9ab3281"/><file name="accordion_open_android_l.png" hash="bc27688afbfd866c618477ea2c7bf0ee"/><file name="accordion_open_android_p.png" hash="2e4549cba575c12ef2a39c12e9ffe173"/><file name="accordion_open_ipad_l.png" hash="dcdda97da6556393b972d6dae8d6bac5"/><file name="accordion_open_ipad_p.png" hash="55cca08a0ab79047961858789ff8c3a7"/><file name="banner_1_2.png" hash="0637d31df6b5a434c9a332ee46122ef4"/><file name="banner_android.png" hash="02695661b8e50e1a001c3369622f322f"/><file name="banner_ipad.png" hash="c1d59a6ec67da1bb76c5142453da7acf"/><file name="banner_ipad_l.png" hash="04e850d481a9ae902f33fd8c1f89cbf0"/><file name="smallIcon_1_6.png" hash="c1ce9e289eaf2c0504d502928693bd89"/></dir><file name="dropdown-arrow.gif" hash="332e99ca6b4d1e0d39972e04fb0b2395"/><file name="empty.png" hash="23dc9dc3c4751f83c2df7a5c42668824"/><file name="full-arrow-left.gif" hash="8ec91b60d38d1a16cba7670f2088a5c7"/><file name="full-arrow.gif" hash="36ddff0fca1c7d8900cb3633e0a30cea"/><file name="gel_green.png" hash="591959d831e8e42c9175d12a88f0bae2"/><file name="gel_red.png" hash="db442c023014df9da32b84bc1bb5a39f"/><file name="l-arrow.gif" hash="ee49f7eab64657b5131953acef0238fd"/><file name="loading.gif" hash="5d25806dac7cbee5f894b13144783866"/><dir name="mobile_preview"><file name="1.gif" hash="817fd84187db3eee00799b0acf316457"/><file name="2.gif" hash="1a842d8f3ac25cfcdeab6c86dd8fea89"/><file name="3.gif" hash="207cd55e968c284bd52c86efdcdda1c7"/><file name="actionsBackground.png" hash="11faa8baee72f3e6a9a02a83915c8658"/><file name="actionsBg.png" hash="9acccd1980f17006942d74a718ebd7da"/><dir name="android"><file name="background_home_landscape.jpg" hash="1f79a1f42ca4e2cf6010ab6c3ef66aa4"/><file name="background_portrait.jpg" hash="197b15e6455ad1a85e1bad6595371fa3"/><file name="bg_button_up.gif" hash="204f590a88933c930b7fc92963accfab"/><file name="bg_cat_item.png" hash="2859b45c387b66243d4af2ba973b2ae1"/><file name="bg_catalog_filters.png" hash="7464191ebaf576b73a3c021eb1cfcc25"/><file name="bg_catalog_filters_shadow.png" hash="5021ad60917190026d85fae1d33bdaa9"/><file name="bg_content.jpg" hash="70ddfc8959d878d1231dc7cbee4a063c"/><file name="bg_frame.gif" hash="7062ed9b7563fc658f49ce7cfdd34f1c"/><file name="bg_header.png" hash="d4a46c8850d1d89259921b1c28b5bce1"/><file name="bg_header_catalog.png" hash="c1080cd18a89e21da18fdc6955bf6230"/><file name="bg_header_home.png" hash="dfce0445ca7c7a45c7914a986b596ce0"/><file name="bg_home_content.jpg" hash="1d55a198279e4f2b163c98c18f699646"/><file name="bg_home_header.png" hash="8bc1887a0c5760cc47b77b8a7a320426"/><file name="bg_logo.png" hash="02695661b8e50e1a001c3369622f322f"/><file name="bg_page.png" hash="d65f1d123655c2eaf3bb4a1e6035a08d"/><file name="bg_star.png" hash="fc6de6c4e0ed3478b8840e1ab81da725"/><file name="bg_star_empty.png" hash="3f0421fb8c8f6c4be6ca501168a881e8"/><file name="bg_status_bar.png" hash="52b41106451ac34672f82338bbc5370c"/><file name="ico_account.png" hash="c1fd338c74fcf483155acbd37c430807"/><file name="ico_home.png" hash="2de37f640463b354d68945320bfe3e4f"/><file name="ico_search.png" hash="8b0dd17a3e9c3328e66204fe379c66aa"/><file name="logo_big.png" hash="693bb9d118155a146b21ce9fcfba08da"/><file name="product_image.png" hash="dd975b128ba303e0ae2adc9772e0433c"/><file name="product_image_1.jpg" hash="8994979d4dcc1f339c73cd1f44398a7d"/><file name="product_image_2.jpg" hash="26d6599bdb35d80b25a1e903b40cfa19"/><file name="product_image_3.jpg" hash="d7c6d05196a84341afe0025d01b9dc61"/><file name="product_image_4.jpg" hash="2a88ead3dbbeff1d40168db692841f2f"/></dir><file name="arrow.png" hash="837259a7c365e46034dca728bffe9070"/><file name="background.gif" hash="bd92833eb2eb32e4a0282cea153ac13f"/><file name="background.png" hash="3717f4b4ba725701e2a0604129a3a815"/><file name="banner.png" hash="0637d31df6b5a434c9a332ee46122ef4"/><file name="btn-l.png" hash="92b2454528e9d39119038777cf53329c"/><file name="btn-r.png" hash="8c6aa9fd9203bc10822e0505f11e0c4d"/><file name="buttons.php" hash="a04839d41cf73d4c70b498ec75ff2bd4"/><file name="circle.png" hash="f4c116cb0554bf936d3b9ee38b7f3d1f"/><dir name="custom_icons"><file name="account.png" hash="0498d73e47ed47179e5546dc15c17dc7"/><file name="actionsBg.jpg" hash="ee3db742cbec9a436ba46118c8a01303"/><file name="addToCart.png" hash="e33876648546e99d875ca92bd2cd78e9"/><file name="addToWishlist.png" hash="1018602b7c5e0e11f0427ace96fd7d52"/><file name="background.gif" hash="bd92833eb2eb32e4a0282cea153ac13f"/><file name="buttons.gif" hash="0cd19a9d9178976906161ea100cba958"/><file name="cart.png" hash="815b4c64fae21b4c162525ece76dc44d"/><file name="home.png" hash="9e473791b022b7c2dfc7d29b1b6de887"/><file name="image-bg.png" hash="14bde5cf8b00dc5f6c60e52a0fa964dc"/><file name="logo-small.png" hash="9b3477a4552bcb878b4943aae5351622"/><file name="rowBgIcon.gif" hash="9ee89b961ae2bb047672ba5d2d2677c6"/><file name="search.png" hash="10bfa7ec3361ce7cbcc5d25087f181eb"/><file name="shop.png" hash="e6639a9fdc143363da82a7d78e126f1c"/><file name="star-active.png" hash="d4ab959a92bda610527a3e3942c4c0b0"/><file name="star-inactive.png" hash="f7fb99710be4c03ac23b1206f20e761d"/><file name="tellAFriend.png" hash="46f8ef48b29f245977d66d9312d87e70"/><file name="viewDetails.png" hash="9bacc63bcc483d3db5614a026d9391f6"/><file name="viewGallery.png" hash="304f3d03949d07055bc056359fe17763"/></dir><dir name="gradients"><file name="footer.png" hash="31a2feed50ef9c8637b412c4211f8300"/><file name="header.png" hash="5386da930a944cd75562216249cce08a"/><file name="header2.png" hash="ad5a2dc6ec93914e925cfe2d43fb30a2"/><file name="header3.png" hash="920ad8c6903e90323a57fb02dca37280"/><file name="item-bg.png" hash="a14886d1f9e14284ac6b4f1b61e68646"/><file name="sort-bg.png" hash="b8053bb772e849909e5b87e4fd1ebbe4"/></dir><file name="grid.png" hash="23faa3f5572cdeb597c2bceedd93a7f8"/><dir name="icons"><file name="account.png" hash="0498d73e47ed47179e5546dc15c17dc7"/><file name="cart.png" hash="815b4c64fae21b4c162525ece76dc44d"/><file name="home.png" hash="9e473791b022b7c2dfc7d29b1b6de887"/><file name="more.png" hash="f3662ae29923b87eba3a729192aa3df3"/><file name="page.png" hash="2291d77f21de042040bc0864be40138b"/><file name="search.png" hash="10bfa7ec3361ce7cbcc5d25087f181eb"/><file name="shop.png" hash="e6639a9fdc143363da82a7d78e126f1c"/></dir><file name="image-bg.png" hash="a588b9cced95a25fc18e28c775d9a001"/><file name="imageFrame.php" hash="f5a1298dfc6cb70cb486b55820f5ab21"/><file name="info.png" hash="3f0d2ed85b81e8251f294457c6bfa404"/><dir name="ipad"><file name="background_home_landscape.jpg" hash="9e3ef117985113b804531142d539b60a"/><file name="background_portrait.jpg" hash="bdf9e034fd30b923086e6c622ea10451"/><file name="banner_image.png" hash="693bb9d118155a146b21ce9fcfba08da"/><file name="banner_image_l.png" hash="a070a40d57610b5cc7160fe894482a1c"/><file name="bg_catalog_header_hor.png" hash="f61a67aa288e1b8a8df7b4d4527c662e"/><file name="bg_content.jpg" hash="70ddfc8959d878d1231dc7cbee4a063c"/><file name="bg_filter_button.png" hash="728f1cd358446881ffd863eff12204a1"/><file name="bg_filters_buttons.png" hash="02fcb0ed7a7268e9f64ebaf06235bc09"/><file name="bg_filters_tooltip.png" hash="3b05ca6e585acd3d766be01eeaa23d47"/><file name="bg_filters_wrap.png" hash="31288784fe95c67de9b45b44458b4155"/><file name="bg_header.png" hash="e2cf5a575a27e6e4533e3c85e3472a82"/><file name="bg_home_content.jpg" hash="1d55a198279e4f2b163c98c18f699646"/><file name="bg_home_header.png" hash="00f2fbf96d2b915dcbcd921b0301ef3f"/><file name="bg_home_header_hor.png" hash="9bfef728ece003d5b3433d2623ea168c"/><file name="bg_home_products.png" hash="ac6a8a79b959a0c8298b1f607c0f0af8"/><file name="bg_home_shadow.png" hash="c54b071ca3e97a6ee67588ef74b7b44e"/><file name="bg_home_shadow_hor.png" hash="0d21a99c5c749d0e5070e3585ff4a23f"/><file name="bg_product_image.png" hash="4da74325c1a4ee1ca19b414e5d590f75"/><file name="bg_search.png" hash="6ee08d05d0c4ef9ed64b9914b821f408"/><file name="bg_sections.jpg" hash="0ee90005663aced09a9ce6385bdbce2c"/><file name="bg_status_bar.png" hash="17124d9d392bb8e37b202c80a595df54"/><file name="bg_status_bar_hor.png" hash="bd4a9f11ecb1c896145267731d8a951d"/><file name="i_cart.png" hash="1bbe0a0e54eed5bb14b9bfcce83da758"/><file name="i_info.png" hash="3f0fda8b294b67bf698badbcaa99150b"/><file name="i_login.png" hash="deb4089bdc61582c78c90ef192d577e8"/><file name="i_remove.png" hash="4923eb5e76b3c6ba6df5c667db816a0c"/><file name="logo.png" hash="49c19f59b459b6c0b3b99daa3fe7f932"/><file name="logo_big.png" hash="693bb9d118155a146b21ce9fcfba08da"/><file name="product_image.jpg" hash="2bb6c69129bcb18dc93e9f48605647c6"/><file name="sections_arrow.png" hash="7db7144083a31882e8a62cb9579f478f"/><file name="stars.png" hash="70d38cd9883d70e4f6b21ac4874b9868"/></dir><file name="lightStar.php" hash="cba0a7c5f28a1bbc764761f4fc581fe3"/><file name="lightStar.png" hash="b5dc40d5b793dae6a069357f49cccc24"/><file name="lightStar2.png" hash="75928926a6112540c9cb073157cb7d95"/><file name="lines-h.png" hash="ea3d95812c9838affc6df2f3a3cb1977"/><file name="lines-v.png" hash="9e3ffee29ba28477d50da9642019bc0a"/><file name="login-btn-left-alt.png" hash="71bb6c7d24252aace27bee711d7616f4"/><file name="login-btn-left.png" hash="cbbf9afc6e9fc433f57270e88b63f351"/><file name="login-btn-right.png" hash="438fcc598d012bf6d33184e95accfd24"/><file name="login-btn.png" hash="051ee2c1a8ce3f7b8de3293cd2e2ed85"/><file name="logo-small.png" hash="9b3477a4552bcb878b4943aae5351622"/><file name="logo_25.png" hash="ba41ed568d916175c32803b614442447"/><file name="men.png" hash="46d7d1773118ef0a27353e8a9f6719fe"/><file name="mm-frame.gif" hash="eebf30806f1dbf2118e7ec39a016c86d"/><file name="mobile-catalog.css" hash="80cbd74984354df2d86f4ad68b9123a3"/><file name="mobile-home.css" hash="b57641c73c4eae08e0a02cd7291d9465"/><file name="rowBgIcon.gif" hash="9ee89b961ae2bb047672ba5d2d2677c6"/><dir name="slider"><file name="actionsBg.jpg" hash="ee3db742cbec9a436ba46118c8a01303"/><file name="addToCart.png" hash="2a146be4bc63713df19cc353e030d44f"/><file name="addToWishlist.png" hash="9b23a4e0d9acfc79f314e9082f14c4de"/><file name="tellAFriend.png" hash="b7600fa2ae52bdb1d6bb86fe4d9f1773"/><file name="viewDetails.png" hash="90cf37c6dbbee1861350b4c05469e3ae"/><file name="viewGallery.png" hash="304f3d03949d07055bc056359fe17763"/></dir><file name="slider.gif" hash="c6b87bf15b85b18c0515e2cbefaabe60"/><file name="smallIcon.png" hash="e76d2a6364042f41b3f35fc8cdc9c0ee"/><dir name="sort_buttons"><file name="bg_button.png" hash="87d0f1b123f01c3aea3cb8a2b146306e"/><file name="button_up.gif" hash="7ad527f99b9975d5634fb2d5cc99e6b3"/><file name="buttons.gif" hash="2f14f1a3f0fb38790779c992a58654ae"/><file name="buttons.png" hash="b4a3f17370e03bf5d2a5cdf7800c25a7"/><file name="center-active.png" hash="5903988cd458cd794f23a212d51aa725"/><file name="center-inactive.png" hash="135b46aaa5c3b131a5a7e9c45c004e06"/><file name="filters.png" hash="3837ab6fcfe959833dd998533db1ca7f"/><file name="left-active.png" hash="86e94441b96a0d27d0b0a7e5108f86ed"/><file name="left-inactive.png" hash="0ddcb75aa9971cca39a5a65b4bdff8c4"/><file name="right-active.png" hash="320740ff608187301b06a96eab2f9e8e"/><file name="right-inactive.png" hash="cac4b39ab380353ffd5fdbcedb6e0a0a"/></dir><file name="star-active.png" hash="d4ab959a92bda610527a3e3942c4c0b0"/><file name="star-inactive.png" hash="f7fb99710be4c03ac23b1206f20e761d"/><file name="t-shirt.gif" hash="7505efdaabf13c4f8e26f7cfe15c8c96"/><file name="t-shirt.png" hash="46d7d1773118ef0a27353e8a9f6719fe"/><file name="women.png" hash="46d7d1773118ef0a27353e8a9f6719fe"/><file name="youth.png" hash="46d7d1773118ef0a27353e8a9f6719fe"/></dir><file name="r-arrow.gif" hash="d0429a9781e915fc9d9ca8875c470d32"/><file name="small_logo.gif" hash="d5c8be7c0f16aac2549759c0228492d6"/><file name="swatch_black.gif" hash="fd31d6a3a435c8ad1f7c43f346bb47e4"/><file name="swatch_custom.gif" hash="fb34791a48366957a141e12b563888c2"/><file name="swatch_default.gif" hash="fb34791a48366957a141e12b563888c2"/><file name="swatch_funk_leaf.gif" hash="f1d3ba87efb742b47da879a6f48909c4"/><file name="swatch_hot_red.gif" hash="d9363d45dc2993c2fdc3ea43c5b6f71c"/><file name="swatch_sky_blue.gif" hash="ded1455db119d09a3aedd7474fd1875a"/><file name="swatch_user_custom.gif" hash="a24f31421a1ff56d1be0845f9a7c7020"/><file name="switch-arrow.gif" hash="dc7243962b341f366cd072d486687e6a"/><file name="tab_account.png" hash="27101fbaa78a07426be4768acc4c53ff"/><file name="tab_account_android.png" hash="77605cbc87f75ca17e91a5393765ceb1"/><file name="tab_account_ipad.png" hash="2997de5402195d0720309b73c6446fab"/><file name="tab_cart.png" hash="e803f760ee81cb35183f1122f388b774"/><file name="tab_cart_android.png" hash="477e97f8d03ea8aa674e952709f86578"/><file name="tab_empty.png" hash="bdd4cc355566e8861b2c45424ad94516"/><file name="tab_home.png" hash="dfa104e4da74e4a55d3c98d6ee0f7122"/><file name="tab_home_active.png" hash="bba5eb9bb724c84c1ede9e6f4bec3575"/><file name="tab_home_android.png" hash="1fefc6b070cc21b31b43194a7d85f9d9"/><file name="tab_info_android.png" hash="67fc19d8d926f7aede482f5a7083fc71"/><file name="tab_more.png" hash="2803359cb3e795bf67457e727aa16020"/><file name="tab_page.png" hash="ca05dbc42f944b8d4255f6675f6dd93a"/><file name="tab_search.png" hash="2cf29dbe325558353621b4241543204f"/><file name="tab_search_android.png" hash="932c2c568872fd9e119367c887f0539a"/><file name="tab_shop.png" hash="f36be0d3d27f2b37626247d3f6a55e2a"/><file name="tab_shop_active.png" hash="de907d6a52d477d4319649f9b0e2e4aa"/><file name="tab_shop_android.png" hash="e119fcd20f8cba856d550a64d775ddbb"/><file name="tmp-icon.gif" hash="58b759aecf3bdae26d5aaff7a0be5c90"/><file name="xmlconnect_tab.png" hash="cd99a7e01a42a6c82d866f7684faeb95"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="xmlconnect"><dir name="catalog"><dir name="category"><dir name="placeholder"><file name="image.jpg" hash="097ab8a3051bc037ea3de0e17f440540"/><file name="small_image.jpg" hash="f825d16f97a640453553c79c48ebaa73"/><file name="thumbnail.jpg" hash="b2b682d28a08a748a73d2cda70ab5a57"/></dir></dir></dir><file name="tab_account.png" hash="0498d73e47ed47179e5546dc15c17dc7"/><file name="tab_cart.png" hash="9055ba76e256a51d3fee53a8c41d5226"/><file name="tab_home.png" hash="07d0af93e167b9366d3d4fb3d6cdb31c"/><file name="tab_more.png" hash="b9fc21feb8d7655bc9c2985c37b0de2f"/><file name="tab_page.png" hash="ca05dbc42f944b8d4255f6675f6dd93a"/><file name="tab_search.png" hash="25e880eb2a4d06828e2e1c3f32d22400"/><file name="tab_shop.png" hash="fe602fc2e7093efef5ecc0b027a32d91"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="xmlconnect"><dir name="custom"><file name="ok.gif" hash="398f81b3983f802a99932eaf97ee0806"/></dir><dir name="original"><file name="ok.gif" hash="398f81b3983f802a99932eaf97ee0806"/></dir><dir name="system"><file name="ok.gif" hash="398f81b3983f802a99932eaf97ee0806"/></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7.0.0</max></package></required></dependencies>
18
  </package>
skin/adminhtml/default/default/images/xmlconnect/mobile_preview/android/bg_content.jpg ADDED
Binary file
skin/adminhtml/default/default/images/xmlconnect/mobile_preview/android/bg_home_content.jpg ADDED
Binary file
skin/adminhtml/default/default/images/xmlconnect/mobile_preview/android/logo_big.png ADDED
Binary file