Magento_Mobile - Version 1.5.0.0.23.0

Version Notes

1.5.0.0.23.0 version of package
internal svn revision #3cd616975d5927903d4f34bde0d9e5e2e727e9ba

Download this release

Release Info

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


Code changes from version 1.4.2.0.23.0 to 1.5.0.0.23.0

Files changed (96) hide show
  1. app/code/core/Mage/XmlConnect/Block/Adminhtml/Admin/Application/Edit/Tab/Settings.php +1 -1
  2. app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Config.php +1 -1
  3. app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Dashboard.php +1 -1
  4. app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Dashboard/GraphInfo.php +1 -1
  5. app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Dashboard/TopSearchTerms.php +1 -1
  6. app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Loginform.php +1 -1
  7. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php +0 -20
  8. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Images.php +1 -1
  9. app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php +17 -17
  10. app/code/core/Mage/XmlConnect/Block/Cart.php +12 -12
  11. app/code/core/Mage/XmlConnect/Block/Cart/CartTotals.php +0 -29
  12. app/code/core/Mage/XmlConnect/Block/Cart/CartTotals/Nodes/Giftcardaccount.php +4 -4
  13. app/code/core/Mage/XmlConnect/Block/Cart/Items.php +11 -11
  14. app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php +2 -2
  15. app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/OrderDetails.php +2 -2
  16. app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php +1 -1
  17. app/code/core/Mage/XmlConnect/Block/Cart/Totals.php +4 -5
  18. app/code/core/Mage/XmlConnect/Block/Catalog.php +4 -4
  19. app/code/core/Mage/XmlConnect/Block/Catalog/Product/ItemPrice/Giftcard.php +12 -11
  20. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php +2 -2
  21. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php +20 -20
  22. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php +26 -26
  23. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php +10 -10
  24. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php +3 -3
  25. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php +237 -237
  26. app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php +6 -6
  27. app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php +48 -1
  28. app/code/core/Mage/XmlConnect/Block/Checkout/Cart/Item/Renderer/Configurable.php +2 -1
  29. app/code/core/Mage/XmlConnect/Block/Checkout/Cart/Item/Renderer/Grouped.php +2 -1
  30. app/code/core/Mage/XmlConnect/Block/Checkout/Onepage/Address.php +1 -1
  31. app/code/core/Mage/XmlConnect/Block/Checkout/Onepage/Address/Form.php +1 -1
  32. app/code/core/Mage/XmlConnect/Block/Checkout/Onepage/Address/List.php +4 -4
  33. app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php +12 -12
  34. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php +3 -3
  35. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php +2 -2
  36. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php +2 -2
  37. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php +2 -2
  38. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php +27 -1
  39. app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php +9 -9
  40. app/code/core/Mage/XmlConnect/Block/Checkout/Pbridge/Result.php +1 -1
  41. app/code/core/Mage/XmlConnect/Block/Configuration.php +1 -1
  42. app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php +35 -0
  43. app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php +12 -12
  44. app/code/core/Mage/XmlConnect/Block/Customer/Form.php +1 -121
  45. app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php +6 -7
  46. app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php +0 -12
  47. app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php +10 -10
  48. app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php +7 -9
  49. app/code/core/Mage/XmlConnect/Block/Homebanners.php +4 -5
  50. app/code/core/Mage/XmlConnect/Block/Localization.php +1 -1
  51. app/code/core/Mage/XmlConnect/Block/Review/Form.php +1 -1
  52. app/code/core/Mage/XmlConnect/Block/Wishlist.php +15 -14
  53. app/code/core/Mage/XmlConnect/Controller/AdminAction.php +10 -3
  54. app/code/core/Mage/XmlConnect/Helper/AdminApplication.php +2 -2
  55. app/code/core/Mage/XmlConnect/Helper/Android.php +35 -86
  56. app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php +3 -3
  57. app/code/core/Mage/XmlConnect/Helper/Customer/Order.php +10 -10
  58. app/code/core/Mage/XmlConnect/Helper/Data.php +1 -2
  59. app/code/core/Mage/XmlConnect/Helper/Image.php +5 -2
  60. app/code/core/Mage/XmlConnect/Helper/Iphone.php +11 -226
  61. app/code/core/Mage/XmlConnect/Helper/Theme.php +2 -1
  62. app/code/core/Mage/XmlConnect/Model/AdminApplication.php +0 -40
  63. app/code/core/Mage/XmlConnect/Model/Adminhtml/Search/Category.php +1 -1
  64. app/code/core/Mage/XmlConnect/Model/Application.php +7 -3
  65. app/code/core/Mage/XmlConnect/Model/ConfigData.php +5 -8
  66. app/code/core/Mage/XmlConnect/Model/Configuration.php +1 -1
  67. app/code/core/Mage/XmlConnect/Model/Corefix/Checkout/Session.php +0 -137
  68. app/code/core/Mage/XmlConnect/Model/Corefix/Checkout/Type/Onepage.php +0 -465
  69. app/code/core/Mage/XmlConnect/Model/Corefix/Sales/Quote.php +0 -427
  70. app/code/core/Mage/XmlConnect/Model/ImageLimits.php +3 -8
  71. app/code/core/Mage/XmlConnect/Model/Images.php +29 -21
  72. app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php +21 -0
  73. app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php +2 -3
  74. app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php +14 -15
  75. app/code/core/Mage/XmlConnect/Model/Simplexml/Message/Error.php +2 -3
  76. app/code/core/Mage/XmlConnect/controllers/Adminhtml/Connect/ConfigController.php +2 -2
  77. app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php +2 -2
  78. app/code/core/Mage/XmlConnect/controllers/CartController.php +2 -2
  79. app/code/core/Mage/XmlConnect/controllers/CatalogController.php +20 -58
  80. app/code/core/Mage/XmlConnect/controllers/CheckoutController.php +0 -1
  81. app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php +4 -6
  82. app/code/core/Mage/XmlConnect/controllers/WishlistController.php +3 -1
  83. app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-data-upgrade-1.6.0.0-1.6.0.0.1.php +4 -5
  84. app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +1 -14
  85. app/design/adminhtml/default/default/template/xmlconnect/edit/tab/content.phtml +3 -3
  86. app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design.phtml +2 -2
  87. app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/autocomplete.phtml +3 -3
  88. app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_android.phtml +14 -12
  89. app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_ipad.phtml +14 -12
  90. app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_iphone.phtml +14 -12
  91. app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_android.phtml +4 -4
  92. app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_ipad.phtml +4 -4
  93. app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_iphone.phtml +4 -4
  94. app/design/adminhtml/default/default/template/xmlconnect/mobile/notification_helper.phtml +6 -6
  95. app/design/adminhtml/default/default/template/xmlconnect/submission/app_icons_preview.phtml +0 -2
  96. package.xml +5 -5
app/code/core/Mage/XmlConnect/Block/Adminhtml/Admin/Application/Edit/Tab/Settings.php CHANGED
@@ -59,7 +59,7 @@ class Mage_XmlConnect_Block_Adminhtml_Admin_Application_Edit_Tab_Settings
59
  'title' => $this->__('Enable Admin Application'),
60
  'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray(),
61
  'required' => true,
62
- 'value' => Mage::getSingleton('xmlconnect/configuration')->isActiveAdminApp()
63
  ));
64
 
65
  $this->setForm($form);
59
  'title' => $this->__('Enable Admin Application'),
60
  'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray(),
61
  'required' => true,
62
+ 'value' => (int)Mage::getSingleton('xmlconnect/configuration')->isActiveAdminApp()
63
  ));
64
 
65
  $this->setForm($form);
app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Config.php CHANGED
@@ -31,7 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Adminhtml_Connect_Config extends Mage_Core_Block_Template
35
  {
36
  /**
37
  * Render login form xml
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Adminhtml_Connect_Config extends Mage_Core_Block_Abstract
35
  {
36
  /**
37
  * Render login form xml
app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Dashboard.php CHANGED
@@ -31,7 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard extends Mage_Core_Block_Template
35
  {
36
  /**
37
  * Simple xml object
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard extends Mage_Core_Block_Abstract
35
  {
36
  /**
37
  * Simple xml object
app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Dashboard/GraphInfo.php CHANGED
@@ -31,7 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard_GraphInfo extends Mage_Core_Block_Template
35
  {
36
  /**
37
  * Time range filter options
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard_GraphInfo extends Mage_Core_Block_Abstract
35
  {
36
  /**
37
  * Time range filter options
app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Dashboard/TopSearchTerms.php CHANGED
@@ -82,7 +82,7 @@ class Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard_TopSearchTerms
82
  * Add last search terms info to xml object
83
  *
84
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
85
- * @return Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard_LastOrders
86
  */
87
  public function addTopSearchTermsToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
88
  {
82
  * Add last search terms info to xml object
83
  *
84
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
85
+ * @return Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard_TopSearchTerms
86
  */
87
  public function addTopSearchTermsToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
88
  {
app/code/core/Mage/XmlConnect/Block/Adminhtml/Connect/Loginform.php CHANGED
@@ -31,7 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Adminhtml_Connect_Loginform extends Mage_Core_Block_Template
35
  {
36
  /**
37
  * Render login form xml
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Adminhtml_Connect_Loginform extends Mage_Core_Block_Abstract
35
  {
36
  /**
37
  * Render login form xml
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php CHANGED
@@ -104,26 +104,6 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Content
104
  return $this;
105
  }
106
 
107
- /**
108
- * Retrieve add page button
109
- *
110
- * @return string
111
- */
112
- public function getAddButtonHtml()
113
- {
114
- return $this->getChildHtml('add_button');
115
- }
116
-
117
- /**
118
- * Retrieve delete page button
119
- *
120
- * @return string
121
- */
122
- public function getDeleteButtonHtml()
123
- {
124
- return $this->getChildHtml('delete_button');
125
- }
126
-
127
  /**
128
  * Prepare label for tab
129
  *
104
  return $this;
105
  }
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  /**
108
  * Prepare label for tab
109
  *
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Images.php CHANGED
@@ -168,7 +168,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Images extends Mage
168
  /**
169
  * Retrieve image config object
170
  *
171
- * @return Varien_Config
172
  */
173
  public function getConfig()
174
  {
168
  /**
169
  * Retrieve image config object
170
  *
171
+ * @return Varien_Object
172
  */
173
  public function getConfig()
174
  {
app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php CHANGED
@@ -191,7 +191,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Tab_Container_Submission
191
  $fieldset->addField('conf/submit_text/contact_email', 'text', array(
192
  'name' => 'conf[submit_text][email]',
193
  'label' => $this->__('Contact Email'),
194
- 'class' => 'email',
195
  'maxlength' => '40',
196
  'value' => isset($formData['conf[submit_text][email]']) ? $formData['conf[submit_text][email]'] : null,
197
  'note' => $this->__('Administrative contact for this app and for app submission issues.'),
@@ -270,54 +270,54 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Tab_Container_Submission
270
  switch ($deviceType) {
271
  case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE:
272
  $this->addImage($fieldset, 'conf/submit/icon', $this->__('Large iTunes Icon'),
273
- $this->__('Large icon that appears in the iTunes App Store. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Required size: 512px x 512px.'), '', true);
274
 
275
  $this->addImage($fieldset, 'conf/submit/loader_image', $this->__('Loader Splash Screen'),
276
- $this->__('Image that appears on first screen while your app is loading. Required size: 320px x 460px.'), '', true);
277
 
278
  $this->addImage($fieldset, 'conf/submit/loader_image_i4', $this->__('Loader Splash Screen <br />(iPhone 4 retina)'),
279
- $this->__('Image that appears on first screen while your app is loading. Required size: 640px x 920px.'), '', false);
280
 
281
  $this->addImage($fieldset, 'conf/submit/logo', $this->__('Custom App Icon'),
282
- $this->__('Icon that will appear on the users phone after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Recommended size: 57px x 57px at 72 dpi.'), '', true);
283
 
284
  $this->addImage($fieldset, 'conf/submit/logo_i4', $this->__('Custom App Icon <br />(iPhone 4 retina)'),
285
- $this->__('Icon that will appear on the user\'s phone after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Recommended size: 114px x 114px.'), '', false);
286
 
287
  $this->addImage($fieldset, 'conf/submit/big_logo', $this->__('Copyright Page Logo'),
288
- $this->__('Store logo that is displayed on copyright page of app. Preferred size: 100px x 100px.'), '', true);
289
 
290
  $this->addImage($fieldset, 'conf/submit/big_logo_i4', $this->__('Copyright Page Logo <br />(iPhone 4 retina)'),
291
- $this->__('Store logo that is displayed on copyright page of app. Preferred size: 200px x 200px.'), '', false);
292
  break;
293
  case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD:
294
  $this->addImage($fieldset, 'conf/submit/icon', $this->__('Large iTunes Icon'),
295
- $this->__('Large icon that appears in the iTunes App Store. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Required size: 512px x 512px.'), '', true);
296
 
297
  $this->addImage($fieldset, 'conf/submit/ipad_loader_portrait_image', $this->__('Loader Splash Screen <br />(portrait mode)'),
298
- $this->__('Image that appears on first screen while your app is loading. Required size: 768px x 1024px.'), '', true);
299
 
300
  $this->addImage($fieldset, 'conf/submit/ipad_loader_landscape_image', $this->__('Loader Splash Screen <br />(landscape mode)'),
301
- $this->__('Image that appears on first screen while your app is loading. Required size: 1024px x 768px.'), '', true);
302
 
303
  $this->addImage($fieldset, 'conf/submit/ipad_logo', $this->__('Custom App Icon'),
304
- $this->__('Icon that will appear on the user\'s device after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Recommended size: 72px x 72px.'), '', true);
305
 
306
  $this->addImage($fieldset, 'conf/submit/big_logo', $this->__('Copyright Page Logo'),
307
- $this->__('Store logo that is displayed on copyright page of app. Preferred size: 100px x 100px.'), '', true);
308
  break;
309
  case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID:
310
  $this->addImage($fieldset, 'conf/submit/icon', $this->__('High Resolution Application Icon'),
311
- $this->__('The icon that appears in the Android Market. Recommended size: 512px x 512px. Maximum size: 1024 KB.'), '', true);
312
 
313
  $this->addImage($fieldset, 'conf/submit/android_loader_image', $this->__('Loader Splash Screen'),
314
- $this->__('Image that appears on first screen while your app is loading. Required size: 320px x 455px.'), '', true);
315
 
316
  $this->addImage($fieldset, 'conf/submit/android_logo', $this->__('Custom App Icon'),
317
- $this->__('Icon that will appear on the user\'s device after they download your app. Recommended size: 48px x 48px.'), '', true);
318
 
319
  $this->addImage($fieldset, 'conf/submit/big_logo', $this->__('Copyright Page Logo'),
320
- $this->__('Store logo that is displayed on copyright page of app. Preferred size: 100px x 100px.'), '', true);
321
  break;
322
  }
323
 
191
  $fieldset->addField('conf/submit_text/contact_email', 'text', array(
192
  'name' => 'conf[submit_text][email]',
193
  'label' => $this->__('Contact Email'),
194
+ 'class' => 'validate-email email',
195
  'maxlength' => '40',
196
  'value' => isset($formData['conf[submit_text][email]']) ? $formData['conf[submit_text][email]'] : null,
197
  'note' => $this->__('Administrative contact for this app and for app submission issues.'),
270
  switch ($deviceType) {
271
  case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE:
272
  $this->addImage($fieldset, 'conf/submit/icon', $this->__('Large iTunes Icon'),
273
+ $this->__('Large icon that appears in the iTunes App Store. You do not need to apply a gradient or soft edges (this is done automatically by Apple).') . $this->__('Required size: %spx x %spx.', 512, 512), '', true);
274
 
275
  $this->addImage($fieldset, 'conf/submit/loader_image', $this->__('Loader Splash Screen'),
276
+ $this->__('Image that appears on first screen while your app is loading.') . $this->__('Required size: %spx x %spx.', 320, 460), '', true);
277
 
278
  $this->addImage($fieldset, 'conf/submit/loader_image_i4', $this->__('Loader Splash Screen <br />(iPhone 4 retina)'),
279
+ $this->__('Image that appears on first screen while your app is loading.') . $this->__('Required size: %spx x %spx.', 640, 920), '', false);
280
 
281
  $this->addImage($fieldset, 'conf/submit/logo', $this->__('Custom App Icon'),
282
+ $this->__('Icon that will appear on the user\'s phone after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple).') . $this->__('Recommended size: %spx x %spx at %s dpi.', 57, 57, 72), '', true);
283
 
284
  $this->addImage($fieldset, 'conf/submit/logo_i4', $this->__('Custom App Icon <br />(iPhone 4 retina)'),
285
+ $this->__('Icon that will appear on the user\'s phone after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple).') . $this->__('Recommended size: %spx x %spx.', 114, 114), '', false);
286
 
287
  $this->addImage($fieldset, 'conf/submit/big_logo', $this->__('Copyright Page Logo'),
288
+ $this->__('Store logo that is displayed on copyright page of app.') . $this->__('Preferred size: %spx x %spx.', 100, 100), '', true);
289
 
290
  $this->addImage($fieldset, 'conf/submit/big_logo_i4', $this->__('Copyright Page Logo <br />(iPhone 4 retina)'),
291
+ $this->__('Store logo that is displayed on copyright page of app.') . $this->__('Preferred size: %spx x %spx.', 200, 200), '', false);
292
  break;
293
  case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD:
294
  $this->addImage($fieldset, 'conf/submit/icon', $this->__('Large iTunes Icon'),
295
+ $this->__('Large icon that appears in the iTunes App Store. You do not need to apply a gradient or soft edges (this is done automatically by Apple).') . $this->__('Required size: %spx x %spx.', 512, 512), '', true);
296
 
297
  $this->addImage($fieldset, 'conf/submit/ipad_loader_portrait_image', $this->__('Loader Splash Screen <br />(portrait mode)'),
298
+ $this->__('Image that appears on first screen while your app is loading.') . $this->__('Required size: %spx x %spx.', 768, 1024), '', true);
299
 
300
  $this->addImage($fieldset, 'conf/submit/ipad_loader_landscape_image', $this->__('Loader Splash Screen <br />(landscape mode)'),
301
+ $this->__('Image that appears on first screen while your app is loading.') . $this->__('Required size: %spx x %spx.', 1024, 768), '', true);
302
 
303
  $this->addImage($fieldset, 'conf/submit/ipad_logo', $this->__('Custom App Icon'),
304
+ $this->__('Icon that will appear on the user\'s device after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple).') . $this->__('Recommended size: %spx x %spx.', 72, 72), '', true);
305
 
306
  $this->addImage($fieldset, 'conf/submit/big_logo', $this->__('Copyright Page Logo'),
307
+ $this->__('Store logo that is displayed on copyright page of app.') . $this->__('Preferred size: %spx x %spx.', 100, 100), '', true);
308
  break;
309
  case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID:
310
  $this->addImage($fieldset, 'conf/submit/icon', $this->__('High Resolution Application Icon'),
311
+ $this->__('The icon that appears in the Android Market.') . $this->__('Recommended size: %spx x %spx.', 512, 512) . $this->__('Maximum size: %s KB.', 1024), '', true);
312
 
313
  $this->addImage($fieldset, 'conf/submit/android_loader_image', $this->__('Loader Splash Screen'),
314
+ $this->__('Image that appears on first screen while your app is loading.') . $this->__('Required size: %spx x %spx.', 320, 455), '', true);
315
 
316
  $this->addImage($fieldset, 'conf/submit/android_logo', $this->__('Custom App Icon'),
317
+ $this->__('Icon that will appear on the user\'s device after they download your app.') . $this->__('Recommended size: %spx x %spx.', 48, 48), '', true);
318
 
319
  $this->addImage($fieldset, 'conf/submit/big_logo', $this->__('Copyright Page Logo'),
320
+ $this->__('Store logo that is displayed on copyright page of app.') . $this->__('Preferred size: %spx x %spx.', 100, 100), '', true);
321
  break;
322
  }
323
 
app/code/core/Mage/XmlConnect/Block/Cart.php CHANGED
@@ -84,13 +84,13 @@ class Mage_XmlConnect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
84
  }
85
  }
86
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
87
- $_incl = $this->helper('checkout')->getPriceInclTax($item);
88
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
89
  && $item->getWeeeTaxAppliedAmount()
90
  ) {
91
- $inclPrice = $_incl + $item->getWeeeTaxAppliedAmount();
92
  } else {
93
- $inclPrice = $_incl - $item->getWeeeTaxDisposition();
94
  }
95
  }
96
  $exclPrice = Mage::helper('xmlconnect')->formatPriceForXml($exclPrice);
@@ -150,13 +150,13 @@ class Mage_XmlConnect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
150
  }
151
  }
152
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
153
- $_incl = $this->helper('checkout')->getSubtotalInclTax($item);
154
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
155
  && $item->getWeeeTaxAppliedAmount()
156
  ) {
157
- $inclPrice = $_incl + $item->getWeeeTaxAppliedRowAmount();
158
  } else {
159
- $inclPrice = $_incl - $item->getWeeeTaxRowDisposition();
160
  }
161
  }
162
 
@@ -189,14 +189,14 @@ class Mage_XmlConnect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
189
  /**
190
  * Options list
191
  */
192
- $_options = $renderer->getOptionList();
193
- if ($_options) {
194
  $itemOptionsXml = $itemXml->addChild('options');
195
- foreach ($_options as $_option) {
196
- $_formattedOptionValue = $renderer->getFormatedOptionValue($_option);
197
  $optionXml = $itemOptionsXml->addChild('option');
198
- $optionXml->addAttribute('label', $xmlObject->xmlAttribute($_option['label']));
199
- $optionXml->addAttribute('text', $xmlObject->xmlAttribute($_formattedOptionValue['value']));
200
  }
201
  }
202
 
84
  }
85
  }
86
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
87
+ $incl = $this->helper('checkout')->getPriceInclTax($item);
88
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
89
  && $item->getWeeeTaxAppliedAmount()
90
  ) {
91
+ $inclPrice = $incl + $item->getWeeeTaxAppliedAmount();
92
  } else {
93
+ $inclPrice = $incl - $item->getWeeeTaxDisposition();
94
  }
95
  }
96
  $exclPrice = Mage::helper('xmlconnect')->formatPriceForXml($exclPrice);
150
  }
151
  }
152
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
153
+ $incl = $this->helper('checkout')->getSubtotalInclTax($item);
154
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
155
  && $item->getWeeeTaxAppliedAmount()
156
  ) {
157
+ $inclPrice = $incl + $item->getWeeeTaxAppliedRowAmount();
158
  } else {
159
+ $inclPrice = $incl - $item->getWeeeTaxRowDisposition();
160
  }
161
  }
162
 
189
  /**
190
  * Options list
191
  */
192
+ $options = $renderer->getOptionList();
193
+ if ($options) {
194
  $itemOptionsXml = $itemXml->addChild('options');
195
+ foreach ($options as $option) {
196
+ $formattedOptionValue = $renderer->getFormatedOptionValue($option);
197
  $optionXml = $itemOptionsXml->addChild('option');
198
+ $optionXml->addAttribute('label', $xmlObject->xmlAttribute($option['label']));
199
+ $optionXml->addAttribute('text', $xmlObject->xmlAttribute($formattedOptionValue['value']));
200
  }
201
  }
202
 
app/code/core/Mage/XmlConnect/Block/Cart/CartTotals.php CHANGED
@@ -40,13 +40,6 @@ class Mage_XmlConnect_Block_Cart_CartTotals extends Mage_Checkout_Block_Cart_Tot
40
  */
41
  protected $_defaultRenderer = 'xmlconnect/cart_cartTotals_default';
42
 
43
- /**
44
- * Cart xml object
45
- *
46
- * @var null|Mage_XmlConnect_Model_Simplexml_Element
47
- */
48
- protected $_cartXmlObject;
49
-
50
  /**
51
  * Render cart totals xml
52
  *
@@ -99,26 +92,4 @@ class Mage_XmlConnect_Block_Cart_CartTotals extends Mage_Checkout_Block_Cart_Tot
99
  $block->setTotals($this->getTotals());
100
  return $block;
101
  }
102
-
103
- /**
104
- * Set cart xml object
105
- *
106
- * @param Mage_XmlConnect_Model_Simplexml_Element $cartXmlObject
107
- * @return Mage_XmlConnect_Block_Cart_CartTotals
108
- */
109
- public function setCartXmlObject($cartXmlObject)
110
- {
111
- $this->_cartXmlObject = $cartXmlObject;
112
- return $this;
113
- }
114
-
115
- /**
116
- * Get cart xml object
117
- *
118
- * @return Mage_XmlConnect_Model_Simplexml_Element|null
119
- */
120
- public function getCartXmlObject()
121
- {
122
- return $this->_cartXmlObject;
123
- }
124
  }
40
  */
41
  protected $_defaultRenderer = 'xmlconnect/cart_cartTotals_default';
42
 
 
 
 
 
 
 
 
43
  /**
44
  * Render cart totals xml
45
  *
92
  $block->setTotals($this->getTotals());
93
  return $block;
94
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
app/code/core/Mage/XmlConnect/Block/Cart/CartTotals/Nodes/Giftcardaccount.php CHANGED
@@ -45,16 +45,16 @@ class Mage_Xmlconnect_Block_Cart_CartTotals_Nodes_Giftcardaccount extends Mage_C
45
  }
46
  /** @var $cartXmlObject Mage_XmlConnect_Model_Simplexml_Element */
47
  $cartXmlObject = $this->getCartObject();
48
- $_cards = $this->getTotal()->getGiftCards();
49
- if (!$_cards) {
50
- $_cards = $this->getQuoteGiftCards();
51
  }
52
  $code = $this->getTotal()->getCode();
53
 
54
  /** @var $giftCardsXmlObj Mage_XmlConnect_Model_Simplexml_Element */
55
  $giftCardsXmlObj = $cartXmlObject->addCustomChild($code);
56
 
57
- foreach ($_cards as $cardCode) {
58
  $giftCardValue = Mage::helper('xmlconnect')->formatPriceForXml($cardCode['a']);
59
  $formattedValue = $this->getQuote()->getStore()->formatPrice($giftCardValue, false);
60
  $giftCardsXmlObj->addCustomChild('item', '-' . $giftCardValue, array(
45
  }
46
  /** @var $cartXmlObject Mage_XmlConnect_Model_Simplexml_Element */
47
  $cartXmlObject = $this->getCartObject();
48
+ $cards = $this->getTotal()->getGiftCards();
49
+ if (!$cards) {
50
+ $cards = $this->getQuoteGiftCards();
51
  }
52
  $code = $this->getTotal()->getCode();
53
 
54
  /** @var $giftCardsXmlObj Mage_XmlConnect_Model_Simplexml_Element */
55
  $giftCardsXmlObj = $cartXmlObject->addCustomChild($code);
56
 
57
+ foreach ($cards as $cardCode) {
58
  $giftCardValue = Mage::helper('xmlconnect')->formatPriceForXml($cardCode['a']);
59
  $formattedValue = $this->getQuote()->getStore()->formatPrice($giftCardValue, false);
60
  $giftCardsXmlObj->addCustomChild('item', '-' . $giftCardValue, array(
app/code/core/Mage/XmlConnect/Block/Cart/Items.php CHANGED
@@ -77,13 +77,13 @@ class Mage_XmlConnect_Block_Cart_Items extends Mage_Checkout_Block_Cart_Abstract
77
  }
78
  }
79
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
80
- $_incl = $this->helper('checkout')->getPriceInclTax($item);
81
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
82
  && $item->getWeeeTaxAppliedAmount()
83
  ) {
84
- $inclPrice = $_incl + $item->getWeeeTaxAppliedAmount();
85
  } else {
86
- $inclPrice = $_incl - $item->getWeeeTaxDisposition();
87
  }
88
  }
89
  $exclPrice = Mage::helper('xmlconnect')->formatPriceForXml($exclPrice);
@@ -162,13 +162,13 @@ class Mage_XmlConnect_Block_Cart_Items extends Mage_Checkout_Block_Cart_Abstract
162
  }
163
  }
164
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
165
- $_incl = $this->helper('checkout')->getSubtotalInclTax($item);
166
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
167
  && $item->getWeeeTaxAppliedAmount()
168
  ) {
169
- $subtotalInclTax = $_incl + $item->getWeeeTaxAppliedRowAmount();
170
  } else {
171
- $subtotalInclTax = $_incl - $item->getWeeeTaxRowDisposition();
172
  }
173
  }
174
 
@@ -212,14 +212,14 @@ class Mage_XmlConnect_Block_Cart_Items extends Mage_Checkout_Block_Cart_Abstract
212
  /**
213
  * Options list
214
  */
215
- $_options = $renderer->getOptionList();
216
- if ($_options) {
217
  $itemOptionsXml = $itemXml->addCustomChild('options');
218
- foreach ($_options as $_option) {
219
- $_formattedOptionValue = $renderer->getFormatedOptionValue($_option);
220
  $itemOptionsXml->addCustomChild('option', null, array(
221
  'label' => $xmlObject->xmlAttribute($_option['label']),
222
- 'text' => $xmlObject->xmlAttribute($_formattedOptionValue['value'])
223
  ));
224
  }
225
  }
77
  }
78
  }
79
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
80
+ $incl = $this->helper('checkout')->getPriceInclTax($item);
81
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
82
  && $item->getWeeeTaxAppliedAmount()
83
  ) {
84
+ $inclPrice = $incl + $item->getWeeeTaxAppliedAmount();
85
  } else {
86
+ $inclPrice = $incl - $item->getWeeeTaxDisposition();
87
  }
88
  }
89
  $exclPrice = Mage::helper('xmlconnect')->formatPriceForXml($exclPrice);
162
  }
163
  }
164
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
165
+ $incl = $this->helper('checkout')->getSubtotalInclTax($item);
166
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
167
  && $item->getWeeeTaxAppliedAmount()
168
  ) {
169
+ $subtotalInclTax = $incl + $item->getWeeeTaxAppliedRowAmount();
170
  } else {
171
+ $subtotalInclTax = $incl - $item->getWeeeTaxRowDisposition();
172
  }
173
  }
174
 
212
  /**
213
  * Options list
214
  */
215
+ $options = $renderer->getOptionList();
216
+ if ($options) {
217
  $itemOptionsXml = $itemXml->addCustomChild('options');
218
+ foreach ($options as $_option) {
219
+ $formattedOptionValue = $renderer->getFormatedOptionValue($_option);
220
  $itemOptionsXml->addCustomChild('option', null, array(
221
  'label' => $xmlObject->xmlAttribute($_option['label']),
222
+ 'text' => $xmlObject->xmlAttribute($formattedOptionValue['value'])
223
  ));
224
  }
225
  }
app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php CHANGED
@@ -42,8 +42,8 @@ class Mage_XmlConnect_Block_Cart_Paypal_Mecl_Details extends Mage_Paypal_Block_E
42
  public function addDetailsToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $reviewXmlObj)
43
  {
44
  $itemsXmlObj = $reviewXmlObj->addChild('ordered_items');
45
- foreach ($this->getItems() as $_item) {
46
- $this->getItemXml($_item, $itemsXmlObj);
47
  }
48
 
49
  $reviewXmlObj->appendChild($this->getChild('totals')->setReturnObjectFlag(true)->_toHtml());
42
  public function addDetailsToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $reviewXmlObj)
43
  {
44
  $itemsXmlObj = $reviewXmlObj->addChild('ordered_items');
45
+ foreach ($this->getItems() as $item) {
46
+ $this->getItemXml($item, $itemsXmlObj);
47
  }
48
 
49
  $reviewXmlObj->appendChild($this->getChild('totals')->setReturnObjectFlag(true)->_toHtml());
app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/OrderDetails.php CHANGED
@@ -42,8 +42,8 @@ class Mage_XmlConnect_Block_Cart_Paypal_Mecl_OrderDetails extends Mage_Paypal_Bl
42
  public function addDetailsToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $reviewXmlObj)
43
  {
44
  $itemsXmlObj = $reviewXmlObj->addChild('ordered_items');
45
- foreach ($this->getItems() as $_item) {
46
- $this->getItemXml($_item, $itemsXmlObj);
47
  }
48
 
49
  $this->getChild('totals')->setCartXmlObject($reviewXmlObj)->_toHtml();
42
  public function addDetailsToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $reviewXmlObj)
43
  {
44
  $itemsXmlObj = $reviewXmlObj->addChild('ordered_items');
45
+ foreach ($this->getItems() as $item) {
46
+ $this->getItemXml($item, $itemsXmlObj);
47
  }
48
 
49
  $this->getChild('totals')->setCartXmlObject($reviewXmlObj)->_toHtml();
app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php CHANGED
@@ -43,7 +43,7 @@ class Mage_XmlConnect_Block_Cart_Paypal_Mep_Totals extends Mage_Checkout_Block_C
43
  /** @var $paypalCart Mage_Paypal_Model_Cart */
44
  $paypalCart = Mage::getModel('paypal/cart', array($this->getQuote()));
45
  /** @var $totalsXmlObj Mage_XmlConnect_Model_Simplexml_Element */
46
- $totalsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<cart_totals></cart_totals>');
47
  foreach ($paypalCart->getTotals(true) as $code => $amount) {
48
  $currencyAmount = $this->helper('core')->currency($amount, false, false);
49
  $totalsXmlObj->addChild($code, sprintf('%01.2F', $currencyAmount));
43
  /** @var $paypalCart Mage_Paypal_Model_Cart */
44
  $paypalCart = Mage::getModel('paypal/cart', array($this->getQuote()));
45
  /** @var $totalsXmlObj Mage_XmlConnect_Model_Simplexml_Element */
46
+ $totalsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<cart_totals></cart_totals>');
47
  foreach ($paypalCart->getTotals(true) as $code => $amount) {
48
  $currencyAmount = $this->helper('core')->currency($amount, false, false);
49
  $totalsXmlObj->addChild($code, sprintf('%01.2F', $currencyAmount));
app/code/core/Mage/XmlConnect/Block/Cart/Totals.php CHANGED
@@ -90,7 +90,6 @@ class Mage_XmlConnect_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals
90
  $this->_addTotalDataToXmlObj(
91
  $totalsXmlObj, $code . '_excl_tax', $title, $grandTotalExlTax
92
  );
93
-
94
  $code = $code . '_incl_tax';
95
  $title = $this->__('Grand Total (Incl. Tax)');
96
  }
@@ -101,12 +100,12 @@ class Mage_XmlConnect_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals
101
  }
102
  continue 2;
103
  case 'giftcardaccount':
104
- $_cards = $renderer->getTotal()->getGiftCards();
105
- if (!$_cards) {
106
- $_cards = $renderer->getQuoteGiftCards();
107
  }
108
  if ($renderer->getTotal()->getValue()) {
109
- foreach ($_cards as $cardCode) {
110
  $title = $this->__('Gift Card (%s)', $cardCode['c']);
111
  $value = $cardCode['c'];
112
  $totalXmlObj = $totalsXmlObj->addChild($code);
90
  $this->_addTotalDataToXmlObj(
91
  $totalsXmlObj, $code . '_excl_tax', $title, $grandTotalExlTax
92
  );
 
93
  $code = $code . '_incl_tax';
94
  $title = $this->__('Grand Total (Incl. Tax)');
95
  }
100
  }
101
  continue 2;
102
  case 'giftcardaccount':
103
+ $cards = $renderer->getTotal()->getGiftCards();
104
+ if (!$cards) {
105
+ $cards = $renderer->getQuoteGiftCards();
106
  }
107
  if ($renderer->getTotal()->getValue()) {
108
+ foreach ($cards as $cardCode) {
109
  $title = $this->__('Gift Card (%s)', $cardCode['c']);
110
  $value = $cardCode['c'];
111
  $totalXmlObj = $totalsXmlObj->addChild($code);
app/code/core/Mage/XmlConnect/Block/Catalog.php CHANGED
@@ -116,13 +116,13 @@ class Mage_XmlConnect_Block_Catalog extends Mage_Catalog_Block_Product_List_Tool
116
  $sortOptions = array_merge(array('relevance' => $this->__('Relevance')), $sortOptions);
117
  $this->setAvailableOrders($sortOptions)->setDefaultDirection('desc')->setSortBy('relevance');
118
 
119
- foreach($this->getAvailableOrders() as $_key => $_order) {
120
  $item = $ordersXmlObject->addChild('item');
121
- if ($this->isOrderCurrent($_key)) {
122
  $item->addAttribute('isDefault', 1);
123
  }
124
- $item->addChild('code', $_key);
125
- $item->addChild('name', $ordersXmlObject->escapeXml($_order));
126
  }
127
  return $ordersXmlObject;
128
  }
116
  $sortOptions = array_merge(array('relevance' => $this->__('Relevance')), $sortOptions);
117
  $this->setAvailableOrders($sortOptions)->setDefaultDirection('desc')->setSortBy('relevance');
118
 
119
+ foreach($this->getAvailableOrders() as $key => $order) {
120
  $item = $ordersXmlObject->addChild('item');
121
+ if ($this->isOrderCurrent($key)) {
122
  $item->addAttribute('isDefault', 1);
123
  }
124
+ $item->addChild('code', $key);
125
+ $item->addChild('name', $ordersXmlObject->escapeXml($order));
126
  }
127
  return $ordersXmlObject;
128
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/ItemPrice/Giftcard.php CHANGED
@@ -66,30 +66,31 @@ class Mage_XmlConnect_Block_Catalog_Product_ItemPrice_Giftcard extends Mage_Bund
66
  *
67
  * @param Mage_Catalog_Model_Product $product
68
  * @param Mage_XmlConnect_Model_Simplexml_Element $item
 
69
  */
70
- public function collectProductPrices(
71
- Mage_Catalog_Model_Product $product, Mage_XmlConnect_Model_Simplexml_Element $item
72
- ) {
73
  $this->setProduct($product);
74
 
75
  if ($product->getCanShowPrice() !== false) {
76
  $priceListXmlObj = $item->addCustomChild('price_list');
77
 
78
- $_min = $this->getMinAmount();
79
- $_max = $this->getMaxAmount();
80
- if ($_min && $_max && $_min == $_max) {
81
  $pricesXmlObj = $priceListXmlObj->addCustomChild('prices', null, array('id' => 'price'));
82
- $pricesXmlObj->addCustomChild('price', $_min, array(
83
  'id' => 'regular',
84
  'label' => $this->__('Regular'),
85
- 'formatted_value' => Mage::helper('core')->currency($_min, true, false)
86
  ));
87
- } elseif ($_min && $_min != 0) {
88
  $pricesXmlObj = $priceListXmlObj->addCustomChild('prices', null, array('id' => 'price'));
89
- $pricesXmlObj->addCustomChild('price', $_min, array(
90
  'id' => 'regular',
91
  'label' => $this->__('From'),
92
- 'formatted_value' => Mage::helper('core')->currency($_min, true, false)
93
  ));
94
  }
95
  }
66
  *
67
  * @param Mage_Catalog_Model_Product $product
68
  * @param Mage_XmlConnect_Model_Simplexml_Element $item
69
+ * @return null
70
  */
71
+ public function collectProductPrices(Mage_Catalog_Model_Product $product,
72
+ Mage_XmlConnect_Model_Simplexml_Element $item)
73
+ {
74
  $this->setProduct($product);
75
 
76
  if ($product->getCanShowPrice() !== false) {
77
  $priceListXmlObj = $item->addCustomChild('price_list');
78
 
79
+ $min = $this->getMinAmount();
80
+ $max = $this->getMaxAmount();
81
+ if ($min && $max && $min == $max) {
82
  $pricesXmlObj = $priceListXmlObj->addCustomChild('prices', null, array('id' => 'price'));
83
+ $pricesXmlObj->addCustomChild('price', $min, array(
84
  'id' => 'regular',
85
  'label' => $this->__('Regular'),
86
+ 'formatted_value' => Mage::helper('core')->currency($min, true, false)
87
  ));
88
+ } elseif ($min && $min != 0) {
89
  $pricesXmlObj = $priceListXmlObj->addCustomChild('prices', null, array('id' => 'price'));
90
+ $pricesXmlObj->addCustomChild('price', $min, array(
91
  'id' => 'regular',
92
  'label' => $this->__('From'),
93
+ 'formatted_value' => Mage::helper('core')->currency($min, true, false)
94
  ));
95
  }
96
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php CHANGED
@@ -64,7 +64,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options extends Mage_XmlConnect_Bloc
64
  }
65
 
66
  /**
67
- * Create product custom options Mage_XmlConnect_Model_Simplexml_Element object
68
  *
69
  * @param Mage_Catalog_Model_Product $product
70
  * @return Mage_XmlConnect_Model_Simplexml_Element
@@ -189,7 +189,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options extends Mage_XmlConnect_Bloc
189
  }
190
 
191
  /**
192
- * Create produc custom options Mage_XmlConnect_Model_Simplexml_Element object
193
  *
194
  * @param Mage_Catalog_Model_Product $product
195
  * @return Mage_XmlConnect_Model_Simplexml_Element | false
64
  }
65
 
66
  /**
67
+ * Create produc custom options Mage_XmlConnect_Model_Simplexml_Element object
68
  *
69
  * @param Mage_Catalog_Model_Product $product
70
  * @return Mage_XmlConnect_Model_Simplexml_Element
189
  }
190
 
191
  /**
192
+ * Create product custom options Mage_XmlConnect_Model_Simplexml_Element object
193
  *
194
  * @param Mage_Catalog_Model_Product $product
195
  * @return Mage_XmlConnect_Model_Simplexml_Element | false
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php CHANGED
@@ -66,9 +66,9 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne
66
  return $isObject ? $xmlModel : $xmlModel->asNiceXml();
67
  }
68
 
69
- foreach ($bundleOptions as $_option) {
70
- $selections = $_option->getSelections();
71
- $optionId = $_option->getOptionId();
72
  if (empty($selections)) {
73
  continue;
74
  }
@@ -76,43 +76,43 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne
76
  $optionNode = $optionsXmlObj->addChild('option');
77
 
78
  $type = parent::OPTION_TYPE_SELECT;
79
- if ($_option->isMultiSelection()) {
80
  $type = parent::OPTION_TYPE_CHECKBOX;
81
  }
82
- $code = 'bundle_option[' . $_option->getId() . ']';
83
  if ($type == parent::OPTION_TYPE_CHECKBOX) {
84
  $code .= '[]';
85
  }
86
  $optionNode->addAttribute('code', $code);
87
  $optionNode->addAttribute('type', $type);
88
- $optionNode->addAttribute('label', $optionsXmlObj->escapeXml($_option->getTitle()));
89
- if ($_option->getRequired()) {
90
  $optionNode->addAttribute('is_required', 1);
91
  }
92
 
93
- foreach ($selections as $_selection) {
94
- if (!$_selection->isSaleable()) {
95
  continue;
96
  }
97
- $_qty = null;
98
  if ($product->hasPreconfiguredValues()) {
99
- $_qty = $product->getPreconfiguredValues()->getData("bundle_option_qty/{$optionId}");
100
  }
101
- if (null === $_qty) {
102
- $_qty = !($_selection->getSelectionQty() * 1) ? '1' : $_selection->getSelectionQty() * 1;
103
  }
104
 
105
  $valueNode = $optionNode->addChild('value');
106
- $valueNode->addAttribute('code', $_selection->getSelectionId());
107
- $valueNode->addAttribute('label', $optionsXmlObj->escapeXml($_selection->getName()));
108
- if (!$_option->isMultiSelection()) {
109
- if ($_selection->getSelectionCanChangeQty()) {
110
  $valueNode->addAttribute('is_qty_editable', 1);
111
  }
112
  }
113
- $valueNode->addAttribute('qty', $_qty);
114
 
115
- $price = $product->getPriceModel()->getSelectionPreFinalPrice($product, $_selection);
116
  $price = Mage::helper('xmlconnect')->formatPriceForXml($price);
117
  if ((float)$price != 0.00) {
118
  $valueNode->addAttribute('price', Mage::helper('xmlconnect')->formatPriceForXml(
@@ -123,7 +123,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne
123
 
124
  if ($product->hasPreconfiguredValues()) {
125
  $this->_setCartSelectedValue($valueNode, $type, $this->_getPreconfiguredOption(
126
- $optionData, $optionId, $_selection->getSelectionId()
127
  ));
128
  }
129
  }
66
  return $isObject ? $xmlModel : $xmlModel->asNiceXml();
67
  }
68
 
69
+ foreach ($bundleOptions as $option) {
70
+ $selections = $option->getSelections();
71
+ $optionId = $option->getOptionId();
72
  if (empty($selections)) {
73
  continue;
74
  }
76
  $optionNode = $optionsXmlObj->addChild('option');
77
 
78
  $type = parent::OPTION_TYPE_SELECT;
79
+ if ($option->isMultiSelection()) {
80
  $type = parent::OPTION_TYPE_CHECKBOX;
81
  }
82
+ $code = 'bundle_option[' . $option->getId() . ']';
83
  if ($type == parent::OPTION_TYPE_CHECKBOX) {
84
  $code .= '[]';
85
  }
86
  $optionNode->addAttribute('code', $code);
87
  $optionNode->addAttribute('type', $type);
88
+ $optionNode->addAttribute('label', $optionsXmlObj->escapeXml($option->getTitle()));
89
+ if ($option->getRequired()) {
90
  $optionNode->addAttribute('is_required', 1);
91
  }
92
 
93
+ foreach ($selections as $selection) {
94
+ if (!$selection->isSaleable()) {
95
  continue;
96
  }
97
+ $qty = null;
98
  if ($product->hasPreconfiguredValues()) {
99
+ $qty = $product->getPreconfiguredValues()->getData("bundle_option_qty/{$optionId}");
100
  }
101
+ if (null === $qty) {
102
+ $qty = !($selection->getSelectionQty() * 1) ? '1' : $selection->getSelectionQty() * 1;
103
  }
104
 
105
  $valueNode = $optionNode->addChild('value');
106
+ $valueNode->addAttribute('code', $selection->getSelectionId());
107
+ $valueNode->addAttribute('label', $optionsXmlObj->escapeXml($selection->getName()));
108
+ if (!$option->isMultiSelection()) {
109
+ if ($selection->getSelectionCanChangeQty()) {
110
  $valueNode->addAttribute('is_qty_editable', 1);
111
  }
112
  }
113
+ $valueNode->addAttribute('qty', $qty);
114
 
115
+ $price = $product->getPriceModel()->getSelectionPreFinalPrice($product, $selection);
116
  $price = Mage::helper('xmlconnect')->formatPriceForXml($price);
117
  if ((float)$price != 0.00) {
118
  $valueNode->addAttribute('price', Mage::helper('xmlconnect')->formatPriceForXml(
123
 
124
  if ($product->hasPreconfiguredValues()) {
125
  $this->_setCartSelectedValue($valueNode, $type, $this->_getPreconfiguredOption(
126
+ $optionData, $optionId, $selection->getSelectionId()
127
  ));
128
  }
129
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php CHANGED
@@ -57,28 +57,28 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm
57
  /**
58
  * Configurable attributes
59
  */
60
- $_attributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
61
- if (!sizeof($_attributes)) {
62
  return $isObject ? $xmlModel : $xmlModel->asNiceXml();
63
  }
64
 
65
- $_allowProducts = array();
66
- $_allProducts = $product->getTypeInstance(true)->getUsedProducts(null, $product);
67
- foreach ($_allProducts as $_product) {
68
- if ($_product->isSaleable()) {
69
- $_allowProducts[] = $_product;
70
  }
71
  }
72
 
73
  /**
74
  * Allowed products options
75
  */
76
- foreach ($_allowProducts as $_item) {
77
- $_productId = $_item->getId();
78
 
79
- foreach ($_attributes as $attribute) {
80
  $productAttribute = $attribute->getProductAttribute();
81
- $attributeValue = $_item->getData($productAttribute->getAttributeCode());
82
  if (!isset($options[$productAttribute->getId()])) {
83
  $options[$productAttribute->getId()] = array();
84
  }
@@ -86,11 +86,11 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm
86
  if (!isset($options[$productAttribute->getId()][$attributeValue])) {
87
  $options[$productAttribute->getId()][$attributeValue] = array();
88
  }
89
- $options[$productAttribute->getId()][$attributeValue][] = $_productId;
90
  }
91
  }
92
 
93
- foreach ($_attributes as $attribute) {
94
  $productAttribute = $attribute->getProductAttribute();
95
  $attributeId = $productAttribute->getId();
96
  $info = array(
@@ -129,8 +129,8 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm
129
 
130
  $isFirst = true;
131
 
132
- $_attributes = $attributes;
133
- reset($_attributes);
134
  foreach ($attributes as $id => $attribute) {
135
  $optionNode = $optionsXmlObj->addChild('option');
136
  $optionNode->addAttribute('code', 'super_attribute[' . $id . ']');
@@ -146,8 +146,8 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm
146
  $valueNode->addAttribute('price', $option['price']);
147
  $valueNode->addAttribute('formated_price', $option['formated_price']);
148
  }
149
- if (sizeof($_attributes) > 1) {
150
- $this->_prepareRecursivelyRelatedValues($valueNode, $_attributes, $option['products'], 1);
151
  }
152
  if ($product->hasPreconfiguredValues()) {
153
  $this->_setCartSelectedValue($valueNode, 'select', $this->_getPreconfiguredOption(
@@ -194,21 +194,21 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm
194
  $relatedNode->addAttribute('to', 'super_attribute[' . $attrId . ']');
195
  }
196
 
197
- $_valueNode = $relatedNode->addChild('value');
198
- $_valueNode->addAttribute('code', $option['id']);
199
- $_valueNode->addAttribute('label', $_valueNode->escapeXml($option['label']));
200
  if ((float)$option['price'] != 0.00) {
201
- $_valueNode->addAttribute('price', $option['price']);
202
- $_valueNode->addAttribute('formated_price', $option['formated_price']);
203
  }
204
 
205
  /**
206
  * Recursive relation adding
207
  */
208
- $_attrClone = $attributes;
209
- if (next($_attrClone) != false) {
210
- reset($_attrClone);
211
- $this->_prepareRecursivelyRelatedValues($_valueNode, $_attrClone, $intersect, $cycle + 1);
212
  }
213
  }
214
  }
57
  /**
58
  * Configurable attributes
59
  */
60
+ $productAttributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
61
+ if (!sizeof($productAttributes)) {
62
  return $isObject ? $xmlModel : $xmlModel->asNiceXml();
63
  }
64
 
65
+ $allowProducts = array();
66
+ $allProducts = $product->getTypeInstance(true)->getUsedProducts(null, $product);
67
+ foreach ($allProducts as $productItem) {
68
+ if ($productItem->isSaleable()) {
69
+ $allowProducts[] = $productItem;
70
  }
71
  }
72
 
73
  /**
74
  * Allowed products options
75
  */
76
+ foreach ($allowProducts as $item) {
77
+ $productId = $item->getId();
78
 
79
+ foreach ($productAttributes as $attribute) {
80
  $productAttribute = $attribute->getProductAttribute();
81
+ $attributeValue = $item->getData($productAttribute->getAttributeCode());
82
  if (!isset($options[$productAttribute->getId()])) {
83
  $options[$productAttribute->getId()] = array();
84
  }
86
  if (!isset($options[$productAttribute->getId()][$attributeValue])) {
87
  $options[$productAttribute->getId()][$attributeValue] = array();
88
  }
89
+ $options[$productAttribute->getId()][$attributeValue][] = $productId;
90
  }
91
  }
92
 
93
+ foreach ($productAttributes as $attribute) {
94
  $productAttribute = $attribute->getProductAttribute();
95
  $attributeId = $productAttribute->getId();
96
  $info = array(
129
 
130
  $isFirst = true;
131
 
132
+ $productAttributes = $attributes;
133
+ reset($productAttributes);
134
  foreach ($attributes as $id => $attribute) {
135
  $optionNode = $optionsXmlObj->addChild('option');
136
  $optionNode->addAttribute('code', 'super_attribute[' . $id . ']');
146
  $valueNode->addAttribute('price', $option['price']);
147
  $valueNode->addAttribute('formated_price', $option['formated_price']);
148
  }
149
+ if (sizeof($productAttributes) > 1) {
150
+ $this->_prepareRecursivelyRelatedValues($valueNode, $productAttributes, $option['products'], 1);
151
  }
152
  if ($product->hasPreconfiguredValues()) {
153
  $this->_setCartSelectedValue($valueNode, 'select', $this->_getPreconfiguredOption(
194
  $relatedNode->addAttribute('to', 'super_attribute[' . $attrId . ']');
195
  }
196
 
197
+ $nodeValue = $relatedNode->addChild('value');
198
+ $nodeValue->addAttribute('code', $option['id']);
199
+ $nodeValue->addAttribute('label', $nodeValue->escapeXml($option['label']));
200
  if ((float)$option['price'] != 0.00) {
201
+ $nodeValue->addAttribute('price', $option['price']);
202
+ $nodeValue->addAttribute('formated_price', $option['formated_price']);
203
  }
204
 
205
  /**
206
  * Recursive relation adding
207
  */
208
+ $attrClone = $attributes;
209
+ if (next($attrClone) != false) {
210
+ reset($attrClone);
211
+ $this->_prepareRecursivelyRelatedValues($nodeValue, $attrClone, $intersect, $cycle + 1);
212
  }
213
  }
214
  }
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php CHANGED
@@ -55,30 +55,30 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Grouped extends Mage_XmlConn
55
  /**
56
  * Grouped (associated) products
57
  */
58
- $_associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
59
- if (!sizeof($_associatedProducts)) {
60
  return $isObject ? $xmlModel : $xmlModel->asNiceXml();
61
  }
62
 
63
- foreach ($_associatedProducts as $_item) {
64
- if (!$_item->isSaleable()) {
65
  continue;
66
  }
67
  $optionNode = $optionsNode->addChild('option');
68
 
69
- $optionNode->addAttribute('code', 'super_group[' . $_item->getId() . ']');
70
  $optionNode->addAttribute('type', 'product');
71
- $optionNode->addAttribute('label', $xmlModel->escapeXml($_item->getName()));
72
  $optionNode->addAttribute('is_qty_editable', 1);
73
- $optionNode->addAttribute('qty', $_item->getQty()*1);
74
 
75
  /**
76
  * Process product price
77
  */
78
- if ($_item->getPrice() != $_item->getFinalPrice()) {
79
- $productPrice = $_item->getFinalPrice();
80
  } else {
81
- $productPrice = $_item->getPrice();
82
  }
83
 
84
  if ($productPrice != 0) {
55
  /**
56
  * Grouped (associated) products
57
  */
58
+ $associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
59
+ if (!sizeof($associatedProducts)) {
60
  return $isObject ? $xmlModel : $xmlModel->asNiceXml();
61
  }
62
 
63
+ foreach ($associatedProducts as $item) {
64
+ if (!$item->isSaleable()) {
65
  continue;
66
  }
67
  $optionNode = $optionsNode->addChild('option');
68
 
69
+ $optionNode->addAttribute('code', 'super_group[' . $item->getId() . ']');
70
  $optionNode->addAttribute('type', 'product');
71
+ $optionNode->addAttribute('label', $xmlModel->escapeXml($item->getName()));
72
  $optionNode->addAttribute('is_qty_editable', 1);
73
+ $optionNode->addAttribute('qty', $item->getQty()*1);
74
 
75
  /**
76
  * Process product price
77
  */
78
+ if ($item->getPrice() != $item->getFinalPrice()) {
79
+ $productPrice = $item->getFinalPrice();
80
  } else {
81
+ $productPrice = $item->getPrice();
82
  }
83
 
84
  if ($productPrice != 0) {
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php CHANGED
@@ -39,9 +39,9 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo
39
  * @param Mage_Catalog_Model_Product $product
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');
39
  * @param Mage_Catalog_Model_Product $product
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $item
41
  */
42
+ public function collectProductPrices(Mage_Catalog_Model_Product $product,
43
+ Mage_XmlConnect_Model_Simplexml_Element $item)
44
+ {
45
  $this->setProduct($product)->setDisplayMinimalPrice(true)->setUseLinkForAsLowAs(false);
46
 
47
  $priceXmlObj = $item->addChild('price');
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php CHANGED
@@ -39,321 +39,321 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B
39
  * @param Mage_Catalog_Model_Product $product
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);
49
- if (count($_tierPrices) > 0) {
50
  $tierPricesTextArray = $item->escapeXml(implode(
51
- PHP_EOL, $this->_getTierPricesTextArray($_tierPrices, $product)
52
  ));
53
  $item->addCustomChild('price_tier', $tierPricesTextArray);
54
  }
55
 
56
- /** @var $_coreHelper Mage_Core_Helper_Data */
57
- $_coreHelper = $this->helper('core');
58
- /** @var $_weeeHelper Mage_Weee_Helper_Data */
59
- $_weeeHelper = $this->helper('weee');
60
- /** @var $_taxHelper Mage_Tax_Helper_Data */
61
- $_taxHelper = $this->helper('tax');
62
 
63
- $_simplePricesTax = ($_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices());
64
- $_minimalPriceValue = $product->getMinimalPrice();
65
- $_minimalPrice = $_taxHelper->getPrice($product, $_minimalPriceValue, $_simplePricesTax);
66
 
67
  if (!$product->isGrouped()) {
68
- $_weeeTaxAmount = $_weeeHelper->getAmountForDisplay($product);
69
- if ($_weeeHelper->typeOfDisplay($product, array(1, 2, 4))) {
70
- $_weeeTaxAmount = $_weeeHelper->getAmount($product);
71
- $_weeeTaxAttributes = $_weeeHelper->getProductWeeeAttributesForDisplay($product);
72
  }
73
 
74
- $_price = $_taxHelper->getPrice($product, $product->getPrice());
75
- $_regularPrice = $_taxHelper->getPrice($product, $product->getPrice(), $_simplePricesTax);
76
- $_finalPrice = $_taxHelper->getPrice($product, $product->getFinalPrice());
77
- $_finalPriceInclTax = $_taxHelper->getPrice($product, $product->getFinalPrice(), true);
78
- $_weeeHelper->getPriceDisplayType();
79
- if ($_finalPrice == $_price) {
80
- if ($_taxHelper->displayBothPrices()) {
81
  /**
82
  * Including
83
  */
84
- if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 0)) {
85
  $priceXmlObj->addAttribute(
86
- 'excluding_tax', $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
87
  );
88
  $priceXmlObj->addAttribute(
89
- 'including_tax', $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmount, true, false)
90
  );
91
- } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 1)) {
92
  /**
93
  * Including + Weee
94
  */
95
  $priceXmlObj->addAttribute(
96
- 'excluding_tax', $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
97
  );
98
  $priceXmlObj->addAttribute(
99
- 'including_tax', $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmount, true, false)
100
  );
101
  $weeeXmlObj = $priceXmlObj->addChild('weee');
102
- $_weeeSeparator = ' + ';
103
- $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
104
- foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
105
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
106
  $weeeItemXmlObj->addAttribute(
107
- 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
108
  );
109
  $weeeItemXmlObj->addAttribute(
110
- 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
111
  );
112
  }
113
- } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 4)) {
114
  /**
115
  * Including + Weee
116
  */
117
  $priceXmlObj->addAttribute(
118
- 'excluding_tax', $_coreHelper->currency($_price + $_weeeTaxAmount, true, false)
119
  );
120
  $priceXmlObj->addAttribute(
121
- 'including_tax', $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmount, true, false)
122
  );
123
  $weeeXmlObj = $priceXmlObj->addChild('weee');
124
- $_weeeSeparator = ' + ';
125
- $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
126
- foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
127
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
128
  $weeeItemXmlObj->addAttribute(
129
- 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
130
  );
131
- $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency(
132
- $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false
133
  ));
134
  }
135
- } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 2)) {
136
  /**
137
  * Excluding + Weee + Final
138
  */
139
- $priceXmlObj->addAttribute('excluding_tax', $_coreHelper->currency($_price, true, false));
140
  $weeeXmlObj = $priceXmlObj->addChild('weee');
141
- foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
142
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
143
  $weeeItemXmlObj->addAttribute(
144
- 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
145
  );
146
  $weeeItemXmlObj->addAttribute(
147
- 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
148
  );
149
  }
150
- $priceXmlObj->addAttribute('including_tax', $_coreHelper->currency(
151
- $_finalPriceInclTax + $_weeeTaxAmount, true, false
152
  ));
153
  } else {
154
- $priceXmlObj->addAttribute('excluding_tax', $_coreHelper->currency($_price, true, false));
155
  $priceXmlObj->addAttribute(
156
- 'including_tax', $_coreHelper->currency($_finalPriceInclTax, true, false)
157
  );
158
  }
159
  /**
160
- * if ($_taxHelper->displayBothPrices()) {
161
  */
162
  } else {
163
  /**
164
  * Including
165
  */
166
- if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 0)) {
167
- $priceXmlObj->addAttribute('regular', $_coreHelper->currency(
168
- $_price + $_weeeTaxAmount, true, false
169
  ));
170
- } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 1)) {
171
  /**
172
  * Including + Weee
173
  */
174
- $priceXmlObj->addAttribute('regular', $_coreHelper->currency(
175
- $_price + $_weeeTaxAmount, true, false
176
  ));
177
  $weeeXmlObj = $priceXmlObj->addChild('weee');
178
- $_weeeSeparator = ' + ';
179
- $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
180
- foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
181
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
182
  $weeeItemXmlObj->addAttribute(
183
- 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
184
  );
185
  $weeeItemXmlObj->addAttribute(
186
- 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false)
187
  );
188
  }
189
- } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 4)) {
190
  /**
191
  * Including + Weee
192
  */
193
- $priceXmlObj->addAttribute('regular', $_coreHelper->currency(
194
- $_price + $_weeeTaxAmount, true, false
195
  ));
196
  $weeeXmlObj = $priceXmlObj->addChild('weee');
197
- $_weeeSeparator = ' + ';
198
- $weeeXmlObj->addAttribute('separator', $_weeeSeparator);
199
- foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) {
200
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
201
  $weeeItemXmlObj->addAttribute(
202
- 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName())
203
  );
204
- $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency(
205
- $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false
206
  ));
207
  }
208
- } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, 2)) {
209
  /**
210
  * Excluding + Weee + Final
211
  */
212
- $priceXmlObj->addAttribute('regular', $_coreHelper->currency($_price, true, false));
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
  /**
231
- * if ($_finalPrice == $_price) {
232
  */
233
  } else {
234
- $_originalWeeeTaxAmount = $_weeeHelper->getOriginalAmount($product);
235
  /**
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
  }
343
  }
344
 
345
- if ($this->getDisplayMinimalPrice() && $_minimalPriceValue
346
- && $_minimalPriceValue < $product->getFinalPrice()
347
  ) {
348
- $_minimalPriceDisplayValue = $_minimalPrice;
349
 
350
- if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($product, array(0, 1, 4))) {
351
- $_minimalPriceDisplayValue = $_minimalPrice + $_weeeTaxAmount;
352
  }
353
 
354
  if (!$this->getUseLinkForAsLowAs()) {
355
- $priceXmlObj->addAttribute('as_low_as', $_coreHelper->currency(
356
- $_minimalPriceDisplayValue, true, false
357
  ));
358
  }
359
  }
@@ -361,23 +361,23 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B
361
  * if (!$product->isGrouped()) {
362
  */
363
  } else {
364
- $_exclTax = $_taxHelper->getPrice($product, $_minimalPriceValue, null);
365
- $_inclTax = $_taxHelper->getPrice($product, $_minimalPriceValue, true);
366
 
367
- if ($this->getDisplayMinimalPrice() && $_minimalPriceValue) {
368
- if ($_taxHelper->displayBothPrices()) {
369
- $priceXmlObj->addAttribute('starting_at_excluding_tax', $_coreHelper->currency(
370
- $_exclTax, true, false
371
  ));
372
- $priceXmlObj->addAttribute('starting_at_including_tax', $_coreHelper->currency(
373
- $_inclTax, true, false
374
  ));
375
  } else {
376
- $_showPrice = $_inclTax;
377
- if (!$_taxHelper->displayPriceIncludingTax()) {
378
- $_showPrice = $_exclTax;
379
  }
380
- $priceXmlObj->addAttribute('starting_at', $_coreHelper->currency($_showPrice, true, false));
381
  }
382
  }
383
  }
@@ -443,169 +443,169 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B
443
  /**
444
  * Get tier prices (formatted) as array of strings
445
  *
446
- * @param array $_tierPrices
447
- * @param Mage_Catalog_Model_Product $_product
448
  * @return array
449
  */
450
- protected function _getTierPricesTextArray($_tierPrices, $_product)
451
  {
452
  $pricesArray = array();
453
- if (Mage::helper('weee')->typeOfDisplay($_product, array(1, 2, 4))) {
454
- $_weeeTaxAttributes = Mage::helper('weee')->getProductWeeeAttributesForDisplay($_product);
455
  }
456
 
457
- if ($_product->isGrouped()) {
458
- $_tierPrices = $this->getTierPrices($_product);
459
  }
460
- Mage::helper('weee')->processTierPrices($_product, $_tierPrices);
461
 
462
- foreach ($_tierPrices as $_price) {
463
  $s = '';
464
  if ($this->helper('tax')->displayBothPrices()) {
465
- if (Mage::helper('weee')->typeOfDisplay($_product, 0)) {
466
- $s .= $this->__('Buy %1$s for %2$s (%3$s incl. tax) each', $_price['price_qty'], $_price['formated_price_incl_weee_only'], $_price['formated_price_incl_weee']);
467
- } else if (Mage::helper('weee')->typeOfDisplay($_product, 1)) {
468
- $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']);
469
- if ($_weeeTaxAttributes) {
470
- $s .= ' (' . $this->__('%1$s incl tax.', $_price['formated_price_incl_weee']);
471
  $separator = ' + ';
472
- foreach ($_weeeTaxAttributes as $_attribute) {
473
- $s .= $separator . $_attribute->getName() . ': ';
474
- $s .= Mage::helper('core')->currency($_attribute->getAmount());
475
  }
476
  $s .= ')';
477
  }
478
  $s .= ' ' . $this->__('each');
479
- } else if (Mage::helper('weee')->typeOfDisplay($_product, 4)) {
480
- $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']);
481
- if ($_weeeTaxAttributes) {
482
- $s .= ' (' . $this->__('%1$s incl tax.', $_price['formated_price_incl_weee']);
483
  $separator = ' + ';
484
- foreach ($_weeeTaxAttributes as $_attribute) {
485
- $s .= $separator . $_attribute->getName() . ': ';
486
  $s .= Mage::helper('core')->currency(
487
- $_attribute->getAmount() + $_attribute->getTaxAmount()
488
  );
489
  }
490
  $s .= ')';
491
  }
492
  $s .= ' ' . $this->__('each');
493
- } else if (Mage::helper('weee')->typeOfDisplay($_product, 2)) {
494
- $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price']);
495
- if ($_weeeTaxAttributes) {
496
  $s .= ' (';
497
- foreach ($_weeeTaxAttributes as $_attribute) {
498
- $s .= $_attribute->getName() . ': ';
499
- $s .= Mage::helper('core')->currency($_attribute->getAmount());
500
  }
501
- $s .= ' ' . $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee']) . ')';
502
  }
503
  $s .= ' ' . $this->__('each');
504
  } else {
505
- $s .= $this->__('Buy %1$s for %2$s (%3$s incl. tax) each', $_price['price_qty'], $_price['formated_price'], $_price['formated_price_incl_tax']);
506
  }
507
  } else {
508
  if ($this->helper('tax')->displayPriceIncludingTax()) {
509
- if (Mage::helper('weee')->typeOfDisplay($_product, 0)) {
510
- $s .= $this->__('Buy %1$s for %2$s each', $_price['price_qty'], $_price['formated_price_incl_weee']);
511
- } else if (Mage::helper('weee')->typeOfDisplay($_product, 1)) {
512
- $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee']);
513
- if ($_weeeTaxAttributes) {
514
  $s .= ' (';
515
  $separator = '';
516
- foreach ($_weeeTaxAttributes as $_attribute) {
517
- $s .= $separator . $_attribute->getName() . ': ';
518
- $s .= Mage::helper('core')->currency($_attribute->getAmount());
519
  $separator = ' + ';
520
  }
521
  $s .= ')';
522
  }
523
  $s .= ' ' . $this->__('each');
524
- } else if (Mage::helper('weee')->typeOfDisplay($_product, 4)) {
525
- $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee']);
526
- if ($_weeeTaxAttributes) {
527
  $s .= ' (';
528
  $separator = '';
529
- foreach ($_weeeTaxAttributes as $_attribute) {
530
- $s .= $separator . $_attribute->getName() . ': ';
531
  $s .= Mage::helper('core')->currency(
532
- $_attribute->getAmount() + $_attribute->getTaxAmount()
533
  );
534
  $separator = ' + ';
535
  }
536
  $s .= ')';
537
  }
538
  $s .= ' ' . $this->__('each');
539
- } else if (Mage::helper('weee')->typeOfDisplay($_product, 2)) {
540
- $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_tax']);
541
- if ($_weeeTaxAttributes) {
542
  $s .= ' (';
543
- foreach ($_weeeTaxAttributes as $_attribute) {
544
- $s .= $_attribute->getName() . ': ';
545
- $s .= Mage::helper('core')->currency($_attribute->getAmount());
546
  }
547
- $s .= ' ' . $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee']) . ')';
548
  }
549
  $s .= ' ' . $this->__('each');
550
  } else {
551
- $s .= $this->__('Buy %1$s for %2$s each', $_price['price_qty'], $_price['formated_price_incl_tax']);
552
  }
553
  } else {
554
- if (Mage::helper('weee')->typeOfDisplay($_product, 0)) {
555
- $s .= $this->__('Buy %1$s for %2$s each', $_price['price_qty'], $_price['formated_price_incl_weee_only']);
556
- } else if (Mage::helper('weee')->typeOfDisplay($_product, 1)) {
557
- $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']);
558
- if ($_weeeTaxAttributes) {
559
  $s .= ' (';
560
  $separator = '';
561
- foreach ($_weeeTaxAttributes as $_attribute) {
562
- $s .= $separator . $_attribute->getName() . ': ';
563
- $s .= Mage::helper('core')->currency($_attribute->getAmount());
564
  $separator = ' + ';
565
  }
566
  $s .= ')';
567
  }
568
  $s .= ' ' . $this->__('each');
569
- } else if (Mage::helper('weee')->typeOfDisplay($_product, 4)) {
570
- $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']);
571
- if ($_weeeTaxAttributes) {
572
  $s .= ' (';
573
  $separator = '';
574
- foreach ($_weeeTaxAttributes as $_attribute) {
575
- $s .= $separator . $_attribute->getName() . ': ';
576
  $s .= Mage::helper('core')->currency(
577
- $_attribute->getAmount() + $_attribute->getTaxAmount()
578
  );
579
  $separator = ' + ';
580
  }
581
  $s .= ')';
582
  }
583
  $s .= ' ' . $this->__('each');
584
- } else if (Mage::helper('weee')->typeOfDisplay($_product, 2)) {
585
- $s .= $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price']);
586
- if ($_weeeTaxAttributes) {
587
  $s .= ' (';
588
- foreach ($_weeeTaxAttributes as $_attribute) {
589
- $s .= $_attribute->getName() . ': ';
590
- $s .= Mage::helper('core')->currency($_attribute->getAmount());
591
  }
592
- $s .= ' ' . $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee_only']) . ')';
593
  }
594
  $s .= ' ' . $this->__('each');
595
  } else {
596
- $s .= $this->__('Buy %1$s for %2$s each', $_price['price_qty'], $_price['formated_price']);
597
  }
598
  }
599
  }
600
- if (!$_product->isGrouped()) {
601
- $condition1 = ($_product->getPrice() == $_product->getFinalPrice()
602
- && $_product->getPrice() > $_price['price']);
603
 
604
- $condition2 = ($_product->getPrice() != $_product->getFinalPrice()
605
- && $_product->getFinalPrice() > $_price['price']);
606
 
607
  if ($condition1 || $condition2) {
608
- $s .= ' ' . $this->__('and') . ' ' . $this->__('save') . ' ' . $_price['savePercent'] . '%';
609
  }
610
  }
611
  $pricesArray[] = $s;
39
  * @param Mage_Catalog_Model_Product $product
40
  * @param Mage_XmlConnect_Model_Simplexml_Element $item
41
  */
42
+ public function collectProductPrices(Mage_Catalog_Model_Product $product,
43
+ 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);
49
+ if (count($tierPrices) > 0) {
50
  $tierPricesTextArray = $item->escapeXml(implode(
51
+ PHP_EOL, $this->_getTierPricesTextArray($tierPrices, $product)
52
  ));
53
  $item->addCustomChild('price_tier', $tierPricesTextArray);
54
  }
55
 
56
+ /** @var $coreHelper Mage_Core_Helper_Data */
57
+ $coreHelper = $this->helper('core');
58
+ /** @var $weeeHelper Mage_Weee_Helper_Data */
59
+ $weeeHelper = $this->helper('weee');
60
+ /** @var $taxHelper Mage_Tax_Helper_Data */
61
+ $taxHelper = $this->helper('tax');
62
 
63
+ $simplePricesTax = ($taxHelper->displayPriceIncludingTax() || $taxHelper->displayBothPrices());
64
+ $minimalPriceValue = $product->getMinimalPrice();
65
+ $minimalPrice = $taxHelper->getPrice($product, $minimalPriceValue, $simplePricesTax);
66
 
67
  if (!$product->isGrouped()) {
68
+ $weeeTaxAmount = $weeeHelper->getAmountForDisplay($product);
69
+ if ($weeeHelper->typeOfDisplay($product, array(1, 2, 4))) {
70
+ $weeeTaxAmount = $weeeHelper->getAmount($product);
71
+ $weeeTaxAttributes = $weeeHelper->getProductWeeeAttributesForDisplay($product);
72
  }
73
 
74
+ $price = $taxHelper->getPrice($product, $product->getPrice());
75
+ $regularPrice = $taxHelper->getPrice($product, $product->getPrice(), $simplePricesTax);
76
+ $finalPrice = $taxHelper->getPrice($product, $product->getFinalPrice());
77
+ $finalPriceInclTax = $taxHelper->getPrice($product, $product->getFinalPrice(), true);
78
+ $weeeHelper->getPriceDisplayType();
79
+ if ($finalPrice == $price) {
80
+ if ($taxHelper->displayBothPrices()) {
81
  /**
82
  * Including
83
  */
84
+ if ($weeeTaxAmount && $weeeHelper->typeOfDisplay($product, 0)) {
85
  $priceXmlObj->addAttribute(
86
+ 'excluding_tax', $coreHelper->currency($price + $weeeTaxAmount, true, false)
87
  );
88
  $priceXmlObj->addAttribute(
89
+ 'including_tax', $coreHelper->currency($finalPriceInclTax + $weeeTaxAmount, true, false)
90
  );
91
+ } elseif ($weeeTaxAmount && $weeeHelper->typeOfDisplay($product, 1)) {
92
  /**
93
  * Including + Weee
94
  */
95
  $priceXmlObj->addAttribute(
96
+ 'excluding_tax', $coreHelper->currency($price + $weeeTaxAmount, true, false)
97
  );
98
  $priceXmlObj->addAttribute(
99
+ 'including_tax', $coreHelper->currency($finalPriceInclTax + $weeeTaxAmount, true, false)
100
  );
101
  $weeeXmlObj = $priceXmlObj->addChild('weee');
102
+ $weeeSeparator = ' + ';
103
+ $weeeXmlObj->addAttribute('separator', $weeeSeparator);
104
+ foreach ($weeeTaxAttributes as $weeeTaxAttribute) {
105
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
106
  $weeeItemXmlObj->addAttribute(
107
+ 'name', $weeeItemXmlObj->escapeXml($weeeTaxAttribute->getName())
108
  );
109
  $weeeItemXmlObj->addAttribute(
110
+ 'amount', $coreHelper->currency($weeeTaxAttribute->getAmount(), true, false)
111
  );
112
  }
113
+ } elseif ($weeeTaxAmount && $weeeHelper->typeOfDisplay($product, 4)) {
114
  /**
115
  * Including + Weee
116
  */
117
  $priceXmlObj->addAttribute(
118
+ 'excluding_tax', $coreHelper->currency($price + $weeeTaxAmount, true, false)
119
  );
120
  $priceXmlObj->addAttribute(
121
+ 'including_tax', $coreHelper->currency($finalPriceInclTax + $weeeTaxAmount, true, false)
122
  );
123
  $weeeXmlObj = $priceXmlObj->addChild('weee');
124
+ $weeeSeparator = ' + ';
125
+ $weeeXmlObj->addAttribute('separator', $weeeSeparator);
126
+ foreach ($weeeTaxAttributes as $weeeTaxAttribute) {
127
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
128
  $weeeItemXmlObj->addAttribute(
129
+ 'name', $weeeItemXmlObj->escapeXml($weeeTaxAttribute->getName())
130
  );
131
+ $weeeItemXmlObj->addAttribute('amount', $coreHelper->currency(
132
+ $weeeTaxAttribute->getAmount() + $weeeTaxAttribute->getTaxAmount(), true, false
133
  ));
134
  }
135
+ } elseif ($weeeTaxAmount && $weeeHelper->typeOfDisplay($product, 2)) {
136
  /**
137
  * Excluding + Weee + Final
138
  */
139
+ $priceXmlObj->addAttribute('excluding_tax', $coreHelper->currency($price, true, false));
140
  $weeeXmlObj = $priceXmlObj->addChild('weee');
141
+ foreach ($weeeTaxAttributes as $weeeTaxAttribute) {
142
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
143
  $weeeItemXmlObj->addAttribute(
144
+ 'name', $weeeItemXmlObj->escapeXml($weeeTaxAttribute->getName())
145
  );
146
  $weeeItemXmlObj->addAttribute(
147
+ 'amount', $coreHelper->currency($weeeTaxAttribute->getAmount(), true, false)
148
  );
149
  }
150
+ $priceXmlObj->addAttribute('including_tax', $coreHelper->currency(
151
+ $finalPriceInclTax + $weeeTaxAmount, true, false
152
  ));
153
  } else {
154
+ $priceXmlObj->addAttribute('excluding_tax', $coreHelper->currency($price, true, false));
155
  $priceXmlObj->addAttribute(
156
+ 'including_tax', $coreHelper->currency($finalPriceInclTax, true, false)
157
  );
158
  }
159
  /**
160
+ * if ($taxHelper->displayBothPrices()) {
161
  */
162
  } else {
163
  /**
164
  * Including
165
  */
166
+ if ($weeeTaxAmount && $weeeHelper->typeOfDisplay($product, 0)) {
167
+ $priceXmlObj->addAttribute('regular', $coreHelper->currency(
168
+ $price + $weeeTaxAmount, true, false
169
  ));
170
+ } elseif ($weeeTaxAmount && $weeeHelper->typeOfDisplay($product, 1)) {
171
  /**
172
  * Including + Weee
173
  */
174
+ $priceXmlObj->addAttribute('regular', $coreHelper->currency(
175
+ $price + $weeeTaxAmount, true, false
176
  ));
177
  $weeeXmlObj = $priceXmlObj->addChild('weee');
178
+ $weeeSeparator = ' + ';
179
+ $weeeXmlObj->addAttribute('separator', $weeeSeparator);
180
+ foreach ($weeeTaxAttributes as $weeeTaxAttribute) {
181
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
182
  $weeeItemXmlObj->addAttribute(
183
+ 'name', $weeeItemXmlObj->escapeXml($weeeTaxAttribute->getName())
184
  );
185
  $weeeItemXmlObj->addAttribute(
186
+ 'amount', $coreHelper->currency($weeeTaxAttribute->getAmount(), true, false)
187
  );
188
  }
189
+ } elseif ($weeeTaxAmount && $weeeHelper->typeOfDisplay($product, 4)) {
190
  /**
191
  * Including + Weee
192
  */
193
+ $priceXmlObj->addAttribute('regular', $coreHelper->currency(
194
+ $price + $weeeTaxAmount, true, false
195
  ));
196
  $weeeXmlObj = $priceXmlObj->addChild('weee');
197
+ $weeeSeparator = ' + ';
198
+ $weeeXmlObj->addAttribute('separator', $weeeSeparator);
199
+ foreach ($weeeTaxAttributes as $weeeTaxAttribute) {
200
  $weeeItemXmlObj = $weeeXmlObj->addChild('item');
201
  $weeeItemXmlObj->addAttribute(
202
+ 'name', $weeeItemXmlObj->escapeXml($weeeTaxAttribute->getName())
203
  );
204
+ $weeeItemXmlObj->addAttribute('amount', $coreHelper->currency(
205
+ $weeeTaxAttribute->getAmount() + $weeeTaxAttribute->getTaxAmount(), true, false
206
  ));
207
  }
208
+ } elseif ($weeeTaxAmount && $weeeHelper->typeOfDisplay($product, 2)) {
209
  /**
210
  * Excluding + Weee + Final
211
  */
212
+ $priceXmlObj->addAttribute('regular', $coreHelper->currency($price, true, false));
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
  /**
231
+ * if ($finalPrice == $price) {
232
  */
233
  } else {
234
+ $originalWeeeTaxAmount = $weeeHelper->getOriginalAmount($product);
235
  /**
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
  }
343
  }
344
 
345
+ if ($this->getDisplayMinimalPrice() && $minimalPriceValue
346
+ && $minimalPriceValue < $product->getFinalPrice()
347
  ) {
348
+ $minimalPriceDisplayValue = $minimalPrice;
349
 
350
+ if ($weeeTaxAmount && $weeeHelper->typeOfDisplay($product, array(0, 1, 4))) {
351
+ $minimalPriceDisplayValue = $minimalPrice + $weeeTaxAmount;
352
  }
353
 
354
  if (!$this->getUseLinkForAsLowAs()) {
355
+ $priceXmlObj->addAttribute('as_low_as', $coreHelper->currency(
356
+ $minimalPriceDisplayValue, true, false
357
  ));
358
  }
359
  }
361
  * if (!$product->isGrouped()) {
362
  */
363
  } else {
364
+ $exclTax = $taxHelper->getPrice($product, $minimalPriceValue, null);
365
+ $inclTax = $taxHelper->getPrice($product, $minimalPriceValue, true);
366
 
367
+ if ($this->getDisplayMinimalPrice() && $minimalPriceValue) {
368
+ if ($taxHelper->displayBothPrices()) {
369
+ $priceXmlObj->addAttribute('starting_at_excluding_tax', $coreHelper->currency(
370
+ $exclTax, true, false
371
  ));
372
+ $priceXmlObj->addAttribute('starting_at_including_tax', $coreHelper->currency(
373
+ $inclTax, true, false
374
  ));
375
  } else {
376
+ $showPrice = $inclTax;
377
+ if (!$taxHelper->displayPriceIncludingTax()) {
378
+ $showPrice = $exclTax;
379
  }
380
+ $priceXmlObj->addAttribute('starting_at', $coreHelper->currency($showPrice, true, false));
381
  }
382
  }
383
  }
443
  /**
444
  * Get tier prices (formatted) as array of strings
445
  *
446
+ * @param array $tierPrices
447
+ * @param Mage_Catalog_Model_Product $product
448
  * @return array
449
  */
450
+ protected function _getTierPricesTextArray($tierPrices, $product)
451
  {
452
  $pricesArray = array();
453
+ if (Mage::helper('weee')->typeOfDisplay($product, array(1, 2, 4))) {
454
+ $weeeTaxAttributes = Mage::helper('weee')->getProductWeeeAttributesForDisplay($product);
455
  }
456
 
457
+ if ($product->isGrouped()) {
458
+ $tierPrices = $this->getTierPrices($product);
459
  }
460
+ Mage::helper('weee')->processTierPrices($product, $tierPrices);
461
 
462
+ foreach ($tierPrices as $price) {
463
  $s = '';
464
  if ($this->helper('tax')->displayBothPrices()) {
465
+ if (Mage::helper('weee')->typeOfDisplay($product, 0)) {
466
+ $s .= $this->__('Buy %1$s for %2$s (%3$s incl. tax) each', $price['price_qty'], $price['formated_price_incl_weee_only'], $price['formated_price_incl_weee']);
467
+ } else if (Mage::helper('weee')->typeOfDisplay($product, 1)) {
468
+ $s .= $this->__('Buy %1$s for %2$s', $price['price_qty'], $price['formated_price_incl_weee_only']);
469
+ if ($weeeTaxAttributes) {
470
+ $s .= ' (' . $this->__('%1$s incl tax.', $price['formated_price_incl_weee']);
471
  $separator = ' + ';
472
+ foreach ($weeeTaxAttributes as $attribute) {
473
+ $s .= $separator . $attribute->getName() . ': ';
474
+ $s .= Mage::helper('core')->currency($attribute->getAmount());
475
  }
476
  $s .= ')';
477
  }
478
  $s .= ' ' . $this->__('each');
479
+ } else if (Mage::helper('weee')->typeOfDisplay($product, 4)) {
480
+ $s .= $this->__('Buy %1$s for %2$s', $price['price_qty'], $price['formated_price_incl_weee_only']);
481
+ if ($weeeTaxAttributes) {
482
+ $s .= ' (' . $this->__('%1$s incl tax.', $price['formated_price_incl_weee']);
483
  $separator = ' + ';
484
+ foreach ($weeeTaxAttributes as $attribute) {
485
+ $s .= $separator . $attribute->getName() . ': ';
486
  $s .= Mage::helper('core')->currency(
487
+ $attribute->getAmount() + $attribute->getTaxAmount()
488
  );
489
  }
490
  $s .= ')';
491
  }
492
  $s .= ' ' . $this->__('each');
493
+ } else if (Mage::helper('weee')->typeOfDisplay($product, 2)) {
494
+ $s .= $this->__('Buy %1$s for %2$s', $price['price_qty'], $price['formated_price']);
495
+ if ($weeeTaxAttributes) {
496
  $s .= ' (';
497
+ foreach ($weeeTaxAttributes as $attribute) {
498
+ $s .= $attribute->getName() . ': ';
499
+ $s .= Mage::helper('core')->currency($attribute->getAmount());
500
  }
501
+ $s .= ' ' . $this->__('Total incl. Tax: %1$s', $price['formated_price_incl_weee']) . ')';
502
  }
503
  $s .= ' ' . $this->__('each');
504
  } else {
505
+ $s .= $this->__('Buy %1$s for %2$s (%3$s incl. tax) each', $price['price_qty'], $price['formated_price'], $price['formated_price_incl_tax']);
506
  }
507
  } else {
508
  if ($this->helper('tax')->displayPriceIncludingTax()) {
509
+ if (Mage::helper('weee')->typeOfDisplay($product, 0)) {
510
+ $s .= $this->__('Buy %1$s for %2$s each', $price['price_qty'], $price['formated_price_incl_weee']);
511
+ } else if (Mage::helper('weee')->typeOfDisplay($product, 1)) {
512
+ $s .= $this->__('Buy %1$s for %2$s', $price['price_qty'], $price['formated_price_incl_weee']);
513
+ if ($weeeTaxAttributes) {
514
  $s .= ' (';
515
  $separator = '';
516
+ foreach ($weeeTaxAttributes as $attribute) {
517
+ $s .= $separator . $attribute->getName() . ': ';
518
+ $s .= Mage::helper('core')->currency($attribute->getAmount());
519
  $separator = ' + ';
520
  }
521
  $s .= ')';
522
  }
523
  $s .= ' ' . $this->__('each');
524
+ } else if (Mage::helper('weee')->typeOfDisplay($product, 4)) {
525
+ $s .= $this->__('Buy %1$s for %2$s', $price['price_qty'], $price['formated_price_incl_weee']);
526
+ if ($weeeTaxAttributes) {
527
  $s .= ' (';
528
  $separator = '';
529
+ foreach ($weeeTaxAttributes as $attribute) {
530
+ $s .= $separator . $attribute->getName() . ': ';
531
  $s .= Mage::helper('core')->currency(
532
+ $attribute->getAmount() + $attribute->getTaxAmount()
533
  );
534
  $separator = ' + ';
535
  }
536
  $s .= ')';
537
  }
538
  $s .= ' ' . $this->__('each');
539
+ } else if (Mage::helper('weee')->typeOfDisplay($product, 2)) {
540
+ $s .= $this->__('Buy %1$s for %2$s', $price['price_qty'], $price['formated_price_incl_tax']);
541
+ if ($weeeTaxAttributes) {
542
  $s .= ' (';
543
+ foreach ($weeeTaxAttributes as $attribute) {
544
+ $s .= $attribute->getName() . ': ';
545
+ $s .= Mage::helper('core')->currency($attribute->getAmount());
546
  }
547
+ $s .= ' ' . $this->__('Total incl. Tax: %1$s', $price['formated_price_incl_weee']) . ')';
548
  }
549
  $s .= ' ' . $this->__('each');
550
  } else {
551
+ $s .= $this->__('Buy %1$s for %2$s each', $price['price_qty'], $price['formated_price_incl_tax']);
552
  }
553
  } else {
554
+ if (Mage::helper('weee')->typeOfDisplay($product, 0)) {
555
+ $s .= $this->__('Buy %1$s for %2$s each', $price['price_qty'], $price['formated_price_incl_weee_only']);
556
+ } else if (Mage::helper('weee')->typeOfDisplay($product, 1)) {
557
+ $s .= $this->__('Buy %1$s for %2$s', $price['price_qty'], $price['formated_price_incl_weee_only']);
558
+ if ($weeeTaxAttributes) {
559
  $s .= ' (';
560
  $separator = '';
561
+ foreach ($weeeTaxAttributes as $attribute) {
562
+ $s .= $separator . $attribute->getName() . ': ';
563
+ $s .= Mage::helper('core')->currency($attribute->getAmount());
564
  $separator = ' + ';
565
  }
566
  $s .= ')';
567
  }
568
  $s .= ' ' . $this->__('each');
569
+ } else if (Mage::helper('weee')->typeOfDisplay($product, 4)) {
570
+ $s .= $this->__('Buy %1$s for %2$s', $price['price_qty'], $price['formated_price_incl_weee_only']);
571
+ if ($weeeTaxAttributes) {
572
  $s .= ' (';
573
  $separator = '';
574
+ foreach ($weeeTaxAttributes as $attribute) {
575
+ $s .= $separator . $attribute->getName() . ': ';
576
  $s .= Mage::helper('core')->currency(
577
+ $attribute->getAmount() + $attribute->getTaxAmount()
578
  );
579
  $separator = ' + ';
580
  }
581
  $s .= ')';
582
  }
583
  $s .= ' ' . $this->__('each');
584
+ } else if (Mage::helper('weee')->typeOfDisplay($product, 2)) {
585
+ $s .= $this->__('Buy %1$s for %2$s', $price['price_qty'], $price['formated_price']);
586
+ if ($weeeTaxAttributes) {
587
  $s .= ' (';
588
+ foreach ($weeeTaxAttributes as $attribute) {
589
+ $s .= $attribute->getName() . ': ';
590
+ $s .= Mage::helper('core')->currency($attribute->getAmount());
591
  }
592
+ $s .= ' ' . $this->__('Total incl. Tax: %1$s', $price['formated_price_incl_weee_only']) . ')';
593
  }
594
  $s .= ' ' . $this->__('each');
595
  } else {
596
+ $s .= $this->__('Buy %1$s for %2$s each', $price['price_qty'], $price['formated_price']);
597
  }
598
  }
599
  }
600
+ if (!$product->isGrouped()) {
601
+ $condition1 = ($product->getPrice() == $product->getFinalPrice()
602
+ && $product->getPrice() > $price['price']);
603
 
604
+ $condition2 = ($product->getPrice() != $product->getFinalPrice()
605
+ && $product->getFinalPrice() > $price['price']);
606
 
607
  if ($condition1 || $condition2) {
608
+ $s .= ' ' . $this->__('and') . ' ' . $this->__('save') . ' ' . $price['savePercent'] . '%';
609
  }
610
  }
611
  $pricesArray[] = $s;
app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php CHANGED
@@ -75,15 +75,15 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Giftcard extends Mage_Bundle_B
75
  if ($product->getCanShowPrice() !== false) {
76
  $priceXmlObj = $item->addChild('price');
77
 
78
- $_min = $this->getMinAmount();
79
- $_max = $this->getMaxAmount();
80
- if ($_min && $_max && $_min == $_max) {
81
- $priceXmlObj->addAttribute('regular', Mage::helper('core')->currency($_min, true, false));
82
- } else if ($_min && $_min != 0) {
83
  $priceXmlObj->addAttribute(
84
  'regular',
85
  Mage::helper('enterprise_giftcard')->__('From') . ': '
86
- . Mage::helper('core')->currency($_min, true, false)
87
  );
88
  }
89
  }
75
  if ($product->getCanShowPrice() !== false) {
76
  $priceXmlObj = $item->addChild('price');
77
 
78
+ $min = $this->getMinAmount();
79
+ $max = $this->getMaxAmount();
80
+ if ($min && $max && $min == $max) {
81
+ $priceXmlObj->addAttribute('regular', Mage::helper('core')->currency($min, true, false));
82
+ } else if ($min && $min != 0) {
83
  $priceXmlObj->addAttribute(
84
  'regular',
85
  Mage::helper('enterprise_giftcard')->__('From') . ': '
86
+ . Mage::helper('core')->currency($min, true, false)
87
  );
88
  }
89
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php CHANGED
@@ -31,7 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Address_Form extends Mage_Core_Block_Template
35
  {
36
  /**
37
  * Render customer address form xml
@@ -111,4 +111,51 @@ class Mage_XmlConnect_Block_Checkout_Address_Form extends Mage_Core_Block_Templa
111
 
112
  return $fromXmlObj->getXml();
113
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  }
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Address_Form extends Mage_Core_Block_Abstract
35
  {
36
  /**
37
  * Render customer address form xml
111
 
112
  return $fromXmlObj->getXml();
113
  }
114
+
115
+ /**
116
+ * Retrieve regions by country
117
+ *
118
+ * @deprecated will delete in the next version
119
+ * @param string $countryId
120
+ * @return array
121
+ */
122
+ protected function _getRegionOptions($countryId)
123
+ {
124
+ $cacheKey = 'DIRECTORY_REGION_SELECT_STORE' . Mage::app()->getStore()->getId() . $countryId;
125
+ $cache = Mage::app()->loadCache($cacheKey);
126
+ if (Mage::app()->useCache('config') && $cache) {
127
+ $options = unserialize($cache);
128
+ } else {
129
+ $collection = Mage::getModel('directory/region')->getResourceCollection()->addCountryFilter($countryId)
130
+ ->load();
131
+ $options = $collection->toOptionArray();
132
+ if (Mage::app()->useCache('config')) {
133
+ Mage::app()->saveCache(serialize($options), $cacheKey, array('config'));
134
+ }
135
+ }
136
+ return $options;
137
+ }
138
+
139
+ /**
140
+ * Retrieve countries
141
+ *
142
+ * @deprecated will delete in the next version
143
+ * @return array
144
+ */
145
+ protected function _getCountryOptions()
146
+ {
147
+ $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_' . Mage::app()->getStore()->getCode();
148
+ $cache = Mage::app()->loadCache($cacheKey);
149
+ if (Mage::app()->useCache('config') && $cache) {
150
+ $options = unserialize($cache);
151
+ } else {
152
+ /** @var $collection Mage_Directory_Model_Mysql4_Country_Collection */
153
+ $collection = Mage::getModel('directory/country')->getResourceCollection()->loadByStore();
154
+ $options = $collection->toOptionArray(false);
155
+ if (Mage::app()->useCache('config')) {
156
+ Mage::app()->saveCache(serialize($options), $cacheKey, array('config'));
157
+ }
158
+ }
159
+ return $options;
160
+ }
161
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Cart/Item/Renderer/Configurable.php CHANGED
@@ -44,7 +44,8 @@ class Mage_Xmlconnect_Block_Checkout_Cart_Item_Renderer_Configurable
44
  $product = $this->getChildProduct();
45
  if (!$product || !$product->getData('thumbnail')
46
  || ($product->getData('thumbnail') == 'no_selection')
47
- || (Mage::getStoreConfig(self::CONFIGURABLE_PRODUCT_IMAGE) == self::USE_PARENT_IMAGE)) {
 
48
  $product = $this->getProduct();
49
  }
50
  return $this->helper('xmlconnect/catalog_product_image')->init($product, 'thumbnail');
44
  $product = $this->getChildProduct();
45
  if (!$product || !$product->getData('thumbnail')
46
  || ($product->getData('thumbnail') == 'no_selection')
47
+ || (Mage::getStoreConfig(self::CONFIGURABLE_PRODUCT_IMAGE) == self::USE_PARENT_IMAGE)
48
+ ) {
49
  $product = $this->getProduct();
50
  }
51
  return $this->helper('xmlconnect/catalog_product_image')->init($product, 'thumbnail');
app/code/core/Mage/XmlConnect/Block/Checkout/Cart/Item/Renderer/Grouped.php CHANGED
@@ -43,7 +43,8 @@ class Mage_Xmlconnect_Block_Checkout_Cart_Item_Renderer_Grouped extends Mage_Che
43
  $product = $this->getProduct();
44
  if (!$product->getData('thumbnail')
45
  ||($product->getData('thumbnail') == 'no_selection')
46
- || (Mage::getStoreConfig(self::GROUPED_PRODUCT_IMAGE) == self::USE_PARENT_IMAGE)) {
 
47
  $product = $this->getGroupedProduct();
48
  }
49
  return $this->helper('xmlconnect/catalog_product_image')->init($product, 'thumbnail');
43
  $product = $this->getProduct();
44
  if (!$product->getData('thumbnail')
45
  ||($product->getData('thumbnail') == 'no_selection')
46
+ || (Mage::getStoreConfig(self::GROUPED_PRODUCT_IMAGE) == self::USE_PARENT_IMAGE)
47
+ ) {
48
  $product = $this->getGroupedProduct();
49
  }
50
  return $this->helper('xmlconnect/catalog_product_image')->init($product, 'thumbnail');
app/code/core/Mage/XmlConnect/Block/Checkout/Onepage/Address.php CHANGED
@@ -31,7 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Onepage_Address extends Mage_Checkout_Block_Agreements
35
  {
36
  /**
37
  * Save address action
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Onepage_Address extends Mage_Core_Block_Abstract
35
  {
36
  /**
37
  * Save address action
app/code/core/Mage/XmlConnect/Block/Checkout/Onepage/Address/Form.php CHANGED
@@ -31,7 +31,7 @@
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- class Mage_XmlConnect_Block_Checkout_Onepage_Address_Form extends Mage_Core_Block_Template
35
  {
36
  /**
37
  * Render customer address form
31
  * @package Mage_XmlConnect
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ class Mage_XmlConnect_Block_Checkout_Onepage_Address_Form extends Mage_Core_Block_Abstract
35
  {
36
  /**
37
  * Render customer address form
app/code/core/Mage/XmlConnect/Block/Checkout/Onepage/Address/List.php CHANGED
@@ -43,15 +43,15 @@ class Mage_XmlConnect_Block_Checkout_Onepage_Address_List extends Mage_Checkout_
43
  /** @var $listChild Mage_XmlConnect_Model_Simplexml_Element */
44
  $listChild = $this->getXmlObj();
45
 
46
- $_billingAddress = $this->getCustomer()->getPrimaryBillingAddress();
47
- $_shippingAddress = $this->getCustomer()->getPrimaryShippingAddress();
48
 
49
  foreach ($this->getCustomer()->getAddresses() as $address) {
50
  $childOptions = array();
51
- if ($_billingAddress && ($_billingAddress->getEntityId() == $address->getEntityId())) {
52
  $childOptions['default_billing'] = 1;
53
  }
54
- if ($_shippingAddress && ($_shippingAddress->getEntityId() == $address->getEntityId())) {
55
  $childOptions['default_shipping'] = 1;
56
  }
57
  $addressItem = $listChild->addCustomChild('item', null, $childOptions);
43
  /** @var $listChild Mage_XmlConnect_Model_Simplexml_Element */
44
  $listChild = $this->getXmlObj();
45
 
46
+ $billingAddress = $this->getCustomer()->getPrimaryBillingAddress();
47
+ $shippingAddress = $this->getCustomer()->getPrimaryShippingAddress();
48
 
49
  foreach ($this->getCustomer()->getAddresses() as $address) {
50
  $childOptions = array();
51
+ if ($billingAddress && ($billingAddress->getEntityId() == $address->getEntityId())) {
52
  $childOptions['default_billing'] = 1;
53
  }
54
+ if ($shippingAddress && ($shippingAddress->getEntityId() == $address->getEntityId())) {
55
  $childOptions['default_shipping'] = 1;
56
  }
57
  $addressItem = $listChild->addCustomChild('item', null, $childOptions);
app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php CHANGED
@@ -78,12 +78,12 @@ class Mage_XmlConnect_Block_Checkout_Order_Review_Info extends Mage_Checkout_Blo
78
  }
79
 
80
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
81
- $_incl = $this->helper('checkout')->getPriceInclTax($item);
82
  $typeOfDisplay = Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales');
83
  if ($typeOfDisplay && $item->getWeeeTaxAppliedAmount()) {
84
- $inclPrice = $_incl + $item->getWeeeTaxAppliedAmount();
85
  } else {
86
- $inclPrice = $_incl - $item->getWeeeTaxDisposition();
87
  }
88
  }
89
 
@@ -127,13 +127,13 @@ class Mage_XmlConnect_Block_Checkout_Order_Review_Info extends Mage_Checkout_Blo
127
  }
128
  }
129
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
130
- $_incl = $this->helper('checkout')->getSubtotalInclTax($item);
131
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
132
  && $item->getWeeeTaxAppliedAmount()
133
  ) {
134
- $inclPrice = $_incl + $item->getWeeeTaxAppliedRowAmount();
135
  } else {
136
- $inclPrice = $_incl - $item->getWeeeTaxRowDisposition();
137
  }
138
  }
139
 
@@ -166,15 +166,15 @@ class Mage_XmlConnect_Block_Checkout_Order_Review_Info extends Mage_Checkout_Blo
166
  /**
167
  * Options list
168
  */
169
- $_options = $renderer->getOptionList();
170
- if ($_options) {
171
  $itemOptionsXml = $itemXml->addChild('options');
172
- foreach ($_options as $_option) {
173
- $_formattedOptionValue = $renderer->getFormatedOptionValue($_option);
174
  $optionXml = $itemOptionsXml->addChild('option');
175
- $labelValue = $itemsXmlObj->escapeXml($_option['label']);
176
  $optionXml->addAttribute('label', $labelValue);
177
- $textValue = $itemsXmlObj->escapeXml($_formattedOptionValue['value']);
178
  $optionXml->addAttribute('text', $textValue);
179
  }
180
  }
78
  }
79
 
80
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
81
+ $incl = $this->helper('checkout')->getPriceInclTax($item);
82
  $typeOfDisplay = Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales');
83
  if ($typeOfDisplay && $item->getWeeeTaxAppliedAmount()) {
84
+ $inclPrice = $incl + $item->getWeeeTaxAppliedAmount();
85
  } else {
86
+ $inclPrice = $incl - $item->getWeeeTaxDisposition();
87
  }
88
  }
89
 
127
  }
128
  }
129
  if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
130
+ $incl = $this->helper('checkout')->getSubtotalInclTax($item);
131
  if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales')
132
  && $item->getWeeeTaxAppliedAmount()
133
  ) {
134
+ $inclPrice = $incl + $item->getWeeeTaxAppliedRowAmount();
135
  } else {
136
+ $inclPrice = $incl - $item->getWeeeTaxRowDisposition();
137
  }
138
  }
139
 
166
  /**
167
  * Options list
168
  */
169
+ $options = $renderer->getOptionList();
170
+ if ($options) {
171
  $itemOptionsXml = $itemXml->addChild('options');
172
+ foreach ($options as $option) {
173
+ $formattedOptionValue = $renderer->getFormatedOptionValue($option);
174
  $optionXml = $itemOptionsXml->addChild('option');
175
+ $labelValue = $itemsXmlObj->escapeXml($option['label']);
176
  $optionXml->addAttribute('label', $labelValue);
177
+ $textValue = $itemsXmlObj->escapeXml($formattedOptionValue['value']);
178
  $optionXml->addAttribute('text', $textValue);
179
  }
180
  }
app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php CHANGED
@@ -80,8 +80,8 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_Ccsave extends Mage_Payment_
80
 
81
  $ccTypes = $helper->getArrayAsXmlItemValues($this->getCcAvailableTypes(), $this->getInfoData('cc_type'));
82
 
83
- $_ccMonthArray = $this->getCcMonths();
84
- $ccMonths = $helper->getArrayAsXmlItemValues($_ccMonthArray, $this->getInfoData('cc_exp_month'));
85
 
86
  $ccYears = $helper->getArrayAsXmlItemValues($this->getCcYears(), $this->getInfoData('cc_exp_year'));
87
 
@@ -100,7 +100,7 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_Ccsave extends Mage_Payment_
100
  $solo = '';
101
  if ($this->hasSsCardType()) {
102
  $ssCcMonths = $helper->getArrayAsXmlItemValues(
103
- $_ccMonthArray, $this->getInfoData('cc_ss_start_month')
104
  );
105
  $ssCcYears = $helper->getArrayAsXmlItemValues(
106
  $this->getSsStartYears(), $this->getInfoData('cc_ss_start_year')
80
 
81
  $ccTypes = $helper->getArrayAsXmlItemV