mobicommercemagentoconnect2015 - Version 1.3.1

Version Notes

Create Mobile Native iOS & Android apps and Mobile website for your magento store. All you can do through Mageto admin.

Preview and test your mobile apps and mobile website before you buy it

Personalize and customize your apps on the fly

Send Push notification to all of your mobile user.

No coding and technical skills required to create and manage your mobile apps.

Download this release

Release Info

Developer MobiCommerce
Extension mobicommercemagentoconnect2015
Version 1.3.1
Comparing to
See all releases


Version 1.3.1

Files changed (106) hide show
  1. MobiSettings/category_svg.php +45 -0
  2. MobiSettings/timthumb.php +1270 -0
  3. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications.php +17 -0
  4. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit.php +35 -0
  5. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Form.php +17 -0
  6. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Banners.php +8 -0
  7. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Cms.php +9 -0
  8. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Form.php +181 -0
  9. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Icon.php +9 -0
  10. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Labels.php +48 -0
  11. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Overview.php +9 -0
  12. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Personalization.php +9 -0
  13. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Popup.php +63 -0
  14. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Productslider.php +9 -0
  15. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Pushnotifications.php +32 -0
  16. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tabs.php +79 -0
  17. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid.php +91 -0
  18. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/Action.php +32 -0
  19. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/AndroidStatus.php +10 -0
  20. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/IosStatus.php +10 -0
  21. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/Licence.php +12 -0
  22. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/Store.php +10 -0
  23. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Menu.php +50 -0
  24. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification.php +12 -0
  25. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid.php +81 -0
  26. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid/Renderer/Action.php +19 -0
  27. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid/Renderer/AndroidStatus.php +15 -0
  28. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid/Renderer/IosStatus.php +15 -0
  29. app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid/Renderer/Type.php +10 -0
  30. app/code/local/Mobicommerce/Mobiadmin/Helper/Data.php +190 -0
  31. app/code/local/Mobicommerce/Mobiadmin/Model/Applications.php +562 -0
  32. app/code/local/Mobicommerce/Mobiadmin/Model/Appsetting.php +8 -0
  33. app/code/local/Mobicommerce/Mobiadmin/Model/Appwidget.php +237 -0
  34. app/code/local/Mobicommerce/Mobiadmin/Model/Categoryicons.php +8 -0
  35. app/code/local/Mobicommerce/Mobiadmin/Model/Devicetokens.php +8 -0
  36. app/code/local/Mobicommerce/Mobiadmin/Model/Licence.php +8 -0
  37. app/code/local/Mobicommerce/Mobiadmin/Model/Multilanguage.php +8 -0
  38. app/code/local/Mobicommerce/Mobiadmin/Model/Notification.php +8 -0
  39. app/code/local/Mobicommerce/Mobiadmin/Model/Observer.php +69 -0
  40. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Applications.php +8 -0
  41. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Applications/Collection.php +8 -0
  42. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Appsetting.php +8 -0
  43. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Appsetting/Collection.php +8 -0
  44. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Appwidget.php +8 -0
  45. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Appwidget/Collection.php +8 -0
  46. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Categoryicons.php +8 -0
  47. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Categoryicons/Collection.php +8 -0
  48. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Devicetokens.php +8 -0
  49. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Devicetokens/Collection.php +8 -0
  50. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Licence.php +8 -0
  51. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Licence/Collection.php +8 -0
  52. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Multilanguage.php +8 -0
  53. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Multilanguage/Collection.php +8 -0
  54. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Notification.php +8 -0
  55. app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Notification/Collection.php +8 -0
  56. app/code/local/Mobicommerce/Mobiadmin/controllers/IndexController.php +1330 -0
  57. app/code/local/Mobicommerce/Mobiadmin/etc/adminhtml.xml +42 -0
  58. app/code/local/Mobicommerce/Mobiadmin/etc/config.xml +119 -0
  59. app/code/local/Mobicommerce/Mobiadmin/sql/mobiadmin_setup/mysql4-install-1.0.0.php +131 -0
  60. app/code/local/Mobicommerce/Mobimobileredirect/Helper/Data.php +1316 -0
  61. app/code/local/Mobicommerce/Mobimobileredirect/etc/config.xml +63 -0
  62. app/code/local/Mobicommerce/Mobimobileredirect/etc/system.xml +40 -0
  63. app/code/local/Mobicommerce/Mobipayments/Controller/Action.php +52 -0
  64. app/code/local/Mobicommerce/Mobipayments/Helper/Data.php +5 -0
  65. app/code/local/Mobicommerce/Mobipayments/Model/Abstract.php +39 -0
  66. app/code/local/Mobicommerce/Mobipayments/Model/Paymill.php +12 -0
  67. app/code/local/Mobicommerce/Mobipayments/Model/Standard.php +323 -0
  68. app/code/local/Mobicommerce/Mobipayments/controllers/PaymentController.php +226 -0
  69. app/code/local/Mobicommerce/Mobipayments/controllers/PaymillController.php +11 -0
  70. app/code/local/Mobicommerce/Mobipayments/etc/config.xml +49 -0
  71. app/code/local/Mobicommerce/Mobipayments/etc/system.xml +148 -0
  72. app/code/local/Mobicommerce/Mobipaypaloffline/Block/Form/Mobipaypaloffline.php +62 -0
  73. app/code/local/Mobicommerce/Mobipaypaloffline/Block/Info/Mobipaypaloffline.php +103 -0
  74. app/code/local/Mobicommerce/Mobipaypaloffline/Helper/Data.php +6 -0
  75. app/code/local/Mobicommerce/Mobipaypaloffline/Model/Source/Display.php +26 -0
  76. app/code/local/Mobicommerce/Mobipaypaloffline/Model/Standard.php +85 -0
  77. app/code/local/Mobicommerce/Mobipaypaloffline/etc/config.xml +72 -0
  78. app/code/local/Mobicommerce/Mobipaypaloffline/etc/system.xml +104 -0
  79. app/code/local/Mobicommerce/Mobipaypaloffline/sql/mobipaypaloffline_setup/mysql4-install-1.0.0.php +12 -0
  80. app/code/local/Mobicommerce/Mobiservices/Block/Connector.php +78 -0
  81. app/code/local/Mobicommerce/Mobiservices/Controller/Action.php +62 -0
  82. app/code/local/Mobicommerce/Mobiservices/Helper/Mobicommerce.php +19 -0
  83. app/code/local/Mobicommerce/Mobiservices/Helper/Shoppingcart.php +202 -0
  84. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Abstract.php +45 -0
  85. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Appsetting.php +90 -0
  86. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Catalog/Catalog.php +1242 -0
  87. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Cms.php +11 -0
  88. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Config.php +251 -0
  89. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Custom.php +400 -0
  90. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/External.php +2300 -0
  91. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Home.php +21 -0
  92. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Language.php +28 -0
  93. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Mobiservices.php +10 -0
  94. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Push.php +31 -0
  95. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Review.php +186 -0
  96. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Shoppingcart/Cart.php +1078 -0
  97. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Social.php +24 -0
  98. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/User.php +591 -0
  99. app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Wishlist/Wishlist.php +602 -0
  100. app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Abstract.php +45 -0
  101. app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Appsetting.php +90 -0
  102. app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Catalog/Catalog.php +1242 -0
  103. app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Cms.php +11 -0
  104. app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Config.php +251 -0
  105. app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Custom.php +400 -0
  106. app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/External.php +893 -0
MobiSettings/category_svg.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once '../app/Mage.php';
4
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
5
+ Mage::app("default");
6
+
7
+ $icon_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'mobi_category_icons/';
8
+
9
+ $get = $_REQUEST;
10
+ $svg_filename = $get['svg_filename'];//'icon-menu.svg';
11
+ $color = isset($get['color'])?$get['color']:'';//'333333';
12
+ $color = '#' . $color;
13
+ $new_style_tag = array();
14
+
15
+ header('Pragma: public');
16
+ header('Content-type: image/svg+xml');
17
+
18
+ $svg_image = file_get_contents($icon_url.$svg_filename);
19
+ if(!empty($color)){
20
+ preg_match_all('/<style>(.*?)<\/style>/s', $svg_image, $style_tag);
21
+ //echo "<pre>";print_r($style_tag);exit;
22
+ $old_style_tag = $style_tag[1][0];
23
+ $allStyles = explode("\r\n", $old_style_tag);
24
+ if(!empty($allStyles)){
25
+ foreach($allStyles as $allStyle){
26
+ $allStyle = trim((string)$allStyle);
27
+ if(!empty($allStyle)){
28
+ $property = explode('{', $allStyle);
29
+ $property = $property[0];
30
+ preg_match_all('/{(.*?)}/s', $allStyle, $style_tag);
31
+ if(isset($style_tag[1][0]))
32
+ {
33
+ $param = explode(':', $style_tag[1][0]);
34
+ $param = $param[0];
35
+ $new_style_tag[] = $property.'{'.$param.':'.$color.'!important;}';
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ $new_style_tag = implode("\r\n", $new_style_tag);
42
+ $svg_image = str_replace($old_style_tag, $new_style_tag, $svg_image);
43
+ }
44
+
45
+ echo $svg_image;exit;
MobiSettings/timthumb.php ADDED
@@ -0,0 +1,1270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * TimThumb by Ben Gillbanks and Mark Maunder
4
+ * Based on work done by Tim McDaniels and Darren Hoyt
5
+ * http://code.google.com/p/timthumb/
6
+ *
7
+ * GNU General Public License, version 2
8
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
9
+ *
10
+ * Examples and documentation available on the project homepage
11
+ * http://www.binarymoon.co.uk/projects/timthumb/
12
+ *
13
+ * $Rev$
14
+ */
15
+
16
+ /*
17
+ * --- TimThumb CONFIGURATION ---
18
+ * To edit the configs it is best to create a file called timthumb-config.php
19
+ * and define variables you want to customize in there. It will automatically be
20
+ * loaded by timthumb. This will save you having to re-edit these variables
21
+ * everytime you download a new version
22
+ */
23
+ define ('VERSION', '2.8.14'); // Version of this script
24
+ //Load a config file if it exists. Otherwise, use the values below
25
+ if( file_exists(dirname(__FILE__) . '/timthumb-config.php')) require_once('timthumb-config.php');
26
+ if(! defined('DEBUG_ON') ) define ('DEBUG_ON', false); // Enable debug logging to web server error log (STDERR)
27
+ if(! defined('DEBUG_LEVEL') ) define ('DEBUG_LEVEL', 1); // Debug level 1 is less noisy and 3 is the most noisy
28
+ if(! defined('MEMORY_LIMIT') ) define ('MEMORY_LIMIT', '30M'); // Set PHP memory limit
29
+ if(! defined('BLOCK_EXTERNAL_LEECHERS') ) define ('BLOCK_EXTERNAL_LEECHERS', false); // If the image or webshot is being loaded on an external site, display a red "No Hotlinking" gif.
30
+ if(! defined('DISPLAY_ERROR_MESSAGES') ) define ('DISPLAY_ERROR_MESSAGES', true); // Display error messages. Set to false to turn off errors (good for production websites)
31
+ //Image fetching and caching
32
+ if(! defined('ALLOW_EXTERNAL') ) define ('ALLOW_EXTERNAL', TRUE); // Allow image fetching from external websites. Will check against ALLOWED_SITES if ALLOW_ALL_EXTERNAL_SITES is false
33
+ if(! defined('ALLOW_ALL_EXTERNAL_SITES') ) define ('ALLOW_ALL_EXTERNAL_SITES', true); // Less secure.
34
+ if(! defined('FILE_CACHE_ENABLED') ) define ('FILE_CACHE_ENABLED', TRUE); // Should we store resized/modified images on disk to speed things up?
35
+ if(! defined('FILE_CACHE_TIME_BETWEEN_CLEANS')) define ('FILE_CACHE_TIME_BETWEEN_CLEANS', 86400); // How often the cache is cleaned
36
+
37
+ if(! defined('FILE_CACHE_MAX_FILE_AGE') ) define ('FILE_CACHE_MAX_FILE_AGE', 86400); // How old does a file have to be to be deleted from the cache
38
+ if(! defined('FILE_CACHE_SUFFIX') ) define ('FILE_CACHE_SUFFIX', '.timthumb.txt'); // What to put at the end of all files in the cache directory so we can identify them
39
+ if(! defined('FILE_CACHE_PREFIX') ) define ('FILE_CACHE_PREFIX', 'timthumb'); // What to put at the beg of all files in the cache directory so we can identify them
40
+ if(! defined('FILE_CACHE_DIRECTORY') ) define ('FILE_CACHE_DIRECTORY', './../media/timcache'); // Directory where images are cached. Left blank it will use the system temporary directory (which is better for security)
41
+ if(! defined('MAX_FILE_SIZE') ) define ('MAX_FILE_SIZE', 10485760); // 10 Megs is 10485760. This is the max internal or external file size that we'll process.
42
+ if(! defined('CURL_TIMEOUT') ) define ('CURL_TIMEOUT', 20); // Timeout duration for Curl. This only applies if you have Curl installed and aren't using PHP's default URL fetching mechanism.
43
+ if(! defined('WAIT_BETWEEN_FETCH_ERRORS') ) define ('WAIT_BETWEEN_FETCH_ERRORS', 3600); // Time to wait between errors fetching remote file
44
+
45
+ //Browser caching
46
+ if(! defined('BROWSER_CACHE_MAX_AGE') ) define ('BROWSER_CACHE_MAX_AGE', 864000); // Time to cache in the browser
47
+ if(! defined('BROWSER_CACHE_DISABLE') ) define ('BROWSER_CACHE_DISABLE', false); // Use for testing if you want to disable all browser caching
48
+
49
+ //Image size and defaults
50
+ if(! defined('MAX_WIDTH') ) define ('MAX_WIDTH', 1500); // Maximum image width
51
+ if(! defined('MAX_HEIGHT') ) define ('MAX_HEIGHT', 1500); // Maximum image height
52
+ if(! defined('NOT_FOUND_IMAGE') ) define ('NOT_FOUND_IMAGE', ''); // Image to serve if any 404 occurs
53
+ if(! defined('ERROR_IMAGE') ) define ('ERROR_IMAGE', ''); // Image to serve if an error occurs instead of showing error message
54
+ if(! defined('PNG_IS_TRANSPARENT') ) define ('PNG_IS_TRANSPARENT', FALSE); // Define if a png image should have a transparent background color. Use False value if you want to display a custom coloured canvas_colour
55
+ if(! defined('DEFAULT_Q') ) define ('DEFAULT_Q', 90); // Default image quality. Allows overrid in timthumb-config.php
56
+ if(! defined('DEFAULT_ZC') ) define ('DEFAULT_ZC', 1); // Default zoom/crop setting. Allows overrid in timthumb-config.php
57
+ if(! defined('DEFAULT_F') ) define ('DEFAULT_F', ''); // Default image filters. Allows overrid in timthumb-config.php
58
+ if(! defined('DEFAULT_S') ) define ('DEFAULT_S', 0); // Default sharpen value. Allows overrid in timthumb-config.php
59
+ if(! defined('DEFAULT_CC') ) define ('DEFAULT_CC', 'ffffff'); // Default canvas colour. Allows overrid in timthumb-config.php
60
+ if(! defined('DEFAULT_WIDTH') ) define ('DEFAULT_WIDTH', 100); // Default thumbnail width. Allows overrid in timthumb-config.php
61
+ if(! defined('DEFAULT_HEIGHT') ) define ('DEFAULT_HEIGHT', 100); // Default thumbnail height. Allows overrid in timthumb-config.php
62
+
63
+ /**
64
+ * Additional Parameters:
65
+ * LOCAL_FILE_BASE_DIRECTORY = Override the DOCUMENT_ROOT. This is best used in timthumb-config.php
66
+ */
67
+
68
+ //Image compression is enabled if either of these point to valid paths
69
+
70
+ //These are now disabled by default because the file sizes of PNGs (and GIFs) are much smaller than we used to generate.
71
+ //They only work for PNGs. GIFs and JPEGs are not affected.
72
+ if(! defined('OPTIPNG_ENABLED') ) define ('OPTIPNG_ENABLED', false);
73
+ if(! defined('OPTIPNG_PATH') ) define ('OPTIPNG_PATH', '/usr/bin/optipng'); //This will run first because it gives better compression than pngcrush.
74
+ if(! defined('PNGCRUSH_ENABLED') ) define ('PNGCRUSH_ENABLED', false);
75
+ if(! defined('PNGCRUSH_PATH') ) define ('PNGCRUSH_PATH', '/usr/bin/pngcrush'); //This will only run if OPTIPNG_PATH is not set or is not valid
76
+
77
+ /*
78
+ -------====Website Screenshots configuration - BETA====-------
79
+
80
+ If you just want image thumbnails and don't want website screenshots, you can safely leave this as is.
81
+
82
+ If you would like to get website screenshots set up, you will need root access to your own server.
83
+
84
+ Enable ALLOW_ALL_EXTERNAL_SITES so you can fetch any external web page. This is more secure now that we're using a non-web folder for cache.
85
+ Enable BLOCK_EXTERNAL_LEECHERS so that your site doesn't generate thumbnails for the whole Internet.
86
+
87
+ Instructions to get website screenshots enabled on Ubuntu Linux:
88
+
89
+ 1. Install Xvfb with the following command: sudo apt-get install subversion libqt4-webkit libqt4-dev g++ xvfb
90
+ 2. Go to a directory where you can download some code
91
+ 3. Check-out the latest version of CutyCapt with the following command: svn co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt
92
+ 4. Compile CutyCapt by doing: cd cutycapt/CutyCapt
93
+ 5. qmake
94
+ 6. make
95
+ 7. cp CutyCapt /usr/local/bin/
96
+ 8. Test it by running: xvfb-run --server-args="-screen 0, 1024x768x24" CutyCapt --url="http://markmaunder.com/" --out=test.png
97
+ 9. If you get a file called test.png with something in it, it probably worked. Now test the script by accessing it as follows:
98
+ 10. http://yoursite.com/path/to/timthumb.php?src=http://markmaunder.com/&webshot=1
99
+
100
+ Notes on performance:
101
+ The first time a webshot loads, it will take a few seconds.
102
+ From then on it uses the regular timthumb caching mechanism with the configurable options above
103
+ and loading will be very fast.
104
+
105
+ --ADVANCED USERS ONLY--
106
+ If you'd like a slight speedup (about 25%) and you know Linux, you can run the following command which will keep Xvfb running in the background.
107
+ nohup Xvfb :100 -ac -nolisten tcp -screen 0, 1024x768x24 > /dev/null 2>&1 &
108
+ Then set WEBSHOT_XVFB_RUNNING = true below. This will save your server having to fire off a new Xvfb server and shut it down every time a new shot is generated.
109
+ You will need to take responsibility for keeping Xvfb running in case it crashes. (It seems pretty stable)
110
+ You will also need to take responsibility for server security if you're running Xvfb as root.
111
+
112
+
113
+ */
114
+ if(! defined('WEBSHOT_ENABLED') ) define ('WEBSHOT_ENABLED', false); //Beta feature. Adding webshot=1 to your query string will cause the script to return a browser screenshot rather than try to fetch an image.
115
+ if(! defined('WEBSHOT_CUTYCAPT') ) define ('WEBSHOT_CUTYCAPT', '/usr/local/bin/CutyCapt'); //The path to CutyCapt.
116
+ if(! defined('WEBSHOT_XVFB') ) define ('WEBSHOT_XVFB', '/usr/bin/xvfb-run'); //The path to the Xvfb server
117
+ if(! defined('WEBSHOT_SCREEN_X') ) define ('WEBSHOT_SCREEN_X', '1024'); //1024 works ok
118
+ if(! defined('WEBSHOT_SCREEN_Y') ) define ('WEBSHOT_SCREEN_Y', '768'); //768 works ok
119
+ if(! defined('WEBSHOT_COLOR_DEPTH') ) define ('WEBSHOT_COLOR_DEPTH', '24'); //I haven't tested anything besides 24
120
+ if(! defined('WEBSHOT_IMAGE_FORMAT') ) define ('WEBSHOT_IMAGE_FORMAT', 'png'); //png is about 2.5 times the size of jpg but is a LOT better quality
121
+ if(! defined('WEBSHOT_TIMEOUT') ) define ('WEBSHOT_TIMEOUT', '20'); //Seconds to wait for a webshot
122
+ if(! defined('WEBSHOT_USER_AGENT') ) define ('WEBSHOT_USER_AGENT', "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.18) Gecko/20110614 Firefox/3.6.18"); //I hate to do this, but a non-browser robot user agent might not show what humans see. So we pretend to be Firefox
123
+ if(! defined('WEBSHOT_JAVASCRIPT_ON') ) define ('WEBSHOT_JAVASCRIPT_ON', true); //Setting to false might give you a slight speedup and block ads. But it could cause other issues.
124
+ if(! defined('WEBSHOT_JAVA_ON') ) define ('WEBSHOT_JAVA_ON', false); //Have only tested this as fase
125
+ if(! defined('WEBSHOT_PLUGINS_ON') ) define ('WEBSHOT_PLUGINS_ON', true); //Enable flash and other plugins
126
+ if(! defined('WEBSHOT_PROXY') ) define ('WEBSHOT_PROXY', ''); //In case you're behind a proxy server.
127
+ if(! defined('WEBSHOT_XVFB_RUNNING') ) define ('WEBSHOT_XVFB_RUNNING', false); //ADVANCED: Enable this if you've got Xvfb running in the background.
128
+
129
+
130
+ // If ALLOW_EXTERNAL is true and ALLOW_ALL_EXTERNAL_SITES is false, then external images will only be fetched from these domains and their subdomains.
131
+ if(! isset($ALLOWED_SITES)){
132
+ $ALLOWED_SITES = array (
133
+ 'localhost',
134
+ 'guide.ticketvala.com',
135
+ 'rightwaysolution.us',
136
+ 'flickr.com',
137
+ 'staticflickr.com',
138
+ 'picasa.com',
139
+ 'img.youtube.com',
140
+ 'upload.wikimedia.org',
141
+ 'photobucket.com',
142
+ 'imgur.com',
143
+ 'imageshack.us',
144
+ 'tinypic.com',
145
+ );
146
+ }
147
+ // -------------------------------------------------------------
148
+ // -------------- STOP EDITING CONFIGURATION HERE --------------
149
+ // -------------------------------------------------------------
150
+
151
+ timthumb::start();
152
+
153
+ class timthumb {
154
+ protected $src = "";
155
+ protected $is404 = false;
156
+ protected $docRoot = "";
157
+ protected $lastURLError = false;
158
+ protected $localImage = "";
159
+ protected $localImageMTime = 0;
160
+ protected $url = false;
161
+ protected $myHost = "";
162
+ protected $isURL = false;
163
+ protected $cachefile = '';
164
+ protected $errors = array();
165
+ protected $toDeletes = array();
166
+ protected $cacheDirectory = '';
167
+ protected $startTime = 0;
168
+ protected $lastBenchTime = 0;
169
+ protected $cropTop = false;
170
+ protected $salt = "";
171
+ protected $fileCacheVersion = 1; //Generally if timthumb.php is modifed (upgraded) then the salt changes and all cache files are recreated. This is a backup mechanism to force regen.
172
+ protected $filePrependSecurityBlock = "<?php die('Execution denied!'); //"; //Designed to have three letter mime type, space, question mark and greater than symbol appended. 6 bytes total.
173
+ protected static $curlDataWritten = 0;
174
+ protected static $curlFH = false;
175
+ public static function start(){
176
+ $tim = new timthumb();
177
+ $tim->handleErrors();
178
+ $tim->securityChecks();
179
+ if($tim->tryBrowserCache()){
180
+ exit(0);
181
+ }
182
+ $tim->handleErrors();
183
+ if(FILE_CACHE_ENABLED && $tim->tryServerCache()){
184
+ exit(0);
185
+ }
186
+ $tim->handleErrors();
187
+ $tim->run();
188
+ $tim->handleErrors();
189
+ exit(0);
190
+ }
191
+ public function __construct(){
192
+ global $ALLOWED_SITES;
193
+ $this->startTime = microtime(true);
194
+ date_default_timezone_set('UTC');
195
+ $this->debug(1, "Starting new request from " . $this->getIP() . " to " . $_SERVER['REQUEST_URI']);
196
+ $this->calcDocRoot();
197
+ //On windows systems I'm assuming fileinode returns an empty string or a number that doesn't change. Check this.
198
+ $this->salt = @filemtime(__FILE__) . '-' . @fileinode(__FILE__);
199
+ $this->debug(3, "Salt is: " . $this->salt);
200
+ if(FILE_CACHE_DIRECTORY){
201
+ if(! is_dir(FILE_CACHE_DIRECTORY)){
202
+ @mkdir(FILE_CACHE_DIRECTORY);
203
+ if(! is_dir(FILE_CACHE_DIRECTORY)){
204
+ $this->error("Could not create the file cache directory.");
205
+ return false;
206
+ }
207
+ }
208
+ $this->cacheDirectory = FILE_CACHE_DIRECTORY;
209
+ if (!touch($this->cacheDirectory . '/index.html')) {
210
+ $this->error("Could not create the index.html file - to fix this create an empty file named index.html file in the cache directory.");
211
+ }
212
+ } else {
213
+ $this->cacheDirectory = sys_get_temp_dir();
214
+ }
215
+ //Clean the cache before we do anything because we don't want the first visitor after FILE_CACHE_TIME_BETWEEN_CLEANS expires to get a stale image.
216
+ $this->cleanCache();
217
+
218
+ $this->myHost = preg_replace('/^www\./i', '', $_SERVER['HTTP_HOST']);
219
+ $this->src = $this->param('src');
220
+ $this->url = parse_url($this->src);
221
+ $this->src = preg_replace('/https?:\/\/(?:www\.)?' . $this->myHost . '/i', '', $this->src);
222
+
223
+ if(strlen($this->src) <= 3){
224
+ $this->error("No image specified");
225
+ return false;
226
+ }
227
+ if(BLOCK_EXTERNAL_LEECHERS && array_key_exists('HTTP_REFERER', $_SERVER) && (! preg_match('/^https?:\/\/(?:www\.)?' . $this->myHost . '(?:$|\/)/i', $_SERVER['HTTP_REFERER']))){
228
+ // base64 encoded red image that says 'no hotlinkers'
229
+ // nothing to worry about! :)
230
+ $imgData = base64_decode("R0lGODlhUAAMAIAAAP8AAP///yH5BAAHAP8ALAAAAABQAAwAAAJpjI+py+0Po5y0OgAMjjv01YUZ\nOGplhWXfNa6JCLnWkXplrcBmW+spbwvaVr/cDyg7IoFC2KbYVC2NQ5MQ4ZNao9Ynzjl9ScNYpneb\nDULB3RP6JuPuaGfuuV4fumf8PuvqFyhYtjdoeFgAADs=");
231
+ header('Content-Type: image/gif');
232
+ header('Content-Length: ' . strlen($imgData));
233
+ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
234
+ header("Pragma: no-cache");
235
+ header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
236
+ echo $imgData;
237
+ return false;
238
+ exit(0);
239
+ }
240
+ if(preg_match('/^https?:\/\/[^\/]+/i', $this->src)){
241
+ $this->debug(2, "Is a request for an external URL: " . $this->src);
242
+ $this->isURL = true;
243
+ } else {
244
+ $this->debug(2, "Is a request for an internal file: " . $this->src);
245
+ }
246
+ if($this->isURL && (! ALLOW_EXTERNAL)){
247
+ $this->error("You are not allowed to fetch images from an external website.");
248
+ return false;
249
+ }
250
+ if($this->isURL){
251
+ if(ALLOW_ALL_EXTERNAL_SITES){
252
+ $this->debug(2, "Fetching from all external sites is enabled.");
253
+ } else {
254
+ $this->debug(2, "Fetching only from selected external sites is enabled.");
255
+ $allowed = false;
256
+ foreach($ALLOWED_SITES as $site){
257
+ if ((strtolower(substr($this->url['host'],-strlen($site)-1)) === strtolower(".$site")) || (strtolower($this->url['host'])===strtolower($site))) {
258
+ $this->debug(3, "URL hostname {$this->url['host']} matches $site so allowing.");
259
+ $allowed = true;
260
+ }
261
+ }
262
+ if(! $allowed){
263
+ return $this->error("You may not fetch images from that site. To enable this site in timthumb, you can either add it to \$ALLOWED_SITES and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.");
264
+ }
265
+ }
266
+ }
267
+
268
+ $cachePrefix = ($this->isURL ? '_ext_' : '_int_');
269
+ if($this->isURL){
270
+ $arr = explode('&', $_SERVER ['QUERY_STRING']);
271
+ asort($arr);
272
+ $this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . implode('', $arr) . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
273
+ } else {
274
+ $this->localImage = $this->getLocalImagePath($this->src);
275
+ if(! $this->localImage){
276
+ $this->debug(1, "Could not find the local image: {$this->localImage}");
277
+ $this->error("Could not find the internal image you specified.");
278
+ $this->set404();
279
+ return false;
280
+ }
281
+ $this->debug(1, "Local image path is {$this->localImage}");
282
+ $this->localImageMTime = @filemtime($this->localImage);
283
+ //We include the mtime of the local file in case in changes on disk.
284
+ $this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . $this->localImageMTime . $_SERVER ['QUERY_STRING'] . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
285
+ }
286
+ $this->debug(2, "Cache file is: " . $this->cachefile);
287
+
288
+ return true;
289
+ }
290
+ public function __destruct(){
291
+ foreach($this->toDeletes as $del){
292
+ $this->debug(2, "Deleting temp file $del");
293
+ @unlink($del);
294
+ }
295
+ }
296
+ public function run(){
297
+ if($this->isURL){
298
+ if(! ALLOW_EXTERNAL){
299
+ $this->debug(1, "Got a request for an external image but ALLOW_EXTERNAL is disabled so returning error msg.");
300
+ $this->error("You are not allowed to fetch images from an external website.");
301
+ return false;
302
+ }
303
+ $this->debug(3, "Got request for external image. Starting serveExternalImage.");
304
+ if($this->param('webshot')){
305
+ if(WEBSHOT_ENABLED){
306
+ $this->debug(3, "webshot param is set, so we're going to take a webshot.");
307
+ $this->serveWebshot();
308
+ } else {
309
+ $this->error("You added the webshot parameter but webshots are disabled on this server. You need to set WEBSHOT_ENABLED == true to enable webshots.");
310
+ }
311
+ } else {
312
+ $this->debug(3, "webshot is NOT set so we're going to try to fetch a regular image.");
313
+ $this->serveExternalImage();
314
+
315
+ }
316
+ } else {
317
+ $this->debug(3, "Got request for internal image. Starting serveInternalImage()");
318
+ $this->serveInternalImage();
319
+ }
320
+ return true;
321
+ }
322
+ protected function handleErrors(){
323
+ if($this->haveErrors()){
324
+ if(NOT_FOUND_IMAGE && $this->is404()){
325
+ if($this->serveImg(NOT_FOUND_IMAGE)){
326
+ exit(0);
327
+ } else {
328
+ $this->error("Additionally, the 404 image that is configured could not be found or there was an error serving it.");
329
+ }
330
+ }
331
+ if(ERROR_IMAGE){
332
+ if($this->serveImg(ERROR_IMAGE)){
333
+ exit(0);
334
+ } else {
335
+ $this->error("Additionally, the error image that is configured could not be found or there was an error serving it.");
336
+ }
337
+ }
338
+ $this->serveErrors();
339
+ exit(0);
340
+ }
341
+ return false;
342
+ }
343
+ protected function tryBrowserCache(){
344
+ if(BROWSER_CACHE_DISABLE){ $this->debug(3, "Browser caching is disabled"); return false; }
345
+ if(!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ){
346
+ $this->debug(3, "Got a conditional get");
347
+ $mtime = false;
348
+ //We've already checked if the real file exists in the constructor
349
+ if(! is_file($this->cachefile)){
350
+ //If we don't have something cached, regenerate the cached image.
351
+ return false;
352
+ }
353
+ if($this->localImageMTime){
354
+ $mtime = $this->localImageMTime;
355
+ $this->debug(3, "Local real file's modification time is $mtime");
356
+ } else if(is_file($this->cachefile)){ //If it's not a local request then use the mtime of the cached file to determine the 304
357
+ $mtime = @filemtime($this->cachefile);
358
+ $this->debug(3, "Cached file's modification time is $mtime");
359
+ }
360
+ if(! $mtime){ return false; }
361
+
362
+ $iftime = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
363
+ $this->debug(3, "The conditional get's if-modified-since unixtime is $iftime");
364
+ if($iftime < 1){
365
+ $this->debug(3, "Got an invalid conditional get modified since time. Returning false.");
366
+ return false;
367
+ }
368
+ if($iftime < $mtime){ //Real file or cache file has been modified since last request, so force refetch.
369
+ $this->debug(3, "File has been modified since last fetch.");
370
+ return false;
371
+ } else { //Otherwise serve a 304
372
+ $this->debug(3, "File has not been modified since last get, so serving a 304.");
373
+ header ($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
374
+ $this->debug(1, "Returning 304 not modified");
375
+ return true;
376
+ }
377
+ }
378
+ return false;
379
+ }
380
+ protected function tryServerCache(){
381
+ $this->debug(3, "Trying server cache");
382
+ if(file_exists($this->cachefile)){
383
+ $this->debug(3, "Cachefile {$this->cachefile} exists");
384
+ if($this->isURL){
385
+ $this->debug(3, "This is an external request, so checking if the cachefile is empty which means the request failed previously.");
386
+ if(filesize($this->cachefile) < 1){
387
+ $this->debug(3, "Found an empty cachefile indicating a failed earlier request. Checking how old it is.");
388
+ //Fetching error occured previously
389
+ if(time() - @filemtime($this->cachefile) > WAIT_BETWEEN_FETCH_ERRORS){
390
+ $this->debug(3, "File is older than " . WAIT_BETWEEN_FETCH_ERRORS . " seconds. Deleting and returning false so app can try and load file.");
391
+ @unlink($this->cachefile);
392
+ return false; //to indicate we didn't serve from cache and app should try and load
393
+ } else {
394
+ $this->debug(3, "Empty cachefile is still fresh so returning message saying we had an error fetching this image from remote host.");
395
+ $this->set404();
396
+ $this->error("An error occured fetching image.");
397
+ return false;
398
+ }
399
+ }
400
+ } else {
401
+ $this->debug(3, "Trying to serve cachefile {$this->cachefile}");
402
+ }
403
+ if($this->serveCacheFile()){
404
+ $this->debug(3, "Succesfully served cachefile {$this->cachefile}");
405
+ return true;
406
+ } else {
407
+ $this->debug(3, "Failed to serve cachefile {$this->cachefile} - Deleting it from cache.");
408
+ //Image serving failed. We can't retry at this point, but lets remove it from cache so the next request recreates it
409
+ @unlink($this->cachefile);
410
+ return true;
411
+ }
412
+ }
413
+ }
414
+ protected function error($err){
415
+ $this->debug(3, "Adding error message: $err");
416
+ $this->errors[] = $err;
417
+ return false;
418
+
419
+ }
420
+ protected function haveErrors(){
421
+ if(sizeof($this->errors) > 0){
422
+ return true;
423
+ }
424
+ return false;
425
+ }
426
+ protected function serveErrors(){
427
+ header ($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
428
+ if ( ! DISPLAY_ERROR_MESSAGES ) {
429
+ return;
430
+ }
431
+ $html = '<ul>';
432
+ foreach($this->errors as $err){
433
+ $html .= '<li>' . htmlentities($err) . '</li>';
434
+ }
435
+ $html .= '</ul>';
436
+ echo '<h1>A TimThumb error has occured</h1>The following error(s) occured:<br />' . $html . '<br />';
437
+ echo '<br />Query String : ' . htmlentities( $_SERVER['QUERY_STRING'], ENT_QUOTES );
438
+ echo '<br />TimThumb version : ' . VERSION . '</pre>';
439
+ }
440
+ protected function serveInternalImage(){
441
+ $this->debug(3, "Local image path is $this->localImage");
442
+ if(! $this->localImage){
443
+ $this->sanityFail("localImage not set after verifying it earlier in the code.");
444
+ return false;
445
+ }
446
+ $fileSize = filesize($this->localImage);
447
+ if($fileSize > MAX_FILE_SIZE){
448
+ $this->error("The file you specified is greater than the maximum allowed file size.");
449
+ return false;
450
+ }
451
+ if($fileSize <= 0){
452
+ $this->error("The file you specified is <= 0 bytes.");
453
+ return false;
454
+ }
455
+ $this->debug(3, "Calling processImageAndWriteToCache() for local image.");
456
+ if($this->processImageAndWriteToCache($this->localImage)){
457
+ $this->serveCacheFile();
458
+ return true;
459
+ } else {
460
+ return false;
461
+ }
462
+ }
463
+ protected function cleanCache(){
464
+ if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
465
+ return;
466
+ }
467
+ $this->debug(3, "cleanCache() called");
468
+ $lastCleanFile = $this->cacheDirectory . '/timthumb_cacheLastCleanTime.touch';
469
+
470
+ //If this is a new timthumb installation we need to create the file
471
+ if(! is_file($lastCleanFile)){
472
+ $this->debug(1, "File tracking last clean doesn't exist. Creating $lastCleanFile");
473
+ if (!touch($lastCleanFile)) {
474
+ $this->error("Could not create cache clean timestamp file.");
475
+ }
476
+ return;
477
+ }
478
+ if(@filemtime($lastCleanFile) < (time() - FILE_CACHE_TIME_BETWEEN_CLEANS) ){ //Cache was last cleaned more than 1 day ago
479
+ $this->debug(1, "Cache was last cleaned more than " . FILE_CACHE_TIME_BETWEEN_CLEANS . " seconds ago. Cleaning now.");
480
+ // Very slight race condition here, but worst case we'll have 2 or 3 servers cleaning the cache simultaneously once a day.
481
+ if (!touch($lastCleanFile)) {
482
+ $this->error("Could not create cache clean timestamp file.");
483
+ }
484
+ $files = glob($this->cacheDirectory . '/*' . FILE_CACHE_SUFFIX);
485
+ if ($files) {
486
+ $timeAgo = time() - FILE_CACHE_MAX_FILE_AGE;
487
+ foreach($files as $file){
488
+ if(@filemtime($file) < $timeAgo){
489
+ $this->debug(3, "Deleting cache file $file older than max age: " . FILE_CACHE_MAX_FILE_AGE . " seconds");
490
+ @unlink($file);
491
+ }
492
+ }
493
+ }
494
+ return true;
495
+ } else {
496
+ $this->debug(3, "Cache was cleaned less than " . FILE_CACHE_TIME_BETWEEN_CLEANS . " seconds ago so no cleaning needed.");
497
+ }
498
+ return false;
499
+ }
500
+ protected function processImageAndWriteToCache($localImage){
501
+ $sData = getimagesize($localImage);
502
+ $origType = $sData[2];
503
+ $mimeType = $sData['mime'];
504
+
505
+ $this->debug(3, "Mime type of image is $mimeType");
506
+ if(! preg_match('/^image\/(?:gif|jpg|jpeg|png)$/i', $mimeType)){
507
+ return $this->error("The image being resized is not a valid gif, jpg or png.");
508
+ }
509
+
510
+ if (!function_exists ('imagecreatetruecolor')) {
511
+ return $this->error('GD Library Error: imagecreatetruecolor does not exist - please contact your webhost and ask them to install the GD library');
512
+ }
513
+
514
+ if (function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
515
+ $imageFilters = array (
516
+ 1 => array (IMG_FILTER_NEGATE, 0),
517
+ 2 => array (IMG_FILTER_GRAYSCALE, 0),
518
+ 3 => array (IMG_FILTER_BRIGHTNESS, 1),
519
+ 4 => array (IMG_FILTER_CONTRAST, 1),
520
+ 5 => array (IMG_FILTER_COLORIZE, 4),
521
+ 6 => array (IMG_FILTER_EDGEDETECT, 0),
522
+ 7 => array (IMG_FILTER_EMBOSS, 0),
523
+ 8 => array (IMG_FILTER_GAUSSIAN_BLUR, 0),
524
+ 9 => array (IMG_FILTER_SELECTIVE_BLUR, 0),
525
+ 10 => array (IMG_FILTER_MEAN_REMOVAL, 0),
526
+ 11 => array (IMG_FILTER_SMOOTH, 0),
527
+ );
528
+ }
529
+
530
+ // get standard input properties
531
+ $new_width = (int) abs ($this->param('w', 0));
532
+ $new_height = (int) abs ($this->param('h', 0));
533
+ $zoom_crop = (int) $this->param('zc', DEFAULT_ZC);
534
+ $quality = (int) abs ($this->param('q', DEFAULT_Q));
535
+ $align = $this->cropTop ? 't' : $this->param('a', 'c');
536
+ $filters = $this->param('f', DEFAULT_F);
537
+ $sharpen = (bool) $this->param('s', DEFAULT_S);
538
+ $canvas_color = $this->param('cc', DEFAULT_CC);
539
+ $canvas_trans = (bool) $this->param('ct', '1');
540
+
541
+ // set default width and height if neither are set already
542
+ if ($new_width == 0 && $new_height == 0) {
543
+ $new_width = (int) DEFAULT_WIDTH;
544
+ $new_height = (int) DEFAULT_HEIGHT;
545
+ }
546
+
547
+ // ensure size limits can not be abused
548
+ $new_width = min ($new_width, MAX_WIDTH);
549
+ $new_height = min ($new_height, MAX_HEIGHT);
550
+
551
+ // set memory limit to be able to have enough space to resize larger images
552
+ $this->setMemoryLimit();
553
+
554
+ // open the existing image
555
+ $image = $this->openImage ($mimeType, $localImage);
556
+ if ($image === false) {
557
+ return $this->error('Unable to open image.');
558
+ }
559
+
560
+ // Get original width and height
561
+ $width = imagesx ($image);
562
+ $height = imagesy ($image);
563
+ $origin_x = 0;
564
+ $origin_y = 0;
565
+
566
+ // generate new w/h if not provided
567
+ if ($new_width && !$new_height) {
568
+ $new_height = floor ($height * ($new_width / $width));
569
+ } else if ($new_height && !$new_width) {
570
+ $new_width = floor ($width * ($new_height / $height));
571
+ }
572
+
573
+ // scale down and add borders
574
+ if ($zoom_crop == 3) {
575
+
576
+ $final_height = $height * ($new_width / $width);
577
+
578
+ if ($final_height > $new_height) {
579
+ $new_width = $width * ($new_height / $height);
580
+ } else {
581
+ $new_height = $final_height;
582
+ }
583
+
584
+ }
585
+
586
+ // create a new true color image
587
+ $canvas = imagecreatetruecolor ($new_width, $new_height);
588
+ imagealphablending ($canvas, false);
589
+
590
+ if (strlen($canvas_color) == 3) { //if is 3-char notation, edit string into 6-char notation
591
+ $canvas_color = str_repeat(substr($canvas_color, 0, 1), 2) . str_repeat(substr($canvas_color, 1, 1), 2) . str_repeat(substr($canvas_color, 2, 1), 2);
592
+ } else if (strlen($canvas_color) != 6) {
593
+ $canvas_color = DEFAULT_CC; // on error return default canvas color
594
+ }
595
+
596
+ $canvas_color_R = hexdec (substr ($canvas_color, 0, 2));
597
+ $canvas_color_G = hexdec (substr ($canvas_color, 2, 2));
598
+ $canvas_color_B = hexdec (substr ($canvas_color, 4, 2));
599
+
600
+ // Create a new transparent color for image
601
+ // If is a png and PNG_IS_TRANSPARENT is false then remove the alpha transparency
602
+ // (and if is set a canvas color show it in the background)
603
+ if(preg_match('/^image\/png$/i', $mimeType) && !PNG_IS_TRANSPARENT && $canvas_trans){
604
+ $color = imagecolorallocatealpha ($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 127);
605
+ }else{
606
+ $color = imagecolorallocatealpha ($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 0);
607
+ }
608
+
609
+
610
+ // Completely fill the background of the new image with allocated color.
611
+ imagefill ($canvas, 0, 0, $color);
612
+
613
+ // scale down and add borders
614
+ if ($zoom_crop == 2) {
615
+
616
+ $final_height = $height * ($new_width / $width);
617
+
618
+ if ($final_height > $new_height) {
619
+
620
+ $origin_x = $new_width / 2;
621
+ $new_width = $width * ($new_height / $height);
622
+ $origin_x = round ($origin_x - ($new_width / 2));
623
+
624
+ } else {
625
+
626
+ $origin_y = $new_height / 2;
627
+ $new_height = $final_height;
628
+ $origin_y = round ($origin_y - ($new_height / 2));
629
+
630
+ }
631
+
632
+ }
633
+
634
+ // Restore transparency blending
635
+ imagesavealpha ($canvas, true);
636
+
637
+ if ($zoom_crop > 0) {
638
+
639
+ $src_x = $src_y = 0;
640
+ $src_w = $width;
641
+ $src_h = $height;
642
+
643
+ $cmp_x = $width / $new_width;
644
+ $cmp_y = $height / $new_height;
645
+
646
+ // calculate x or y coordinate and width or height of source
647
+ if ($cmp_x > $cmp_y) {
648
+
649
+ $src_w = round ($width / $cmp_x * $cmp_y);
650
+ $src_x = round (($width - ($width / $cmp_x * $cmp_y)) / 2);
651
+
652
+ } else if ($cmp_y > $cmp_x) {
653
+
654
+ $src_h = round ($height / $cmp_y * $cmp_x);
655
+ $src_y = round (($height - ($height / $cmp_y * $cmp_x)) / 2);
656
+
657
+ }
658
+
659
+ // positional cropping!
660
+ if ($align) {
661
+ if (strpos ($align, 't') !== false) {
662
+ $src_y = 0;
663
+ }
664
+ if (strpos ($align, 'b') !== false) {
665
+ $src_y = $height - $src_h;
666
+ }
667
+ if (strpos ($align, 'l') !== false) {
668
+ $src_x = 0;
669
+ }
670
+ if (strpos ($align, 'r') !== false) {
671
+ $src_x = $width - $src_w;
672
+ }
673
+ }
674
+
675
+ imagecopyresampled ($canvas, $image, $origin_x, $origin_y, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h);
676
+
677
+ } else {
678
+
679
+ // copy and resize part of an image with resampling
680
+ imagecopyresampled ($canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
681
+
682
+ }
683
+
684
+ if ($filters != '' && function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
685
+ // apply filters to image
686
+ $filterList = explode ('|', $filters);
687
+ foreach ($filterList as $fl) {
688
+
689
+ $filterSettings = explode (',', $fl);
690
+ if (isset ($imageFilters[$filterSettings[0]])) {
691
+
692
+ for ($i = 0; $i < 4; $i ++) {
693
+ if (!isset ($filterSettings[$i])) {
694
+ $filterSettings[$i] = null;
695
+ } else {
696
+ $filterSettings[$i] = (int) $filterSettings[$i];
697
+ }
698
+ }
699
+
700
+ switch ($imageFilters[$filterSettings[0]][1]) {
701
+
702
+ case 1:
703
+
704
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1]);
705
+ break;
706
+
707
+ case 2:
708
+
709
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2]);
710
+ break;
711
+
712
+ case 3:
713
+
714
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3]);
715
+ break;
716
+
717
+ case 4:
718
+
719
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3], $filterSettings[4]);
720
+ break;
721
+
722
+ default:
723
+
724
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0]);
725
+ break;
726
+
727
+ }
728
+ }
729
+ }
730
+ }
731
+
732
+ // sharpen image
733
+ if ($sharpen && function_exists ('imageconvolution')) {
734
+
735
+ $sharpenMatrix = array (
736
+ array (-1,-1,-1),
737
+ array (-1,16,-1),
738
+ array (-1,-1,-1),
739
+ );
740
+
741
+ $divisor = 8;
742
+ $offset = 0;
743
+
744
+ imageconvolution ($canvas, $sharpenMatrix, $divisor, $offset);
745
+
746
+ }
747
+ //Straight from Wordpress core code. Reduces filesize by up to 70% for PNG's
748
+ if ( (IMAGETYPE_PNG == $origType || IMAGETYPE_GIF == $origType) && function_exists('imageistruecolor') && !imageistruecolor( $image ) && imagecolortransparent( $image ) > 0 ){
749
+ imagetruecolortopalette( $canvas, false, imagecolorstotal( $image ) );
750
+ }
751
+
752
+ $imgType = "";
753
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
754
+ if(preg_match('/^image\/(?:jpg|jpeg)$/i', $mimeType)){
755
+ $imgType = 'jpg';
756
+ imagejpeg($canvas, $tempfile, $quality);
757
+ } else if(preg_match('/^image\/png$/i', $mimeType)){
758
+ $imgType = 'png';
759
+ imagepng($canvas, $tempfile, floor($quality * 0.09));
760
+ } else if(preg_match('/^image\/gif$/i', $mimeType)){
761
+ $imgType = 'gif';
762
+ imagegif($canvas, $tempfile);
763
+ } else {
764
+ return $this->sanityFail("Could not match mime type after verifying it previously.");
765
+ }
766
+
767
+ if($imgType == 'png' && OPTIPNG_ENABLED && OPTIPNG_PATH && @is_file(OPTIPNG_PATH)){
768
+ $exec = OPTIPNG_PATH;
769
+ $this->debug(3, "optipng'ing $tempfile");
770
+ $presize = filesize($tempfile);
771
+ $out = `$exec -o1 $tempfile`; //you can use up to -o7 but it really slows things down
772
+ clearstatcache();
773
+ $aftersize = filesize($tempfile);
774
+ $sizeDrop = $presize - $aftersize;
775
+ if($sizeDrop > 0){
776
+ $this->debug(1, "optipng reduced size by $sizeDrop");
777
+ } else if($sizeDrop < 0){
778
+ $this->debug(1, "optipng increased size! Difference was: $sizeDrop");
779
+ } else {
780
+ $this->debug(1, "optipng did not change image size.");
781
+ }
782
+ } else if($imgType == 'png' && PNGCRUSH_ENABLED && PNGCRUSH_PATH && @is_file(PNGCRUSH_PATH)){
783
+ $exec = PNGCRUSH_PATH;
784
+ $tempfile2 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
785
+ $this->debug(3, "pngcrush'ing $tempfile to $tempfile2");
786
+ $out = `$exec $tempfile $tempfile2`;
787
+ $todel = "";
788
+ if(is_file($tempfile2)){
789
+ $sizeDrop = filesize($tempfile) - filesize($tempfile2);
790
+ if($sizeDrop > 0){
791
+ $this->debug(1, "pngcrush was succesful and gave a $sizeDrop byte size reduction");
792
+ $todel = $tempfile;
793
+ $tempfile = $tempfile2;
794
+ } else {
795
+ $this->debug(1, "pngcrush did not reduce file size. Difference was $sizeDrop bytes.");
796
+ $todel = $tempfile2;
797
+ }
798
+ } else {
799
+ $this->debug(3, "pngcrush failed with output: $out");
800
+ $todel = $tempfile2;
801
+ }
802
+ @unlink($todel);
803
+ }
804
+
805
+ $this->debug(3, "Rewriting image with security header.");
806
+ $tempfile4 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
807
+ $context = stream_context_create ();
808
+ $fp = fopen($tempfile,'r',0,$context);
809
+ file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //6 extra bytes, first 3 being image type
810
+ file_put_contents($tempfile4, $fp, FILE_APPEND);
811
+ fclose($fp);
812
+ @unlink($tempfile);
813
+ $this->debug(3, "Locking and replacing cache file.");
814
+ $lockFile = $this->cachefile . '.lock';
815
+ $fh = fopen($lockFile, 'w');
816
+ if(! $fh){
817
+ return $this->error("Could not open the lockfile for writing an image.");
818
+ }
819
+ if(flock($fh, LOCK_EX)){
820
+ @unlink($this->cachefile); //rename generally overwrites, but doing this in case of platform specific quirks. File might not exist yet.
821
+ rename($tempfile4, $this->cachefile);
822
+ flock($fh, LOCK_UN);
823
+ fclose($fh);
824
+ @unlink($lockFile);
825
+ } else {
826
+ fclose($fh);
827
+ @unlink($lockFile);
828
+ @unlink($tempfile4);
829
+ return $this->error("Could not get a lock for writing.");
830
+ }
831
+ $this->debug(3, "Done image replace with security header. Cleaning up and running cleanCache()");
832
+ imagedestroy($canvas);
833
+ imagedestroy($image);
834
+ return true;
835
+ }
836
+ protected function calcDocRoot(){
837
+ $docRoot = @$_SERVER['DOCUMENT_ROOT'];
838
+ if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
839
+ $docRoot = LOCAL_FILE_BASE_DIRECTORY;
840
+ }
841
+ if(!isset($docRoot)){
842
+ $this->debug(3, "DOCUMENT_ROOT is not set. This is probably windows. Starting search 1.");
843
+ if(isset($_SERVER['SCRIPT_FILENAME'])){
844
+ $docRoot = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
845
+ $this->debug(3, "Generated docRoot using SCRIPT_FILENAME and PHP_SELF as: $docRoot");
846
+ }
847
+ }
848
+ if(!isset($docRoot)){
849
+ $this->debug(3, "DOCUMENT_ROOT still is not set. Starting search 2.");
850
+ if(isset($_SERVER['PATH_TRANSLATED'])){
851
+ $docRoot = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
852
+ $this->debug(3, "Generated docRoot using PATH_TRANSLATED and PHP_SELF as: $docRoot");
853
+ }
854
+ }
855
+ if($docRoot && $_SERVER['DOCUMENT_ROOT'] != '/'){ $docRoot = preg_replace('/\/$/', '', $docRoot); }
856
+ $this->debug(3, "Doc root is: " . $docRoot);
857
+ $this->docRoot = $docRoot;
858
+
859
+ }
860
+ protected function getLocalImagePath($src){
861
+ $src = ltrim($src, '/'); //strip off the leading '/'
862
+ if(! $this->docRoot){
863
+ $this->debug(3, "We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.");
864
+ //We don't support serving images outside the current dir if we don't have a doc root for security reasons.
865
+ $file = preg_replace('/^.*?([^\/\\\\]+)$/', '$1', $src); //strip off any path info and just leave the filename.
866
+ if(is_file($file)){
867
+ return $this->realpath($file);
868
+ }
869
+ return $this->error("Could not find your website document root and the file specified doesn't exist in timthumbs directory. We don't support serving files outside timthumb's directory without a document root for security reasons.");
870
+ } else if ( ! is_dir( $this->docRoot ) ) {
871
+ $this->error("Server path does not exist. Ensure variable \$_SERVER['DOCUMENT_ROOT'] is set correctly");
872
+ }
873
+
874
+ //Do not go past this point without docRoot set
875
+
876
+ //Try src under docRoot
877
+ if(file_exists ($this->docRoot . '/' . $src)) {
878
+ $this->debug(3, "Found file as " . $this->docRoot . '/' . $src);
879
+ $real = $this->realpath($this->docRoot . '/' . $src);
880
+ if(stripos($real, $this->docRoot) === 0){
881
+ return $real;
882
+ } else {
883
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
884
+ //allow search to continue
885
+ }
886
+ }
887
+ //Check absolute paths and then verify the real path is under doc root
888
+ $absolute = $this->realpath('/' . $src);
889
+ if($absolute && file_exists($absolute)){ //realpath does file_exists check, so can probably skip the exists check here
890
+ $this->debug(3, "Found absolute path: $absolute");
891
+ if(! $this->docRoot){ $this->sanityFail("docRoot not set when checking absolute path."); }
892
+ if(stripos($absolute, $this->docRoot) === 0){
893
+ return $absolute;
894
+ } else {
895
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
896
+ //and continue search
897
+ }
898
+ }
899
+
900
+ $base = $this->docRoot;
901
+
902
+ // account for Windows directory structure
903
+ if (strstr($_SERVER['SCRIPT_FILENAME'],':')) {
904
+ $sub_directories = explode('\\', str_replace($this->docRoot, '', $_SERVER['SCRIPT_FILENAME']));
905
+ } else {
906
+ $sub_directories = explode('/', str_replace($this->docRoot, '', $_SERVER['SCRIPT_FILENAME']));
907
+ }
908
+
909
+ foreach ($sub_directories as $sub){
910
+ $base .= $sub . '/';
911
+ $this->debug(3, "Trying file as: " . $base . $src);
912
+ if(file_exists($base . $src)){
913
+ $this->debug(3, "Found file as: " . $base . $src);
914
+ $real = $this->realpath($base . $src);
915
+ if(stripos($real, $this->realpath($this->docRoot)) === 0){
916
+ return $real;
917
+ } else {
918
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
919
+ //And continue search
920
+ }
921
+ }
922
+ }
923
+ return false;
924
+ }
925
+ protected function realpath($path){
926
+ //try to remove any relative paths
927
+ $remove_relatives = '/\w+\/\.\.\//';
928
+ while(preg_match($remove_relatives,$path)){
929
+ $path = preg_replace($remove_relatives, '', $path);
930
+ }
931
+ //if any remain use PHP realpath to strip them out, otherwise return $path
932
+ //if using realpath, any symlinks will also be resolved
933
+ return preg_match('#^\.\./|/\.\./#', $path) ? realpath($path) : $path;
934
+ }
935
+ protected function toDelete($name){
936
+ $this->debug(3, "Scheduling file $name to delete on destruct.");
937
+ $this->toDeletes[] = $name;
938
+ }
939
+ protected function serveWebshot(){
940
+ $this->debug(3, "Starting serveWebshot");
941
+ $instr = "Please follow the instructions at http://code.google.com/p/timthumb/ to set your server up for taking website screenshots.";
942
+ if(! is_file(WEBSHOT_CUTYCAPT)){
943
+ return $this->error("CutyCapt is not installed. $instr");
944
+ }
945
+ if(! is_file(WEBSHOT_XVFB)){
946
+ return $this->Error("Xvfb is not installed. $instr");
947
+ }
948
+ $cuty = WEBSHOT_CUTYCAPT;
949
+ $xv = WEBSHOT_XVFB;
950
+ $screenX = WEBSHOT_SCREEN_X;
951
+ $screenY = WEBSHOT_SCREEN_Y;
952
+ $colDepth = WEBSHOT_COLOR_DEPTH;
953
+ $format = WEBSHOT_IMAGE_FORMAT;
954
+ $timeout = WEBSHOT_TIMEOUT * 1000;
955
+ $ua = WEBSHOT_USER_AGENT;
956
+ $jsOn = WEBSHOT_JAVASCRIPT_ON ? 'on' : 'off';
957
+ $javaOn = WEBSHOT_JAVA_ON ? 'on' : 'off';
958
+ $pluginsOn = WEBSHOT_PLUGINS_ON ? 'on' : 'off';
959
+ $proxy = WEBSHOT_PROXY ? ' --http-proxy=' . WEBSHOT_PROXY : '';
960
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb_webshot');
961
+ $url = $this->src;
962
+ if(! preg_match('/^https?:\/\/[a-zA-Z0-9\.\-]+/i', $url)){
963
+ return $this->error("Invalid URL supplied.");
964
+ }
965
+ $url = preg_replace('/[^A-Za-z0-9\-\.\_:\/\?\&\+\;\=]+/', '', $url); //RFC 3986 plus ()$ chars to prevent exploit below. Plus the following are also removed: @*!~#[]',
966
+ // 2014 update by Mark Maunder: This exploit: http://cxsecurity.com/issue/WLB-2014060134
967
+ // uses the $(command) shell execution syntax to execute arbitrary shell commands as the web server user.
968
+ // So we're now filtering out the characters: '$', '(' and ')' in the above regex to avoid this.
969
+ // We are also filtering out chars rarely used in URLs but legal accoring to the URL RFC which might be exploitable. These include: @*!~#[]',
970
+ // We're doing this because we're passing this URL to the shell and need to make very sure it's not going to execute arbitrary commands.
971
+ if(WEBSHOT_XVFB_RUNNING){
972
+ putenv('DISPLAY=:100.0');
973
+ $command = "$cuty $proxy --max-wait=$timeout --user-agent=\"$ua\" --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\"$url\" --out-format=$format --out=$tempfile";
974
+ } else {
975
+ $command = "$xv --server-args=\"-screen 0, {$screenX}x{$screenY}x{$colDepth}\" $cuty $proxy --max-wait=$timeout --user-agent=\"$ua\" --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\"$url\" --out-format=$format --out=$tempfile";
976
+ }
977
+ $this->debug(3, "Executing command: $command");
978
+ $out = `$command`;
979
+ $this->debug(3, "Received output: $out");
980
+ if(! is_file($tempfile)){
981
+ $this->set404();
982
+ return $this->error("The command to create a thumbnail failed.");
983
+ }
984
+ $this->cropTop = true;
985
+ if($this->processImageAndWriteToCache($tempfile)){
986
+ $this->debug(3, "Image processed succesfully. Serving from cache");
987
+ return $this->serveCacheFile();
988
+ } else {
989
+ return false;
990
+ }
991
+ }
992
+ protected function serveExternalImage(){
993
+ if(! preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)){
994
+ $this->error("Invalid URL supplied.");
995
+ return false;
996
+ }
997
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb');
998
+ $this->debug(3, "Fetching external image into temporary file $tempfile");
999
+ $this->toDelete($tempfile);
1000
+ #fetch file here
1001
+ if(! $this->getURL($this->src, $tempfile)){
1002
+ @unlink($this->cachefile);
1003
+ touch($this->cachefile);
1004
+ $this->debug(3, "Error fetching URL: " . $this->lastURLError);
1005
+ $this->error("Error reading the URL you specified from remote host." . $this->lastURLError);
1006
+ return false;
1007
+ }
1008
+
1009
+ $mimeType = $this->getMimeType($tempfile);
1010
+ if(! preg_match("/^image\/(?:jpg|jpeg|gif|png)$/i", $mimeType)){
1011
+ $this->debug(3, "Remote file has invalid mime type: $mimeType");
1012
+ @unlink($this->cachefile);
1013
+ touch($this->cachefile);
1014
+ $this->error("The remote file is not a valid image. Mimetype = '" . $mimeType . "'" . $tempfile);
1015
+ return false;
1016
+ }
1017
+ if($this->processImageAndWriteToCache($tempfile)){
1018
+ $this->debug(3, "Image processed succesfully. Serving from cache");
1019
+ return $this->serveCacheFile();
1020
+ } else {
1021
+ return false;
1022
+ }
1023
+ }
1024
+ public static function curlWrite($h, $d){
1025
+ fwrite(self::$curlFH, $d);
1026
+ self::$curlDataWritten += strlen($d);
1027
+ if(self::$curlDataWritten > MAX_FILE_SIZE){
1028
+ return 0;
1029
+ } else {
1030
+ return strlen($d);
1031
+ }
1032
+ }
1033
+ protected function serveCacheFile(){
1034
+ $this->debug(3, "Serving {$this->cachefile}");
1035
+ if(! is_file($this->cachefile)){
1036
+ $this->error("serveCacheFile called in timthumb but we couldn't find the cached file.");
1037
+ return false;
1038
+ }
1039
+ $fp = fopen($this->cachefile, 'rb');
1040
+ if(! $fp){ return $this->error("Could not open cachefile."); }
1041
+ fseek($fp, strlen($this->filePrependSecurityBlock), SEEK_SET);
1042
+ $imgType = fread($fp, 3);
1043
+ fseek($fp, 3, SEEK_CUR);
1044
+ if(ftell($fp) != strlen($this->filePrependSecurityBlock) + 6){
1045
+ @unlink($this->cachefile);
1046
+ return $this->error("The cached image file seems to be corrupt.");
1047
+ }
1048
+ $imageDataSize = filesize($this->cachefile) - (strlen($this->filePrependSecurityBlock) + 6);
1049
+ $this->sendImageHeaders($imgType, $imageDataSize);
1050
+ $bytesSent = @fpassthru($fp);
1051
+ fclose($fp);
1052
+ if($bytesSent > 0){
1053
+ return true;
1054
+ }
1055
+ $content = file_get_contents ($this->cachefile);
1056
+ if ($content != FALSE) {
1057
+ $content = substr($content, strlen($this->filePrependSecurityBlock) + 6);
1058
+ echo $content;
1059
+ $this->debug(3, "Served using file_get_contents and echo");
1060
+ return true;
1061
+ } else {
1062
+ $this->error("Cache file could not be loaded.");
1063
+ return false;
1064
+ }
1065
+ }
1066
+ protected function sendImageHeaders($mimeType, $dataSize){
1067
+ if(! preg_match('/^image\//i', $mimeType)){
1068
+ $mimeType = 'image/' . $mimeType;
1069
+ }
1070
+ if(strtolower($mimeType) == 'image/jpg'){
1071
+ $mimeType = 'image/jpeg';
1072
+ }
1073
+ $gmdate_expires = gmdate ('D, d M Y H:i:s', strtotime ('now +10 days')) . ' GMT';
1074
+ $gmdate_modified = gmdate ('D, d M Y H:i:s') . ' GMT';
1075
+ // send content headers then display image
1076
+ header ('Content-Type: ' . $mimeType);
1077
+ header ('Accept-Ranges: none'); //Changed this because we don't accept range requests
1078
+ header ('Last-Modified: ' . $gmdate_modified);
1079
+ header ('Content-Length: ' . $dataSize);
1080
+ if(BROWSER_CACHE_DISABLE){
1081
+ $this->debug(3, "Browser cache is disabled so setting non-caching headers.");
1082
+ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
1083
+ header("Pragma: no-cache");
1084
+ header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
1085
+ } else {
1086
+ $this->debug(3, "Browser caching is enabled");
1087
+ header('Cache-Control: max-age=' . BROWSER_CACHE_MAX_AGE . ', must-revalidate');
1088
+ header('Expires: ' . $gmdate_expires);
1089
+ }
1090
+ return true;
1091
+ }
1092
+ protected function securityChecks(){
1093
+ }
1094
+ protected function param($property, $default = ''){
1095
+ if (isset ($_GET[$property])) {
1096
+ return $_GET[$property];
1097
+ } else {
1098
+ return $default;
1099
+ }
1100
+ }
1101
+ protected function openImage($mimeType, $src){
1102
+ switch ($mimeType) {
1103
+ case 'image/jpeg':
1104
+ $image = imagecreatefromjpeg ($src);
1105
+ break;
1106
+
1107
+ case 'image/png':
1108
+ $image = imagecreatefrompng ($src);
1109
+ imagealphablending( $image, true );
1110
+ imagesavealpha( $image, true );
1111
+ break;
1112
+
1113
+ case 'image/gif':
1114
+ $image = imagecreatefromgif ($src);
1115
+ break;
1116
+
1117
+ default:
1118
+ $this->error("Unrecognised mimeType");
1119
+ }
1120
+
1121
+ return $image;
1122
+ }
1123
+ protected function getIP(){
1124
+ $rem = @$_SERVER["REMOTE_ADDR"];
1125
+ $ff = @$_SERVER["HTTP_X_FORWARDED_FOR"];
1126
+ $ci = @$_SERVER["HTTP_CLIENT_IP"];
1127
+ if(preg_match('/^(?:192\.168|172\.16|10\.|127\.)/', $rem)){
1128
+ if($ff){ return $ff; }
1129
+ if($ci){ return $ci; }
1130
+ return $rem;
1131
+ } else {
1132
+ if($rem){ return $rem; }
1133
+ if($ff){ return $ff; }
1134
+ if($ci){ return $ci; }
1135
+ return "UNKNOWN";
1136
+ }
1137
+ }
1138
+ protected function debug($level, $msg){
1139
+ if(DEBUG_ON && $level <= DEBUG_LEVEL){
1140
+ $execTime = sprintf('%.6f', microtime(true) - $this->startTime);
1141
+ $tick = sprintf('%.6f', 0);
1142
+ if($this->lastBenchTime > 0){
1143
+ $tick = sprintf('%.6f', microtime(true) - $this->lastBenchTime);
1144
+ }
1145
+ $this->lastBenchTime = microtime(true);
1146
+ error_log("TimThumb Debug line " . __LINE__ . " [$execTime : $tick]: $msg");
1147
+ }
1148
+ }
1149
+ protected function sanityFail($msg){
1150
+ return $this->error("There is a problem in the timthumb code. Message: Please report this error at <a href='http://code.google.com/p/timthumb/issues/list'>timthumb's bug tracking page</a>: $msg");
1151
+ }
1152
+ protected function getMimeType($file){
1153
+ $info = getimagesize($file);
1154
+ if(is_array($info) && $info['mime']){
1155
+ return $info['mime'];
1156
+ }
1157
+ return '';
1158
+ }
1159
+ protected function setMemoryLimit(){
1160
+ $inimem = ini_get('memory_limit');
1161
+ $inibytes = timthumb::returnBytes($inimem);
1162
+ $ourbytes = timthumb::returnBytes(MEMORY_LIMIT);
1163
+ if($inibytes < $ourbytes){
1164
+ ini_set ('memory_limit', MEMORY_LIMIT);
1165
+ $this->debug(3, "Increased memory from $inimem to " . MEMORY_LIMIT);
1166
+ } else {
1167
+ $this->debug(3, "Not adjusting memory size because the current setting is " . $inimem . " and our size of " . MEMORY_LIMIT . " is smaller.");
1168
+ }
1169
+ }
1170
+ protected static function returnBytes($size_str){
1171
+ switch (substr ($size_str, -1))
1172
+ {
1173
+ case 'M': case 'm': return (int)$size_str * 1048576;
1174
+ case 'K': case 'k': return (int)$size_str * 1024;
1175
+ case 'G': case 'g': return (int)$size_str * 1073741824;
1176
+ default: return $size_str;
1177
+ }
1178
+ }
1179
+
1180
+ protected function getURL($url, $tempfile){
1181
+ $this->lastURLError = false;
1182
+ $url = preg_replace('/ /', '%20', $url);
1183
+ if(function_exists('curl_init')){
1184
+ $this->debug(3, "Curl is installed so using it to fetch URL.");
1185
+ self::$curlFH = fopen($tempfile, 'w');
1186
+ if(! self::$curlFH){
1187
+ $this->error("Could not open $tempfile for writing.");
1188
+ return false;
1189
+ }
1190
+ self::$curlDataWritten = 0;
1191
+ $this->debug(3, "Fetching url with curl: $url");
1192
+ $curl = curl_init($url);
1193
+ curl_setopt ($curl, CURLOPT_TIMEOUT, CURL_TIMEOUT);
1194
+ curl_setopt ($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30");
1195
+ curl_setopt ($curl, CURLOPT_RETURNTRANSFER, TRUE);
1196
+ curl_setopt ($curl, CURLOPT_HEADER, 0);
1197
+ curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
1198
+ curl_setopt ($curl, CURLOPT_WRITEFUNCTION, 'timthumb::curlWrite');
1199
+ @curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, true);
1200
+ @curl_setopt ($curl, CURLOPT_MAXREDIRS, 10);
1201
+
1202
+ $curlResult = curl_exec($curl);
1203
+ fclose(self::$curlFH);
1204
+ $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
1205
+ if($httpStatus == 404){
1206
+ $this->set404();
1207
+ }
1208
+ if($httpStatus == 302){
1209
+ $this->error("External Image is Redirecting. Try alternate image url");
1210
+ return false;
1211
+ }
1212
+ if($curlResult){
1213
+ curl_close($curl);
1214
+ return true;
1215
+ } else {
1216
+ $this->lastURLError = curl_error($curl);
1217
+ curl_close($curl);
1218
+ return false;
1219
+ }
1220
+ } else {
1221
+ $img = @file_get_contents ($url);
1222
+ if($img === false){
1223
+ $err = error_get_last();
1224
+ if(is_array($err) && $err['message']){
1225
+ $this->lastURLError = $err['message'];
1226
+ } else {
1227
+ $this->lastURLError = $err;
1228
+ }
1229
+ if(preg_match('/404/', $this->lastURLError)){
1230
+ $this->set404();
1231
+ }
1232
+
1233
+ return false;
1234
+ }
1235
+ if(! file_put_contents($tempfile, $img)){
1236
+ $this->error("Could not write to $tempfile.");
1237
+ return false;
1238
+ }
1239
+ return true;
1240
+ }
1241
+
1242
+ }
1243
+ protected function serveImg($file){
1244
+ $s = getimagesize($file);
1245
+ if(! ($s && $s['mime'])){
1246
+ return false;
1247
+ }
1248
+ header ('Content-Type: ' . $s['mime']);
1249
+ header ('Content-Length: ' . filesize($file) );
1250
+ header ('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
1251
+ header ("Pragma: no-cache");
1252
+ $bytes = @readfile($file);
1253
+ if($bytes > 0){
1254
+ return true;
1255
+ }
1256
+ $content = @file_get_contents ($file);
1257
+ if ($content != FALSE){
1258
+ echo $content;
1259
+ return true;
1260
+ }
1261
+ return false;
1262
+
1263
+ }
1264
+ protected function set404(){
1265
+ $this->is404 = true;
1266
+ }
1267
+ protected function is404(){
1268
+ return $this->is404;
1269
+ }
1270
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_applications';
7
+ $this->_blockGroup = 'mobiadmin';
8
+ $this->_headerText = Mage::helper('mobiadmin')->__('Manage Mobile Apps');
9
+ parent::__construct();
10
+ $this->_removeButton('add');
11
+ $this->_addButton('btnAdd', array(
12
+ 'label' => Mage::helper('mobiadmin')->__('Create New Mobile App'),
13
+ 'onclick' => "setLocation('" . $this->getUrl('*/*/new', array('page_key' => 'collection')) . "')",
14
+ 'class' => 'add'
15
+ ));
16
+ }
17
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+
8
+ parent::__construct();
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'mobiadmin';
11
+ $this->_controller = 'adminhtml_applications';
12
+ $this->_updateButton('save', 'label','Save');
13
+ $this->_removeButton('delete');
14
+ }
15
+
16
+ public function getHeaderText()
17
+ {
18
+ if( Mage::registry('application_data') && Mage::registry('application_data')->getId())
19
+ {
20
+ return $this->__('Edit App Settings - ').$this->htmlEscape(
21
+ Mage::registry('application_data')->getAppName()).'<br />';
22
+ }
23
+ else
24
+ {
25
+ return 'Add a application';
26
+ }
27
+ }
28
+ protected function _prepareLayout()
29
+ {
30
+ parent::_prepareLayout();
31
+ if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
32
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
33
+ }
34
+ }
35
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Form.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ 'id' => 'edit_form',
8
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
9
+ 'method' => 'post',
10
+ 'enctype' => 'multipart/form-data',
11
+ )
12
+ );
13
+ $form->setUseContainer(true);
14
+ $this->setForm($form);
15
+ return parent::_prepareForm();
16
+ }
17
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Banners.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Banners extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->setTemplate('mobiadmin/application/edit/tab/banner.phtml');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Cms.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Cms extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+
5
+ public function __construct()
6
+ {
7
+ $this->setTemplate('mobiadmin/application/edit/tab/cms.phtml');
8
+ }
9
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Form.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form();
7
+ $this->setForm($form);
8
+ //Configure the store section
9
+ //$fieldset = $form->addFieldset('application_data', array('legend'=>$this->__('Configure The Store')));
10
+ $applicationData = Mage::registry('application_data');
11
+ $storeId = $applicationData->getAppStoreid();
12
+ $applicationCode = $applicationData->getAppCode();
13
+ $applicationKey = $applicationData->getAppKey();
14
+
15
+ /*$fieldset->addField('ddlStore', 'select', array(
16
+ 'label' => Mage::helper('mobiadmin')->__('Select Your Store'),
17
+ 'required' => false,
18
+ 'name' => 'store[ddlStore]',
19
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
20
+ 'after_element_html' => '<small>Select the store which you want to connect with the mobile app. Mobi Commerce mobile app supports single store only. </small>',
21
+ 'value' => $storeId,
22
+ ));*/
23
+
24
+
25
+ //Push Notification section
26
+ $fieldset = $form->addFieldset('pushnotification', array('legend'=>$this->__('Push Notification')));
27
+
28
+ $fieldset->addField('appcode', 'hidden', array(
29
+ 'name' => 'appcode',
30
+ 'value' => $applicationCode,
31
+ 'disabled' => false,
32
+ ));
33
+
34
+ $fieldset->addField('ddlStore', 'hidden', array(
35
+ 'name' => 'ddlStore',
36
+ 'value' => $storeId,
37
+ ));
38
+
39
+ $fieldset->addField('appkey', 'hidden', array(
40
+ 'name' => 'appkey',
41
+ 'value' => $applicationKey,
42
+ 'disabled' => false,
43
+ ));
44
+
45
+ $fieldset->addField('appcodeid', 'hidden', array(
46
+ 'name' => 'appid',
47
+ 'value' => Mage::app()->getRequest()->getParam('id'),
48
+ 'disabled' => false,
49
+ ));
50
+ $collection = Mage::getModel('mobiadmin/appsetting')->getCollection();
51
+ $pushnotiCollection = $collection->addFieldToFilter('app_code',$applicationCode)->addFieldToFilter('setting_code','push_notification');
52
+
53
+
54
+ $PushData = $pushnotiCollection->getData();
55
+ $PushData = $PushData['0'];
56
+ $PushDatas= $PushData['value'];
57
+
58
+ $pushDataValues = Mage::helper('mobiadmin')->_jsonUnserialize($PushDatas);
59
+ if($pushDataValues['active_push_notification']){
60
+ $activeNotification = true;
61
+ }else{
62
+ $activeNotification = false;
63
+ }
64
+ if($pushDataValues['sandboxmode']){
65
+ $activeSandBoxMode = true;
66
+ }else{
67
+ $activeSandBoxMode = false;
68
+ }
69
+ $fieldset->addField('active_push_notification', 'checkbox', array(
70
+ 'label' => Mage::helper('mobiadmin')->__('Activate Push Notification'),
71
+ 'name' => 'pushnotification[active_push_notification]',
72
+ 'value' => '1' ,
73
+ 'checked' => $activeNotification,
74
+ 'disabled' => false,
75
+ ));
76
+
77
+ $fieldset->addField('sandboxmode', 'checkbox', array(
78
+ 'label' => Mage::helper('mobiadmin')->__('Sandbox mode'),
79
+ 'name' => 'pushnotification[sandboxmode]',
80
+ 'value' => '1',
81
+ 'checked' => $activeSandBoxMode,
82
+ 'disabled' => false,
83
+ 'after_element_html' => '<br><small>'.$this->__('Please Make sure your 2195 port is open to send IOS push notifications.').'</small>',
84
+ ));
85
+
86
+ $fieldset->addField('android_key', 'text', array(
87
+ 'label' => Mage::helper('mobiadmin')->__('GCM API Key'),
88
+ 'name' => 'pushnotification[android_key]',
89
+ 'value' => $pushDataValues['android_key'],
90
+ ));
91
+
92
+ $fieldset->addField('android_sender_id', 'text', array(
93
+ 'label' => Mage::helper('mobiadmin')->__('Google API Project Number'),
94
+ 'name' => 'pushnotification[android_sender_id]',
95
+ 'value' => $pushDataValues['android_sender_id'],
96
+ ));
97
+
98
+ $fieldset->addField('upload_iospem_file', 'image', array(
99
+ 'label' => Mage::helper('mobiadmin')->__('Upload iOS PEM file'),
100
+ 'required' => false,
101
+ 'name' => 'upload_iospem_file',
102
+ 'value' => $pushDataValues['upload_iospem_file_url'],
103
+ ));
104
+
105
+ if(!empty($pushDataValues['upload_iospem_file']))
106
+ {
107
+ $fieldset->addField('note', 'note', array(
108
+ 'label' =>'',
109
+ 'text' => $pushDataValues['upload_iospem_file'],
110
+ ));
111
+ }
112
+ $fieldset->addField('appfilename', 'hidden', array(
113
+ 'name' => 'upload_iospem_file_name',
114
+ 'value' => $pushDataValues['upload_iospem_file'],
115
+ 'disabled' => false,
116
+ ));
117
+
118
+ $fieldset->addField('pem_password', 'password', array(
119
+ 'label' => Mage::helper('mobiadmin')->__('PEM Password'),
120
+ 'name' => 'pushnotification[pem_password]',
121
+ 'value' => $pushDataValues['pem_password'],
122
+ ));
123
+
124
+ //Application Iformation
125
+ $fieldset = $form->addFieldset('app_info', array('legend'=>$this->__('Application Information')));
126
+
127
+ $collection = Mage::getModel('mobiadmin/appsetting')->getCollection();
128
+ $appinfoCollection = $collection->addFieldToFilter('app_code',$applicationCode)->addFieldToFilter('setting_code','appinfo');
129
+
130
+ $appInfoData = $appinfoCollection->getData();
131
+ $appInfoData = $appInfoData['0'];
132
+ $allAppInfo = $appInfoData['value'];
133
+
134
+ $allAppInfoValues = Mage::helper('mobiadmin')->_jsonUnserialize($allAppInfo);
135
+
136
+
137
+ $fieldset->addField('android_appname', 'text', array(
138
+ 'label' => Mage::helper('mobiadmin')->__('App Name on Google Play Store'),
139
+ 'name' => 'appinfo[android_appname]',
140
+ 'value' => $allAppInfoValues['android_appname'],
141
+ ));
142
+
143
+ $fieldset->addField('android_appweburl', 'text', array(
144
+ 'label' => Mage::helper('mobiadmin')->__('App URL on Google Play Store'),
145
+ 'name' => 'appinfo[android_appweburl]',
146
+ 'value' => $allAppInfoValues['android_appweburl'],
147
+ ));
148
+
149
+ $fieldset->addField('ios_appname', 'text', array(
150
+ 'label' => Mage::helper('mobiadmin')->__('App Name on Apple Store'),
151
+ 'name' => 'appinfo[ios_appname]',
152
+ 'value' => $allAppInfoValues['ios_appname'],
153
+ ));
154
+
155
+ $fieldset->addField('ios_appweburl', 'text', array(
156
+ 'label' => Mage::helper('mobiadmin')->__('App URL on Apple Store'),
157
+ 'name' => 'appinfo[ios_appweburl]',
158
+ 'value' => $allAppInfoValues['ios_appweburl'],
159
+ ));
160
+
161
+ $fieldset->addField('app_description', 'textarea', array(
162
+ 'label' => Mage::helper('mobiadmin')->__('Application Description'),
163
+ 'name' => 'appinfo[app_description]',
164
+ 'value' => $allAppInfoValues['app_description'],
165
+ ));
166
+
167
+ $fieldset->addField('app_share_image', 'image', array(
168
+ 'label' => Mage::helper('mobiadmin')->__('Application Image'),
169
+ 'required' => false,
170
+ 'name' => 'app_share_image',
171
+ 'value' => $allAppInfoValues['app_share_image'],
172
+ ));
173
+
174
+ /* if ( Mage::registry('application_data') )
175
+ {
176
+ $form->setValues(Mage::registry('application_data')->getData());
177
+ }*/
178
+ return parent::_prepareForm();
179
+ }
180
+
181
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Icon.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Icon extends Mage_Adminhtml_Block_Template
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setTemplate('mobiadmin/application/edit/tab/icon.phtml');
8
+ }
9
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Labels.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Labels extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form();
7
+ $this->setForm($form);
8
+ $fieldset = $form->addFieldset('application_data', array('legend'=>$this->__('Label')));
9
+
10
+ $applicationData = Mage::registry('application_data');
11
+
12
+ $storeId = $applicationData->getAppStoreid();
13
+
14
+ $storelang = Mage::getStoreConfig('general/locale/code',$storeId);
15
+
16
+ $collection = Mage::getModel('mobiadmin/multilanguage')->getCollection()->addFieldToFilter('mm_type','label')->addFieldToFilter('mm_language_code',$storelang);
17
+ $labels = $collection->getData();
18
+
19
+ foreach ( $labels as $label) {
20
+ $fieldset->addField('message-label'.$label['mm_id'], 'text', array(
21
+ 'label' => Mage::helper('mobiadmin')->__($label['mm_label']),
22
+ 'required' => false,
23
+ //'name' => 'language_data'.$label['mm_type'],
24
+ 'name' => "language_data[".$label['mm_id']."]",
25
+ 'value' => $label['mm_text'],
26
+ 'maxlength' => $label['mm_maxlength'],
27
+ ));
28
+ }
29
+
30
+ $fieldset2 = $form->addFieldset('', array('legend'=>$this->__('Message')));
31
+ $collection = Mage::getModel('mobiadmin/multilanguage')->getCollection()->addFieldToFilter('mm_type','message')->addFieldToFilter('mm_language_code',$storelang);
32
+
33
+ $labels = $collection->getData();
34
+
35
+ foreach ( $labels as $label) {
36
+ $fieldset2->addField('message-label'.$label['mm_id'], 'text', array(
37
+ 'label' => Mage::helper('mobiadmin')->__($label['mm_label']),
38
+ 'required' => false,
39
+ //'name' => 'language_data'.$label['mm_type'],
40
+ 'name' => "language_data[".$label['mm_id']."]",
41
+ 'value' => $label['mm_text'],
42
+ 'maxlength' => $label['mm_maxlength'],
43
+ ));
44
+ }
45
+
46
+ }
47
+
48
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Overview.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Overview extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setTemplate('mobiadmin/application/edit/tab/overview.phtml');
8
+ }
9
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Personalization.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Personalization extends Mage_Adminhtml_Block_Template
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setTemplate('mobiadmin/application/edit/tab/personalization.phtml');
8
+ }
9
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Popup.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Popup extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form();
7
+ $this->setForm($form);
8
+ $fieldset = $form->addFieldset('mobile_data', array('legend'=>$this->__('Mobicommerce Mobile Enable Module')));
9
+ $EnableRedirect = Mage::getStoreConfig('mobimobileredirect/isactive_group/isactive_value');
10
+ if($EnableRedirect == 0){
11
+ $ShowSettting ='Disable';
12
+ }else{
13
+ $ShowSettting ='Enable';
14
+ }
15
+ $fieldset->addField('note', 'note', array(
16
+ 'label' => Mage::helper('mobiadmin')->__('Enable Module'),
17
+ 'text' => Mage::helper('mobiadmin')->__($ShowSettting),
18
+ ));
19
+
20
+ $fieldset = $form->addFieldset('application_data', array('legend'=>$this->__('Pop Up Setting')));
21
+ $applicationData = Mage::registry('application_data');
22
+ $applicationCode = $applicationData->getAppCode();
23
+
24
+ $appPopUpCollection = Mage::getModel('mobiadmin/appsetting')->getCollection();
25
+ $appPopUpCollection = $appPopUpCollection
26
+ ->addFieldToFilter('app_code',$applicationCode)
27
+ ->addFieldToFilter('setting_code','popup_setting');
28
+ $appPopUpData = $appPopUpCollection->getFirstItem();
29
+ $appPopUpValues = $appPopUpData->getValue();
30
+ $appPopUpValues = Mage::helper('mobiadmin')->_jsonUnserialize($appPopUpValues);
31
+
32
+ $fieldset->addField('popup_enable', 'select', array(
33
+ 'label' => Mage::helper('mobiadmin')->__('Enable Pop Up'),
34
+ 'name' => 'popup[enable]',
35
+ 'options' => array(
36
+ 0 => Mage::helper('adminhtml')->__('No'),
37
+ 1 => Mage::helper('adminhtml')->__('Yes'),
38
+ ),
39
+ 'value' => $appPopUpValues['enable'],
40
+ ));
41
+
42
+ $fieldset->addField('popupimage', 'image', array(
43
+ 'label' => Mage::helper('mobiadmin')->__('Upload Pop Up Image'),
44
+ 'required' => false,
45
+ 'name' => 'popupimage',
46
+ 'value' => $appPopUpValues['popupimage'],
47
+ ));
48
+
49
+ $fieldset->addField('popupimage_hidden', 'hidden', array(
50
+ 'required' => false,
51
+ 'name' => 'popupimage_hidden',
52
+ 'value' => $appPopUpValues['popupimage'],
53
+ ));
54
+
55
+ $fieldset->addField('cookietime', 'text', array(
56
+ 'label' => Mage::helper('mobiadmin')->__('Set Pop Up Cookie Time'),
57
+ 'required' => false,
58
+ 'name' => 'popup[cookietime]',
59
+ 'value' => $appPopUpValues['cookietime'],
60
+ 'after_element_html' => '<small>'.$this->__('Cookies Lifetime in Seconds.').'</small>',
61
+ ));
62
+ }
63
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Productslider.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Productslider extends Mage_Adminhtml_Block_Template
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setTemplate('mobiadmin/application/edit/tab/productslider.phtml');
8
+ }
9
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tab/Pushnotifications.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tab_Pushnotifications extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form();
7
+ $this->setForm($form);
8
+ $fieldset = $form->addFieldset('push_notification', array('legend'=>$this->__('Push Notifications')));
9
+ $applicationData = Mage::registry('application_data');
10
+ $storeId = $applicationData->getId();
11
+ $applicationCode = $applicationData->getAppCode();
12
+
13
+ $collection = Mage::getModel('mobiadmin/appsetting')->getCollection();
14
+ $pushnotiCollection = $collection->addFieldToFilter('app_code',$applicationCode)->addFieldToFilter('setting_code','pushnotifications_settings');
15
+ $PushData = $pushnotiCollection->getData();
16
+ $PushData = $PushData['0'];
17
+ $PushValue = $PushData['value'];
18
+
19
+ $fieldset->addField('note', 'note', array(
20
+ 'text' => Mage::helper('mobiadmin')->__($this->__('Send push notification to users. Enter the message and send to all users who are using the App.')),
21
+ ));
22
+
23
+ $fieldset->addField('pushnotifications', 'textarea', array(
24
+ 'label' => Mage::helper('mobiadmin')->__($this->__('Push Notifications')),
25
+ 'name' => 'pushnotifications',
26
+ 'value' => $PushValue,
27
+ 'maxlength' => '255',
28
+ 'rows' => '3',
29
+ 'after_element_html' => '<br><small>'.$this->__('Notification Maximum Text Length is 255 Characters').'</small>',
30
+ ));
31
+ }
32
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Edit/Tabs.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
3
+ {
4
+ public function __construct()
5
+ {
6
+
7
+ parent::__construct();
8
+ $this->setId('application_data');
9
+ $this->setDestElementId('edit_form');
10
+ $this->setTitle($this->__('App Settings'));
11
+ }
12
+ protected function _beforeToHtml()
13
+ {
14
+
15
+ $this->addTab('overview', array(
16
+ 'label' => $this->__('Overview'),
17
+ 'title' => $this->__('Overview'),
18
+ 'content' => $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_overview')->toHtml()
19
+ ));
20
+
21
+ $this->addTab('general_settings', array(
22
+ 'label' => $this->__('General Settings'),
23
+ 'title' => $this->__('General Settings'),
24
+ 'content' => $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_form')->toHtml()
25
+ ));
26
+
27
+ $this->addTab('theme_personalization', array(
28
+ 'label' => $this->__('Theme Personalization'),
29
+ 'title' => $this->__('Theme Personalization'),
30
+ 'content' => $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_personalization')->toHtml()
31
+ ));
32
+
33
+ $this->addTab('banners', array(
34
+ 'label' => $this->__('Banners'),
35
+ 'title' => $this->__('Banners'),
36
+ 'content' => $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_banners')->toHtml()
37
+ ));
38
+
39
+ $this->addTab('labels_message', array(
40
+ 'label' => $this->__('Labels and Messages'),
41
+ 'title' => $this->__('Labels and Messages'),
42
+ 'content' => $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_labels')->toHtml()
43
+ ));
44
+
45
+ $this->addTab('cms_contents', array(
46
+ 'label' => $this->__('CMS Contents'),
47
+ 'title' => $this->__('CMS Contents'),
48
+ 'content' => $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_cms')->toHtml()
49
+ ));
50
+
51
+ $this->addTab('push_notification', array(
52
+ 'label' => $this->__('Push Notifications'),
53
+ 'title' => $this->__('Push Notifications'),
54
+ 'content' => $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_pushnotifications')->toHtml()
55
+ ));
56
+
57
+
58
+ $this->addTab('product_sliders', array(
59
+ 'label' => $this->__('Product Sliders'),
60
+ 'title' => $this->__('Product Sliders'),
61
+ 'content' => $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_productslider')->toHtml()
62
+ ));
63
+
64
+ $this->addTab('category_icons', array(
65
+ 'label' => $this->__('Category Icons'),
66
+ 'title' => $this->__('Category Icons'),
67
+ 'url' => $this->getUrl('*/*/icons', array('_current' => true)),
68
+ 'class' => 'ajax',
69
+ ));
70
+
71
+ $this->addTab('mobile_website_settings', array(
72
+ 'label' => $this->__('Mobile Website Settings'),
73
+ 'title' => $this->__('Mobile Website Settings'),
74
+ 'content' => $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_popup')->toHtml()
75
+ ));
76
+
77
+ return parent::_beforeToHtml();
78
+ }
79
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId('id');
8
+ $this->setDefaultSort('id');
9
+ $this->setDefaultDir('ASC');
10
+ $this->setSaveParametersInSession(true);
11
+
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('mobiadmin/applications')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('id', array(
24
+ 'header' => Mage::helper('mobiadmin')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '10px',
27
+ 'index' => 'id',
28
+ 'filter' => false,
29
+ ));
30
+
31
+ $this->addColumn('app_name', array(
32
+ 'header' => Mage::helper('mobiadmin')->__('App Name'),
33
+ 'align' =>'left',
34
+ 'index' => 'app_name',
35
+ 'width' => '50px',
36
+ ));
37
+
38
+
39
+ /*$this->addColumn('app_store', array(
40
+ 'header' => Mage::helper('mobiadmin')->__($this->__('Application Store')),
41
+ 'width' => '150px',
42
+ 'index' => 'app_storeid',
43
+ 'renderer' => 'Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_Store',
44
+ 'filter' => false,
45
+ ));*/
46
+
47
+ $this->addColumn('app_key', array(
48
+ 'header' => Mage::helper('mobiadmin')->__('App Key'),
49
+ 'width' => '150px',
50
+ 'index' => 'app_key',
51
+ ));
52
+
53
+ $this->addColumn('license_type', array(
54
+ 'header' => Mage::helper('mobiadmin')->__('License Type'),
55
+ 'width' => '150px',
56
+ 'index' => 'app_mode',
57
+ 'renderer' => 'Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_Licence',
58
+ 'filter' => false,
59
+ ));
60
+
61
+ $this->addColumn('android_status', array(
62
+ 'header' => Mage::helper('mobiadmin')->__('Android Status'),
63
+ 'width' => '150px',
64
+ 'index' => 'android_url',
65
+ 'renderer' => 'Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_AndroidStatus',
66
+ 'filter' => false,
67
+ ));
68
+
69
+ $this->addColumn('ios_status', array(
70
+ 'header' => Mage::helper('mobiadmin')->__('iOS Status'),
71
+ 'width' => '150px',
72
+ 'index' => 'ios_url',
73
+ 'renderer' => 'Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_IosStatus',
74
+ 'filter' => false,
75
+ ));
76
+
77
+ $this->addColumn('action',
78
+ array(
79
+ 'header' => Mage::helper('mobiadmin')->__('Action'),
80
+ 'width' => '100',
81
+ 'type' => 'action',
82
+ 'getter' => 'getId',
83
+ 'sortable' => false,
84
+ 'index' => 'stores',
85
+ 'is_system' => true,
86
+ 'renderer' => 'Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_Action',
87
+ 'filter' => false,
88
+ ));
89
+ return parent::_prepareColumns();
90
+ }
91
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/Action.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $id = $row->getId();
7
+ $mode = $row->getAppMode();
8
+ $appkey = $row->getAppKey();
9
+ $appcode = $row->getAppCode();
10
+ $storeid = $row->getAppStoreid();
11
+ $appName = $row->getAppName();
12
+ $storerooturl = Mage::app()->getStore($storeid)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
13
+ $buyNowUrl = Mage::helper('mobiadmin')->buyNowUrl();
14
+ $themename = Mage::helper('mobiadmin')->getThemeName($appcode);
15
+ $url = Mage::helper('adminhtml')->getUrl('mobicommerce/index/edit', array('id' => $id));
16
+ if($mode == 'live'){
17
+ $out = '<a href="'.$url.'">'.$this->__('Edit').'</a>';
18
+ }else{
19
+ $out = '<form target="_blank" name="buynow" action='.$buyNowUrl.' method="post">
20
+ <a href="'.$url.'">'.$this->__('Edit').'</a>'.
21
+ '<span>&nbsp;&nbsp; &nbsp;</span>'.
22
+ '<input type="hidden" name="app_name" value='.$appName.'>'.
23
+ '<input type="hidden" name="app_preview_code" value='.$appkey.'>'.
24
+ '<input type="hidden" name="app_code" value='.$appcode.'>'.
25
+ '<input type="hidden" name="selectedapp" value="nativeapps">'.
26
+ '<input type="hidden" name="store_rooturl" value='.$storerooturl.'>'.
27
+ '<button>'.$this->__('Buy Now').'</button>
28
+ </form>';
29
+ }
30
+ return $out;
31
+ }
32
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/AndroidStatus.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_AndroidStatus extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $androidStatus = $row->getAndroidStatus();
7
+
8
+ return $androidStatus;
9
+ }
10
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/IosStatus.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_IosStatus extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $iosStatus = $row->getIosStatus();
7
+
8
+ return $iosStatus;
9
+ }
10
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/Licence.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_Licence extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $appMode = $row->getAppMode();
7
+ if(!empty($appMode)){
8
+ $appMode = '<span class="app-mode">'.$appMode.' Version</span>';
9
+ }
10
+ return $appMode;
11
+ }
12
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Applications/Grid/Renderer/Store.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_Store extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $val = $row->getAppStoreid();
7
+ $out = Mage::app()->getStore($val)->getCode();
8
+ return $out;
9
+ }
10
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Menu.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Menu extends Mage_Adminhtml_Block_Page_Menu
3
+ {
4
+ /**
5
+ * Retrieve Adminhtml Menu array
6
+ *
7
+ * @return array
8
+ */
9
+ public function getMenuArray()
10
+ {
11
+ $notificationCount = Mage::helper('mobiadmin')->getCountUnreadNotification();
12
+ $menuArray = $this->_buildMenuArray();
13
+ $mobiadmin = $menuArray['mobiadmin'];
14
+ if(is_array($mobiadmin)) {
15
+ if($notificationCount >= 1) {
16
+ $menuArray['mobiadmin']['mobiclass'] = '<sup class="mobinotify">'.$notificationCount.'</sup>';
17
+ $menuArray['mobiadmin']['children']['appnotification']['mobiclass'] = '<sup class="mobinotify">'.$notificationCount.'</sup>';
18
+ }
19
+ $menuArray['mobiadmin']['children']['appsupport']['click'] = 'window.open(\'http://support.mobi-commerce.net/\');';
20
+
21
+ }
22
+ return $menuArray;
23
+ }
24
+
25
+ public function getMenuLevel($menu, $level = 0)
26
+ {
27
+ $html = '<ul ' . (!$level ? 'id="nav"' : '') . '>' . PHP_EOL;
28
+ foreach ($menu as $item) {
29
+ $html .= '<li ' . (!empty($item['children']) ? 'onmouseover="Element.addClassName(this,\'over\')" '
30
+ . 'onmouseout="Element.removeClassName(this,\'over\')"' : '') . ' class="'
31
+ . (!$level && !empty($item['active']) ? ' active' : '') . ' '
32
+
33
+ . (!empty($item['children']) ? ' parent' : '')
34
+ . (!empty($level) && !empty($item['last']) ? ' last' : '')
35
+ . ' level' . $level . '"> <a href="' . $item['url'] . '" '
36
+ . (!empty($item['title']) ? 'title="' . $item['title'] . '"' : '') . ' '
37
+ . (!empty($item['click']) ? 'onclick="' . $item['click'] . '"' : '') . ' class="'
38
+ . ($level === 0 && !empty($item['active']) ? 'active' : '') .' "><span>'
39
+ . $this->escapeHtml($item['label']).''. (isset($item['mobiclass']) ? $item['mobiclass'] : ''). '</span></a>' . PHP_EOL;
40
+
41
+ if (!empty($item['children'])) {
42
+ $html .= $this->getMenuLevel($item['children'], $level + 1);
43
+ }
44
+ $html .= '</li>' . PHP_EOL;
45
+ }
46
+ $html .= '</ul>' . PHP_EOL;
47
+
48
+ return $html;
49
+ }
50
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Notification extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_notification';
7
+ $this->_blockGroup = 'mobiadmin';
8
+ $this->_headerText = Mage::helper('mobiadmin')->__('Notifications');
9
+ parent::__construct();
10
+ $this->_removeButton('add');
11
+ }
12
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Notification_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId('id');
8
+ $this->setDefaultSort('id');
9
+ $this->setDefaultDir('ASC');
10
+ $this->setSaveParametersInSession(true);
11
+ }
12
+
13
+ protected function _prepareCollection()
14
+ {
15
+ $collection = Mage::getModel('mobiadmin/notification')->getCollection();
16
+ $this->setCollection($collection);
17
+ return parent::_prepareCollection();
18
+ }
19
+
20
+ protected function _prepareColumns()
21
+ {
22
+ $this->addColumn('type', array(
23
+ 'header' => Mage::helper('mobiadmin')->__('Type'),
24
+ 'align' =>'left',
25
+ 'index' => 'type',
26
+ 'width' => '50px',
27
+ 'filter' => false,
28
+ 'renderer' => 'Mobicommerce_Mobiadmin_Block_Adminhtml_Notification_Grid_Renderer_Type',
29
+ ));
30
+
31
+
32
+ $this->addColumn('date_added', array(
33
+ 'header' => Mage::helper('mobiadmin')->__('Date Added'),
34
+ 'width' => '50px',
35
+ 'index' => 'date_added',
36
+ 'filter' => false,
37
+ ));
38
+
39
+ $this->addColumn('message', array(
40
+ 'header' => Mage::helper('mobiadmin')->__('Message'),
41
+ 'width' => '500px',
42
+ 'index' => 'message',
43
+ 'filter' => false,
44
+ ));
45
+
46
+ $this->addColumn('action',
47
+ array(
48
+ 'header' => Mage::helper('mobiadmin')->__('Action'),
49
+ 'width' => '100',
50
+ 'type' => 'action',
51
+ 'getter' => 'getId',
52
+ 'sortable' => false,
53
+ 'index' => 'stores',
54
+ 'is_system' => true,
55
+ 'renderer' => 'Mobicommerce_Mobiadmin_Block_Adminhtml_Notification_Grid_Renderer_Action',
56
+ ));
57
+ return parent::_prepareColumns();
58
+ }
59
+ public function getMainButtonsHtml()
60
+ {
61
+ return '';
62
+ }
63
+ protected function _prepareMassaction()
64
+ {
65
+ $this->setMassactionIdField('id');
66
+ $this->getMassactionBlock()->setFormFieldName('ids');
67
+ $this->getMassactionBlock()->addItem(
68
+ 'delete', array(
69
+ 'label' => Mage::helper('mobiadmin')->__('Delete'),
70
+ 'url' => $this->getUrl('*/*/massDelete'),
71
+ 'confirm' => Mage::helper('mobiadmin')->__('Are you sure?')
72
+ )
73
+ );
74
+ $this->getMassactionBlock()->addItem(
75
+ 'mark_as_read', array(
76
+ 'label' => Mage::helper('mobiadmin')->__('Mark As Read'),
77
+ 'url' => $this->getUrl('*/*/massRead')
78
+ )
79
+ );
80
+ }
81
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid/Renderer/Action.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Notification_Grid_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $id = $row->getId();
7
+ $markasreadstatus = $row->getReadStatus();
8
+ $deleteurl = Mage::helper('adminhtml')->getUrl('mobicommerce/index/deletenotification', array('id' => $id));
9
+
10
+ $markAsReadurl = Mage::helper('adminhtml')->getUrl('mobicommerce/index/readnotification', array('id' => $id));
11
+
12
+ if($markasreadstatus != 0) {
13
+ $out = '<a onclick="deleteConfirm(\'Are you sure?\', this.href); return false;" href="'.$deleteurl.'">Delete</a>';
14
+ } else {
15
+ $out = '<a onclick="deleteConfirm(\'Are you sure?\', this.href); return false;" href="'.$deleteurl.'">Delete</a>'.'<span>&nbsp;&nbsp; &nbsp;</span>'.'<a href="'.$markAsReadurl.'">Mark As Read</a>';
16
+ }
17
+ return $out;
18
+ }
19
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid/Renderer/AndroidStatus.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_AndroidStatus extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $androidStatus = $row->getAndroidStatus();
7
+ if($androidStatus == 0)
8
+ {
9
+ $out = 'Under Processing';
10
+ }else{
11
+ $out = 'Deliverable';
12
+ }
13
+ return $out;
14
+ }
15
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid/Renderer/IosStatus.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Applications_Grid_Renderer_IosStatus extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $iosStatus = $row->getIosStatus();
7
+ if($iosStatus == 0)
8
+ {
9
+ $out = 'Under Processing';
10
+ }else{
11
+ $out = 'Deliverable';
12
+ }
13
+ return $out;
14
+ }
15
+ }
app/code/local/Mobicommerce/Mobiadmin/Block/Adminhtml/Notification/Grid/Renderer/Type.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Block_Adminhtml_Notification_Grid_Renderer_Type extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $val = $row->getType();
7
+ $out = '<span class="grid-severity-notice"><span>'.$val.'</span></span>';
8
+ return $out;
9
+ }
10
+ }
app/code/local/Mobicommerce/Mobiadmin/Helper/Data.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ public $productInstance;
6
+
7
+ public function getAppCmsPage()
8
+ {
9
+ $applicationData = Mage::registry('application_data');
10
+ $applicationCode = $applicationData->getAppCode();
11
+ $collection = Mage::getModel('mobiadmin/appsetting')->getCollection();
12
+ $CmsPageCollection = $collection->addFieldToFilter('app_code',$applicationCode)->addFieldToFilter('setting_code','cms_settings');
13
+ $CmsPageCollection = $CmsPageCollection->getData();
14
+ $CmsPageData = $CmsPageCollection['0'];
15
+ $CmsPageDataValues = $CmsPageData['value'];
16
+ $allCmsPageSetting = Mage::helper('mobiadmin')->_jsonUnserialize($CmsPageDataValues);
17
+ $allCmsPageSetting = $allCmsPageSetting['en_US'];
18
+ return $allCmsPageSetting;
19
+ }
20
+
21
+ public function getAppLocaleCode()
22
+ {
23
+ $applicationData = Mage::registry('application_data');
24
+ $storeId = $applicationData->getAppStoreid();
25
+ $storeLocaleCode = Mage::getStoreConfig('general/locale/code',$storeId);
26
+ return $storeLocaleCode;
27
+ }
28
+
29
+ public function getProductSliderCollection()
30
+ {
31
+ $applicationData = Mage::registry('application_data');
32
+ $applicationCode = $applicationData->getAppCode();
33
+ $collection = Mage::getModel('mobiadmin/appwidget')->getCollection();
34
+ $CmsPageCollection = $collection->addFieldToFilter('app_code',$applicationCode)->addFieldToFilter('app_type','product-slider')->setOrder('slider_position', 'ASC');
35
+ return $CmsPageCollection;
36
+ }
37
+
38
+ public function getProductCollectionForSlider()
39
+ {
40
+ $applicationData = Mage::registry('application_data');
41
+ $storeId = $applicationData->getAppStoreid();
42
+ $collection = Mage::getModel('catalog/product')->getCollection()->setStoreId($storeId)
43
+ ->addAttributeToSelect('*')
44
+ ->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED));
45
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
46
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
47
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($collection);
48
+
49
+ return $collection;
50
+ }
51
+
52
+ public function getAppsSelectedCatIcons()
53
+ {
54
+ $id = Mage::app()->getRequest()->getParam('id', null);
55
+ $model = Mage::getModel('mobiadmin/applications');
56
+ $model->load((int) $id);
57
+ $applicationData = $model;
58
+ $applicationCode = $applicationData->getAppCode();
59
+ $collection = Mage::getModel('mobiadmin/appsetting')->getCollection();
60
+ $collection = $collection->addFieldToFilter('app_code',$applicationCode)->addFieldToFilter('setting_code','category_icons');
61
+
62
+ $slectedIconscollection = $collection->getData();
63
+ $slectedIconscollection = $slectedIconscollection['0']['value'];
64
+
65
+ $slectedIconscollection = Mage::helper('mobiadmin')->_jsonUnserialize($slectedIconscollection);
66
+
67
+ return $slectedIconscollection;
68
+ }
69
+
70
+ public function getBannerImages()
71
+ {
72
+ $applicationData = Mage::registry('application_data');
73
+ $applicationCode = $applicationData->getAppCode();
74
+ $collection = Mage::getModel('mobiadmin/appsetting')->getCollection();
75
+ $collection = $collection->addFieldToFilter('app_code',$applicationCode)->addFieldToFilter('setting_code','banner_settings');
76
+ $slectedBannerscollection = $collection->getData();
77
+ $slectedBannerscollection = $slectedBannerscollection['0']['value'];
78
+ $slectedBannerscollection = Mage::helper('mobiadmin')->_jsonUnserialize($slectedBannerscollection);
79
+ return $slectedBannerscollection;
80
+ }
81
+
82
+ public function getCategoryIconValueByCatId($catId)
83
+ {
84
+ $selectedIcons = Mage::helper('mobiadmin')->getAppsSelectedCatIcons();
85
+ foreach($selectedIcons as $selectedIcon){
86
+ if($selectedIcon['category_id']==$catId){
87
+ $mobiicon = $selectedIcon['mobiicon'];
88
+ return $mobiicon;
89
+ }
90
+ }
91
+ }
92
+ public function getBannerImagesByAppCode($appCode)
93
+ {
94
+ $collection = Mage::getModel('mobiadmin/appsetting')->getCollection();
95
+ $collection = $collection->addFieldToFilter('app_code',$appCode)->addFieldToFilter('setting_code','banner_settings');
96
+ $slectedBannerscollection = $collection->getData();
97
+ $slectedBannerscollection = $slectedBannerscollection['0']['value'];
98
+ $slectedBannerscollection = Mage::helper('mobiadmin')->_jsonUnserialize($slectedBannerscollection);
99
+ return $slectedBannerscollection;
100
+ }
101
+
102
+ public function getBestSellerProduct($storeId)
103
+ {
104
+ $collection = Mage::getResourceModel('catalog/product_collection')
105
+ ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
106
+ ->addStoreFilter()
107
+ ->setPageSize(10);
108
+ $collection->getSelect()
109
+ ->joinLeft(
110
+ array('aggregation' => $collection->getResource()->getTable('sales/bestsellers_aggregated_monthly')),
111
+ "e.entity_id = aggregation.product_id AND aggregation.store_id={$storeId}",
112
+ array('SUM(aggregation.qty_ordered) AS sold_quantity')
113
+ )
114
+ ->group('e.entity_id')
115
+ ->order(array('sold_quantity DESC', 'e.created_at'))
116
+ ->limit(10);
117
+
118
+ return $collection;
119
+ }
120
+
121
+ public function getNewProductCollection($storeId)
122
+ {
123
+ $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
124
+ $collection = Mage::getModel('catalog/product')->setStoreId( $storeId )
125
+ ->getCollection()
126
+ ->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))
127
+ ->addAttributeToFilter('news_to_date', array('or'=> array(
128
+ 0 => array('date' => true, 'from' => $todayDate),
129
+ 1 => array('is' => new Zend_Db_Expr('null')))
130
+ ), 'left')
131
+ ->addAttributeToSort('news_from_date', 'desc')
132
+ ->addAttributeToSort('created_at', 'desc');
133
+ $collection->getSelect()->limit(10);
134
+ return $collection;
135
+ }
136
+
137
+ public function getThemeName($appCode)
138
+ {
139
+ $collection = Mage::getModel('mobiadmin/appsetting')->getCollection();
140
+ $collection = $collection->addFieldToFilter('app_code',$appCode)->addFieldToFilter('setting_code','theme_folder_name');
141
+ $slectedThemecollection = $collection->getData();
142
+ $themeName = $slectedThemecollection['0']['value'];
143
+ return $themeName;
144
+ }
145
+
146
+ public function setLanguageCodeData($localeCode)
147
+ {
148
+ $languageCollection = Mage::getModel('mobiadmin/multilanguage')->getCollection()->addFieldToFilter('mm_language_code',$localeCode);
149
+ $languageCollectionCount = $languageCollection->count();
150
+ if(empty($languageCollectionCount)){
151
+ $resource = Mage::getSingleton('core/resource');
152
+ $readConnection = $resource->getConnection('core_read');
153
+ $writeConnection = $resource->getConnection('core_write');
154
+ $query = "INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('mobicommerce_multilanguage')." (mm_language_code, mm_type, mm_label_code, mm_label, mm_maxlength, mm_text, mm_help) SELECT '".$localeCode."' AS mm_language_code, mm_type, mm_label_code, mm_label, mm_maxlength, mm_text, mm_help FROM ".Mage::getSingleton('core/resource')->getTableName('mobicommerce_multilanguage')." WHERE mm_language_code = 'en_US'";
155
+ $writeConnection->query($query);
156
+ }
157
+ }
158
+
159
+ public function _jsonUnserialize($data = null)
160
+ {
161
+ $jsonData = json_decode($data, true);
162
+ if(is_array($jsonData)){
163
+ return $jsonData;
164
+ }
165
+ else{
166
+ return unserialize($data);
167
+ }
168
+ }
169
+
170
+ public function buyNowUrl()
171
+ {
172
+ return 'http://www.mobi-commerce.net/index.php/mobiweb/index/addtocart';
173
+ }
174
+
175
+ public function getCountUnreadNotification()
176
+ {
177
+ $collection = Mage::getModel('mobiadmin/notification')->getCollection()->addFieldToFilter('read_status','0');
178
+ return $collection->count();
179
+ }
180
+
181
+ public function curlBuildUrl()
182
+ {
183
+ return 'http://build.mobi-commerce.net/';
184
+ }
185
+
186
+ public function mobicommerceEmailId()
187
+ {
188
+ return 'plugin@mobi-commerce.net';
189
+ }
190
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Applications.php ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Applications extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/applications');
7
+ }
8
+
9
+ public function saveApplicationData(array $saveData ,$store_id)
10
+ {
11
+ $errors = array();
12
+ if(empty($store_id)){
13
+ $store_id = Mage::app()
14
+ ->getWebsite()
15
+ ->getDefaultGroup()
16
+ ->getDefaultStoreId();
17
+ }
18
+
19
+ $app_name = $saveData['app_name'];
20
+ $app_code = $saveData['app_code'];
21
+ $app_key = $saveData['app_preview_code'];
22
+ $app_logo = $saveData['app_logo'];
23
+ $app_licence_key = $saveData['app_license_key'];
24
+ $android_url = $saveData['android_url'];
25
+ $ios_url = $saveData['ios_url'];
26
+ $android_status = $saveData['android_status'];
27
+ $ios_status = $saveData['ios_status'];
28
+ $app_storeid = $store_id;
29
+ $webapp_url = $saveData['webapp_url'];
30
+
31
+ $udid = $saveData['udid'];
32
+ $appExist = Mage::getModel('mobiadmin/applications')->getCollection()
33
+ ->addFieldToFilter('app_code',$app_code)
34
+ ->addFieldToFilter('app_key',$app_key)->count();
35
+ if(!$appExist){
36
+ $this->_create_mobi_media_dir($saveData['app_code'], $saveData['app_theme_folder_name']);
37
+ $applicationData = array(
38
+ 'app_name' => $app_name,
39
+ 'app_code' => $app_code,
40
+ 'app_key' => $app_key,
41
+ 'app_logo' => $app_logo,
42
+ 'app_license_key' => $app_licence_key,
43
+ 'app_storeid' => $app_storeid,
44
+ 'app_mode' => 'demo',
45
+ 'created_time' => date('Y-m-d H:i:s'),
46
+ 'android_url' => $android_url,
47
+ 'android_status' => $android_status,
48
+ 'webapp_url' => $webapp_url,
49
+ 'udid' => $udid,
50
+ 'ios_url' => $ios_url,
51
+ 'ios_status' => $ios_status,
52
+ );
53
+ //save in application info
54
+ try {
55
+ Mage::getModel('mobiadmin/applications')->setData($applicationData)->save();
56
+ }catch(Exception $e){
57
+ $errors[] = $e->getMessage();
58
+ }
59
+
60
+ $appinfo = serialize(array(
61
+ 'android_appname' => '',
62
+ 'android_appweburl' => '',
63
+ 'android_appmobileurl' => '',
64
+ 'ios_appname' => '',
65
+ 'ios_appweburl' => '',
66
+ 'ios_appmobileurl' => '',
67
+ 'app_description' => '',
68
+ 'app_share_image' => '',
69
+ ));
70
+
71
+ $appinfoData = array(
72
+ 'app_code' => $app_code,
73
+ 'setting_code' => 'appinfo',
74
+ 'value' => $appinfo
75
+ );
76
+
77
+ try {
78
+ Mage::getModel('mobiadmin/appsetting')->setData($appinfoData)->save();
79
+ }catch(Exception $e){
80
+ $errors[] = $e->getMessage();
81
+ }
82
+
83
+ /***/
84
+ $pushValue = array(
85
+ 'active_push_notification' => 0,
86
+ 'android_key' => null,
87
+ 'android_sender_id' => null,
88
+ 'upload_iospem_file' => null,
89
+ 'upload_iospem_file_url' => null,
90
+ 'pem_password' => null,
91
+ 'sandboxmode' => 0
92
+ );
93
+ $pushValue = serialize($pushValue);
94
+ $appNotificationData = array(
95
+ 'app_code' => $app_code,
96
+ 'setting_code' => 'push_notification',
97
+ 'value' => $pushValue
98
+ );
99
+
100
+ try {
101
+ Mage::getModel('mobiadmin/appsetting')->setData($appNotificationData)->save();
102
+ }catch(Exception $e){
103
+ $errors[] = $e->getMessage();
104
+ }
105
+
106
+ $appthemesetting = array(
107
+ 'app_code' => $app_code,
108
+ 'setting_code' => 'theme_folder_name',
109
+ 'value' => $saveData['app_theme_folder_name']
110
+ );
111
+
112
+ try {
113
+ Mage::getModel('mobiadmin/appsetting')->setData($appthemesetting)->save();
114
+ }catch(Exception $e){
115
+ $errors[] = $e->getMessage();
116
+ }
117
+
118
+ $popUpData = array(
119
+ 'enable' => '0',
120
+ 'cookietime' => '2592000',
121
+ 'popupimage' => ''
122
+ );
123
+
124
+ $appPopUpsetting = array(
125
+ 'app_code' => $app_code,
126
+ 'setting_code' => 'popup_setting',
127
+ 'value' => serialize($popUpData)
128
+ );
129
+
130
+ try {
131
+ Mage::getModel('mobiadmin/appsetting')->setData($appPopUpsetting)->save();
132
+ }catch(Exception $e){
133
+ $errors[] = $e->getMessage();
134
+ }
135
+
136
+ $app_home_banners = array();
137
+ $dir = Mage::getBaseDir('media').DS.'mobi_assets'.DS.'theme_files'.DS.$saveData['app_theme_folder_name'].DS.'home_banners';
138
+ $cdir = scandir($dir);
139
+ foreach ($cdir as $key => $value)
140
+ {
141
+ if (!in_array($value,array(".","..")) && !is_dir($dir . DIRECTORY_SEPARATOR . $value))
142
+ {
143
+ $img = $this->file_get_contents_curl($dir . DIRECTORY_SEPARATOR . $value);
144
+ file_put_contents(Mage::getBaseDir('media').'/mobi_commerce/'.$app_code.'/home_banners/'.$value, $img);
145
+ $app_home_banners[] = array(
146
+ 'url' => Mage::getBaseUrl('media').'mobi_commerce/'.$app_code.'/home_banners/'.$value,
147
+ 'is_active' => '1'
148
+ );
149
+ }
150
+ }
151
+
152
+ if(empty($app_home_banners)){
153
+ for($i=0;$i<5;$i++){
154
+ $app_home_banners[] = array(
155
+ 'url' => '',
156
+ 'is_active' => '0'
157
+ );
158
+ }
159
+ }
160
+
161
+ $banner_settings = array(
162
+ 'app_code' => $app_code,
163
+ 'setting_code' => 'banner_settings',
164
+ 'value' => serialize($app_home_banners)
165
+ );
166
+
167
+ try {
168
+ Mage::getModel('mobiadmin/appsetting')->setData($banner_settings)->save();
169
+ }catch(Exception $e){
170
+ $errors[] = $e->getMessage();
171
+ }
172
+
173
+ $pushnotifications_settings = array(
174
+ 'app_code' => $app_code,
175
+ 'setting_code' => 'pushnotifications_settings',
176
+ 'value' => ''
177
+ );
178
+
179
+ try {
180
+ Mage::getModel('mobiadmin/appsetting')->setData($pushnotifications_settings)->save();
181
+ }catch(Exception $e){
182
+ $errors[] = $e->getMessage();
183
+ }
184
+
185
+ $now = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));
186
+ $setting = json_encode(array('no_of_days' => 90));
187
+
188
+ /* code to get 10 random featured products */
189
+ $featuredProducts = Mage::getModel('mobiservices/catalog_catalog')->getRandomProducts(10);
190
+ $featuredProductsIds = array();
191
+ if(!empty($featuredProducts)){
192
+ foreach ($featuredProducts as $key => $value) {
193
+ $featuredProductsIds[] = $value['entity_id'];
194
+ }
195
+ }
196
+ $featuredProductsIds = implode(',', $featuredProductsIds);
197
+ /* code to get 10 random featured products - upto here */
198
+
199
+ $productSliderSettings = array(
200
+ array(
201
+ 'app_code' => $app_code,
202
+ 'app_type' => 'product-slider',
203
+ 'slider_code' => 'featured-products',
204
+ 'slider_label' => 'Featured Products',
205
+ 'slider_status' => '1',
206
+ 'slider_position' => '1',
207
+ 'slider_settings' => '',
208
+ 'slider_productIds' => $featuredProductsIds,
209
+ 'created_time' => $now,
210
+ 'update_time' => $now,
211
+ ),
212
+ array(
213
+ 'app_code' => $app_code,
214
+ 'app_type' => 'product-slider',
215
+ 'slider_code' => 'best-collection',
216
+ 'slider_label' => 'Best Collection',
217
+ 'slider_status' => '0',
218
+ 'slider_position' => '2',
219
+ 'slider_settings' => '',
220
+ 'slider_productIds' => '',
221
+ 'created_time' => $now,
222
+ 'update_time' => $now,
223
+ ),
224
+ array(
225
+ 'app_code' => $app_code,
226
+ 'app_type' => 'product-slider',
227
+ 'slider_code' => 'new-arrivals',
228
+ 'slider_label' => 'New Arrivals',
229
+ 'slider_status' => '0',
230
+ 'slider_position' => '3',
231
+ 'slider_settings' => '',
232
+ 'slider_productIds' => '',
233
+ 'created_time' => $now,
234
+ 'update_time' => $now,
235
+ ),
236
+ array(
237
+ 'app_code' => $app_code,
238
+ 'app_type' => 'product-slider',
239
+ 'slider_code' => 'best-sellers',
240
+ 'slider_label' => 'Best Seller',
241
+ 'slider_status' => '0',
242
+ 'slider_position' => '4',
243
+ 'slider_settings' => '',
244
+ 'slider_productIds' => '',
245
+ 'created_time' => $now,
246
+ 'update_time' => $now,
247
+ ),
248
+ array(
249
+ 'app_code' => $app_code,
250
+ 'app_type' => 'product-slider',
251
+ 'slider_code' => 'new-arrivals-automated',
252
+ 'slider_label' => 'New Arrivals',
253
+ 'slider_status' => '1',
254
+ 'slider_position' => '5',
255
+ 'slider_settings' => '',
256
+ 'slider_productIds' => '',
257
+ 'created_time' => $now,
258
+ 'update_time' => $now,
259
+ ),
260
+ array(
261
+ 'app_code' => $app_code,
262
+ 'app_type' => 'product-slider',
263
+ 'slider_code' => 'best-sellers-automated',
264
+ 'slider_label' => 'Best Seller (Automated)',
265
+ 'slider_status' => '0',
266
+ 'slider_position' => '6',
267
+ 'slider_settings' => $setting,
268
+ 'slider_productIds' => '',
269
+ 'created_time' => $now,
270
+ 'update_time' => $now,
271
+ ),
272
+ );
273
+ foreach($productSliderSettings as $productSliderSetting){
274
+ try{
275
+ Mage::getModel('mobiadmin/appwidget')->setData($productSliderSetting)->save();
276
+ }
277
+ catch(Exception $e){
278
+ $errors[] = $e->getMessage();
279
+ }
280
+ }
281
+ $contact_data = '<div class="detail-box no-border"><div class="li-row"><div><h3 style="margin:0">Your Store Name</h3><span class="small"><p>Full Address of the store</p></span></div></div><a href="" class="li-row ui-link"><div>Tel: +xx-xxx-xxx-xxxx</div></a><a href="" class="li-row ui-link"><div>Email: email@yourdomain.com</div></a></div>';
282
+ $cms_contents = array(
283
+ "en_US" => array(
284
+ "contact_information" => array(
285
+ "company_name" => "Your Company Name",
286
+ "company_address" => "Your company addresss here",
287
+ "phone_number" => "+0-000-000-0000",
288
+ "email_address" => "mail@yourdomain.com",
289
+ ),
290
+ "social_media" => array(
291
+ "facebook" => "1",
292
+ "facebook_url" => "https://www.facebook.com/mobi.commerce.platform",
293
+ "twitter" => "1",
294
+ "twitter_url" => "https://twitter.com/mobicommerceapp",
295
+ "linkedin" => null,
296
+ "linkedin_url" => null,
297
+ "googleplus" => "1",
298
+ "googleplus_url" => "https://plus.google.com/113187082679438496885/",
299
+ "youtube" => null,
300
+ "youtube_url" => null,
301
+ "pinterest" => null,
302
+ "pinterest_url" => null,
303
+ "blog" => null,
304
+ "blog_url" => null,
305
+ ),
306
+ "cms_pages" => array(
307
+ "page_1" => array(
308
+ "page_title" => "About Us",
309
+ "active" => "1",
310
+ "link_to_external" => null,
311
+ "page_url" => null,
312
+ "page_content" => "Coming Soon"
313
+ ),
314
+ "page_2" => array(
315
+ "page_title" => "Privacy Policy",
316
+ "active" => "1",
317
+ "link_to_external" => null,
318
+ "page_url" => null,
319
+ "page_content" => "Coming Soon"
320
+ ),
321
+ "page_3" => array(
322
+ "page_title" => "Term and Conditions",
323
+ "active" => "1",
324
+ "link_to_external" => null,
325
+ "page_url" => null,
326
+ "page_content" => "Coming Soon"
327
+ ),
328
+ "page_4" => array(
329
+ "page_title" => "Contact Us",
330
+ "active" => "1",
331
+ "link_to_external" => null,
332
+ "page_url" => null,
333
+ "page_content" => $contact_data
334
+ ),
335
+ "page_5" => array(
336
+ "page_title" => null,
337
+ "active" => null,
338
+ "link_to_external" => null,
339
+ "page_url" => null,
340
+ "page_content" => null
341
+ ),
342
+ "page_6" => array(
343
+ "page_title" => null,
344
+ "active" => null,
345
+ "link_to_external" => null,
346
+ "page_url" => null,
347
+ "page_content" => null
348
+ ),
349
+ "page_7" => array(
350
+ "page_title" => null,
351
+ "active" => null,
352
+ "link_to_external" => null,
353
+ "page_url" => null,
354
+ "page_content" => null
355
+ ),
356
+ ),
357
+ )
358
+ );
359
+ $cms_contents = serialize($cms_contents);
360
+ $cmsData = array(
361
+ 'app_code' => $app_code,
362
+ 'setting_code' => 'cms_settings',
363
+ 'value' => $cms_contents
364
+ );
365
+ try{
366
+ Mage::getModel('mobiadmin/appsetting')->setData($cmsData)->save();
367
+ }
368
+ catch(Exception $e){
369
+ $errors[] = $e->getMessage();
370
+ }
371
+ }
372
+ return $errors;
373
+ }
374
+
375
+ protected function file_get_contents_curl($url) {
376
+ if(function_exists('file_get_contents'))
377
+ return file_get_contents($url);
378
+ else{
379
+ $ch = curl_init();
380
+
381
+ curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
382
+ curl_setopt($ch, CURLOPT_HEADER, 0);
383
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
384
+ curl_setopt($ch, CURLOPT_URL, $url);
385
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
386
+
387
+ $data = curl_exec($ch);
388
+ curl_close($ch);
389
+
390
+ return $data;
391
+ }
392
+ }
393
+
394
+ protected function _create_mobi_media_dir($app_code = null, $app_theme_folder_name = null)
395
+ {
396
+ $base_dir = Mage::getBaseDir('media');
397
+ if(!(is_dir($base_dir.'/mobi_commerce') && file_exists($base_dir.'/mobi_commerce')))
398
+ mkdir($base_dir.'/mobi_commerce', 0777, true);
399
+
400
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code) && file_exists($base_dir.'/mobi_commerce/'.$app_code)))
401
+ mkdir($base_dir.'/mobi_commerce/'.$app_code, 0777, true);
402
+
403
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/home_banners') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/home_banners')))
404
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/home_banners', 0777, true);
405
+
406
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/appinfo') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/appinfo')))
407
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/appinfo', 0777, true);
408
+
409
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/certificates') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/certificates')))
410
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/certificates', 0777, true);
411
+
412
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/personalizer') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/personalizer'))){
413
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/personalizer', 0777, true);
414
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/personalizer/svg', 0777, true);
415
+
416
+ if(!empty($app_theme_folder_name)){
417
+ copy($base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/personalizer.xml', $base_dir . '/mobi_commerce/' . $app_code . '/personalizer/personalizer.xml');
418
+ copy($base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/personalizer.css', $base_dir . '/mobi_commerce/' . $app_code . '/personalizer/personalizer.css');
419
+ }
420
+ }
421
+
422
+ if(!empty($app_theme_folder_name)){
423
+ $dir = $base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/svg';
424
+ if(file_exists($dir)){
425
+ $scandir = scandir($dir);
426
+ foreach ($scandir as $key => $value)
427
+ {
428
+ if (!in_array($value,array(".","..")))
429
+ {
430
+ $currfile = $dir . DIRECTORY_SEPARATOR . $value;
431
+ if (!is_dir($currfile))
432
+ {
433
+ $filename = PATHINFO($value, PATHINFO_BASENAME);
434
+ if(!file_exists($base_dir . '/mobi_commerce/' . $app_code . '/personalizer/svg/' . $filename)){
435
+ copy($base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/svg/' . $filename, $base_dir . '/mobi_commerce/' . $app_code . '/personalizer/svg/' . $filename);
436
+ }
437
+ }
438
+ }
439
+ }
440
+ }
441
+
442
+ $sourcePersonalizerFolder = $base_dir.DS.'mobi_assets'.DS.'theme_files'.DS.$app_theme_folder_name.DS.'personalizer';
443
+ $destinationPersonalizerFolder = $base_dir.DS.'mobi_commerce'.DS.$app_code.DS.'personalizer';
444
+
445
+ $sourcePersonalizerXml = $sourcePersonalizerFolder.DS.'personalizer.xml';
446
+ $destinationPersonalizerXml = $destinationPersonalizerFolder.DS.'personalizer.xml';
447
+
448
+ if(file_exists ($destinationPersonalizerXml)){
449
+ $sourcePersonalizerXml = (array) simplexml_load_file($sourcePersonalizerXml);
450
+ $destinationPersonalizerXml = (array) simplexml_load_file($destinationPersonalizerXml);
451
+ $destinationPersonalizerCss = $destinationPersonalizerFolder.DS.'personalizer.css';
452
+ $cssArray = array();
453
+
454
+ $doc = new DOMDocument('1.0');
455
+ $doc->formatOutput = true;
456
+ $root = $doc->createElement('mobicommerce_personalizer');
457
+ $root = $doc->appendChild($root);
458
+
459
+ foreach($sourcePersonalizerXml as $key => $element){
460
+ $css = $element->css;
461
+ $svgFilenames = (string) $element->svg_filenames;
462
+ $defaultValue = (string) $element->default_value;
463
+ $currentValue = (string) $element->default_value;
464
+ if(isset($destinationPersonalizerXml[$key])){
465
+ $currentValue = (string) $destinationPersonalizerXml[$key]->current_value;
466
+ }
467
+ $css = implode("\r\n", explode('|', $css));
468
+ $cssArray[] = str_replace("--COLOR--", $currentValue, $css);
469
+
470
+ if(!empty($svgFilenames)){
471
+ //echo ($element->svg_filenames);exit;
472
+ $svgFilenames = explode('|', $svgFilenames);
473
+ if(!empty($svgFilenames)){
474
+ foreach($svgFilenames as $svg_filename){
475
+ if(file_exists($sourcePersonalizerFolder . DS . 'svg' . DS . $svg_filename)){
476
+ $svg_image = file_get_contents($sourcePersonalizerFolder . DS . 'svg' . DS . $svg_filename);
477
+ preg_match_all('/<style>(.*?)<\/style>/s', $svg_image, $style_tag);
478
+ $old_style_tag = $style_tag[1][0];
479
+ $property = explode('{', $style_tag[1][0]);
480
+ $property = $property[0];
481
+ preg_match_all('/{(.*?)}/s', $style_tag[1][0], $style_tag);
482
+ $param = explode(':', $style_tag[1][0]);
483
+ $param = $param[0];
484
+ $new_style_tag = $property.'{'.$param.':'.$currentValue.'!important;}';
485
+ $svg_image = str_replace($old_style_tag, $new_style_tag, $svg_image);
486
+ file_put_contents($destinationPersonalizerFolder . DS . 'svg' . DS . $svg_filename, $svg_image);
487
+ }
488
+ }
489
+ }
490
+ }
491
+
492
+ $newdoc = $root->appendChild($doc->createElement($key));
493
+ foreach($element as $optioncode => $value){
494
+ $em = $doc->createElement($optioncode);
495
+ if($optioncode == 'current_value'){
496
+ $value = $currentValue;
497
+ }
498
+ else if($optioncode == 'default_value'){
499
+ $value = $defaultValue;
500
+ }
501
+ $text = $doc->createTextNode($value);
502
+ $em->appendChild($text);
503
+ $newdoc->appendChild($em);
504
+ }
505
+ }
506
+ file_put_contents($destinationPersonalizerCss, implode($cssArray, "\r\n"));
507
+ $doc->save($destinationPersonalizerFolder.DS.'personalizer.xml');
508
+ }
509
+ }
510
+ }
511
+
512
+ public function deleteapps($appcodes = array())
513
+ {
514
+ $deleteCount = 0;
515
+ if(!empty($appcodes)){
516
+ $appcodes = array_map('trim', $appcodes);
517
+ $appcodes = array_unique($appcodes);
518
+ $appcodes = array_filter($appcodes);
519
+ if(!empty($appcodes)){
520
+ $records = Mage::getModel('mobiadmin/appwidget')->getCollection()->addFieldToFilter('app_code',array('in' => $appcodes));
521
+
522
+ if($records->count()){
523
+ foreach($records as $_record){
524
+ $_record->delete();
525
+ }
526
+ }
527
+
528
+ $records = Mage::getModel('mobiadmin/appsetting')->getCollection()->addFieldToFilter('app_code',array('in' => $appcodes));
529
+
530
+ if($records->count()){
531
+ foreach($records as $_record){
532
+ $_record->delete();
533
+ }
534
+ }
535
+
536
+ $records = Mage::getModel('mobiadmin/devicetokens')->getCollection()->addFieldToFilter('md_appcode',array('in' => $appcodes));
537
+
538
+ if($records->count()){
539
+ foreach($records as $_record){
540
+ $_record->delete();
541
+ }
542
+ }
543
+
544
+ $records = Mage::getModel('mobiadmin/applications')->getCollection()->addFieldToFilter('app_code',array('in' => $appcodes));
545
+
546
+ if($records->count()){
547
+ foreach($records as $_record){
548
+ $deleteCount++;
549
+ $_record->delete();
550
+ }
551
+ }
552
+ foreach($appcodes as $_appcode){
553
+ $dir = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'mobi_commerce' . DS . $_appcode;
554
+ if(file_exists($dir) && is_dir($dir)){
555
+ Mage::helper('mobiservices/mobicommerce')->rrmdir($dir);
556
+ }
557
+ }
558
+ }
559
+ }
560
+ return $deleteCount;
561
+ }
562
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Appsetting.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Appsetting extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/appsetting');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Appwidget.php ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Appwidget extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/appwidget');
7
+ }
8
+
9
+ public function getProductSliderData($data)
10
+ {
11
+ $appcode = isset($data['appcode'])?$data['appcode']:'12345678';
12
+ $productsliderCollection =Mage::getModel('mobiadmin/appwidget')->getCollection()
13
+ ->addFieldToFilter('app_code',$data['appcode'])
14
+ ->addFieldToFilter('slider_status', '1')
15
+ ->setOrder('slider_position', 'ASC');
16
+ $sliderArray = array();
17
+ $key = 0;
18
+ if($productsliderCollection->count()>0)
19
+ {
20
+ foreach($productsliderCollection as $productslider){
21
+ $productslider = $productslider->getData();
22
+ if($productslider['slider_code'] == 'new-arrivals-automated'){
23
+ $new_products = Mage::getModel('catalog/product')->getCollection()
24
+ ->addAttributeToSort("entity_id","DESC")->addAttributeToSelect('*');
25
+ $new_products->getSelect()->limit(10);
26
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($new_products);
27
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($new_products);
28
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($new_products);
29
+
30
+ if(!empty($new_products)){
31
+ $j = 0;
32
+ $products = array();
33
+ foreach($new_products as $_new_products){
34
+ if($j == 10) break;
35
+ if($this->_checkProductAvailabilityParam($_new_products)){
36
+ $products[$j]['entity_id'] = $_new_products->getId();
37
+ $products[$j]['entity_type_id'] = $_new_products->getEntityTypeId();
38
+ $products[$j]['attribute_set_id'] = $_new_products->getAttributeSetId();
39
+ $products[$j]['type_id'] = $_new_products->getTypeId();
40
+ $products[$j]['sku'] = $_new_products->getSku();
41
+ $products[$j]['name'] = $_new_products->getName();
42
+ $products[$j]['price'] = $_new_products->getPrice();
43
+ $products[$j]['final_price'] = $_new_products->getFinalPrice();
44
+ $products[$j]['special_price'] = $_new_products->getSpecialPrice();
45
+ $products[$j]['is_salable'] = $_new_products->getIsSalable();
46
+ $products[$j]['status'] = $_new_products->getStatus();
47
+ $products[$j]['product_thumbnail_url'] = Mage::helper('catalog/image')->init($_new_products, 'thumbnail')->resize(200)->__toString();
48
+
49
+ $prices = $this->_productPrices($_new_products);
50
+ if ($prices)
51
+ $products[$j] = array_merge($products[$j], $prices);
52
+ $j++;
53
+ }
54
+ }
55
+ $sliderArray[$key] = $productslider;
56
+ $sliderArray[$key]['slider_productIds'] = $products;
57
+
58
+ }
59
+ }
60
+ else if($productslider['slider_code'] == 'best-sellers-automated'){
61
+ $settings = $productslider['slider_settings'];
62
+ $settings_array = json_decode($settings);
63
+ $no_of_days = $settings_array->no_of_days;
64
+
65
+ $storeId = Mage::app()->getStore()->getId();
66
+ $today = time();
67
+ $last = $today - (60*60*24*$no_of_days);
68
+
69
+ $from = date("Y-m-d 00:00:00", $last);
70
+ $to = date("Y-m-d 23:59:59", $today);
71
+
72
+ $bestseller_products = Mage::getResourceModel('reports/product_collection')
73
+ ->addAttributeToSelect('*')
74
+ ->addOrderedQty($from, $to)
75
+ ->setStoreId($storeId)
76
+ ->addStoreFilter($storeId)
77
+ ->setOrder('ordered_qty', 'desc');
78
+
79
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($bestseller_products);
80
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($bestseller_products);
81
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($bestseller_products);
82
+
83
+ //echo $bestseller_products->getSelect();exit;
84
+ if(!empty($bestseller_products)){
85
+ $k = 0;
86
+ $products = array();
87
+ foreach($bestseller_products as $_bestseller_products){
88
+ if($k == 10) break;
89
+ if($this->_checkProductAvailabilityParam($_bestseller_products)){
90
+ $products[$k]['entity_id'] = $_bestseller_products->getId();
91
+ $products[$k]['entity_type_id'] = $_bestseller_products->getEntityTypeId();
92
+ $products[$k]['attribute_set_id'] = $_bestseller_products->getAttributeSetId();
93
+ $products[$k]['type_id'] = $_bestseller_products->getTypeId();
94
+ $products[$k]['sku'] = $_bestseller_products->getSku();
95
+ $products[$k]['name'] = $_bestseller_products->getName();
96
+ $products[$k]['price'] = $_bestseller_products->getPrice();
97
+ $products[$k]['final_price'] = $_bestseller_products->getFinalPrice();
98
+ $products[$k]['special_price'] = $_bestseller_products->getSpecialPrice();
99
+ $products[$k]['is_salable'] = $_bestseller_products->getIsSalable();
100
+ $products[$k]['status'] = $_bestseller_products->getStatus();
101
+ $products[$k]['product_thumbnail_url'] = Mage::helper('catalog/image')->init($_bestseller_products, 'thumbnail')->resize(200)->__toString();
102
+
103
+ $prices = $this->_productPrices($_bestseller_products);
104
+ if ($prices)
105
+ $products[$k] = array_merge($products[$k], $prices);
106
+
107
+ $k++;
108
+ }
109
+ }
110
+ $sliderArray[$key] = $productslider;
111
+ $sliderArray[$key]['slider_productIds'] = $products;
112
+ }
113
+ }
114
+ else{
115
+ $productids = array();
116
+ $productids = explode(",",$productslider['slider_productIds']);
117
+ if(!empty($productids)){
118
+ $products = array();
119
+ $l = 0;
120
+ for($m=0; $m<10;$m++){
121
+ $_products = '';
122
+ $_products = Mage::getModel('catalog/product')->load($productids[$m]);
123
+ if($this->_checkProductAvailabilityParam($_products)){
124
+ $products[$l]['entity_id'] = $_products->getId();
125
+ $products[$l]['entity_type_id'] = $_products->getEntityTypeId();
126
+ $products[$l]['attribute_set_id'] = $_products->getAttributeSetId();
127
+ $products[$l]['type_id'] = $_products->getTypeId();
128
+ $products[$l]['sku'] = $_products->getSku();
129
+ $products[$l]['name'] = $_products->getName();
130
+ $products[$l]['price'] = $_products->getPrice();
131
+ $products[$l]['final_price'] = $_products->getFinalPrice();
132
+ $products[$l]['special_price'] = $_products->getSpecialPrice();
133
+ $products[$l]['is_salable'] = $_products->getIsSalable();
134
+ $products[$l]['status'] = $_products->getStatus();
135
+ $products[$l]['product_thumbnail_url'] = Mage::helper('catalog/image')->init($_products, 'thumbnail')->resize(200)->__toString();
136
+
137
+ $prices = $this->_productPrices($_products);
138
+
139
+ if ($prices)
140
+ $products[$l] = array_merge($products[$l], $prices);
141
+ $l++;
142
+ }
143
+ }
144
+
145
+ $sliderArray[$key] = $productslider;
146
+ $sliderArray[$key]['slider_productIds'] = $products;
147
+ }
148
+ }
149
+ $key++;
150
+ }
151
+ return $sliderArray;
152
+ }
153
+ }
154
+
155
+ protected function _productPrices($product){
156
+ // ----- Get Price for bundle and ground products
157
+ $type = $product->getTypeId();
158
+ switch ($type) {
159
+ case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE :
160
+ /*
161
+ ----- Bundle price
162
+ */
163
+ $prices = array();
164
+ $productPrice = $product->getPriceModel();
165
+ if (version_compare(Mage::getVersion(), '1.4.2.0', '>=') === true) {
166
+ list($_minimalPriceTax, $_maximalPriceTax) = $productPrice->getTotalPrices($product, null, null, false);
167
+ }else{
168
+ list($_minimalPriceTax, $_maximalPriceTax) = $productPrice->getPrices($product, null, null, false);
169
+ }
170
+
171
+ if ($product->getPriceType() == 1) {
172
+ $_weeeTaxAmount = Mage::helper('weee')->getAmount($product);
173
+ $_weeeTaxAmountInclTaxes = $_weeeTaxAmount;
174
+ if (Mage::helper('weee')->isTaxable()) {
175
+ $_attributes = Mage::helper('weee')->getProductWeeeAttributesForRenderer($product, null, null, null, true);
176
+ $_weeeTaxAmountInclTaxes = Mage::helper('weee')->getAmountInclTaxes($_attributes);
177
+ }
178
+ if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($product, array(0, 1, 4))) {
179
+ $_minimalPriceTax += $_weeeTaxAmount;
180
+ $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes;
181
+ }
182
+ if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($product, 2)) {
183
+ $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes;
184
+ }
185
+
186
+ }
187
+ $prices = array(
188
+ 'min_price' => $_minimalPriceTax,
189
+ 'max_price' => $_maximalPriceTax,
190
+ );
191
+
192
+ // --- ENd Budle price
193
+ break;
194
+ case Mage_Catalog_Model_Product_Type::TYPE_GROUPED :
195
+ /*
196
+ ----- Grouped price
197
+ */
198
+ $prices = array();
199
+ $_taxHelper = Mage::helper('tax');
200
+ $_minimalPriceValue = $product->getMinimalPrice();
201
+ //$_exclTax = $_taxHelper->getPrice($product, $_minimalPriceValue);
202
+ //$_inclTax = $_taxHelper->getPrice($product, $_minimalPriceValue, true);
203
+ //print_r($product->getData());exit;
204
+
205
+ /* custom code added for getting minimum and maximum price for grouped product */
206
+ $groupedProduct = $product;
207
+ $aProductIds = $groupedProduct->getTypeInstance()->getChildrenIds($groupedProduct->getId());
208
+
209
+ $group_prices = array();
210
+ foreach ($aProductIds as $ids) {
211
+ foreach ($ids as $id) {
212
+ $aProduct = Mage::getModel('catalog/product')->load($id);
213
+ $group_prices[] = $aProduct->getPriceModel()->getPrice($aProduct);
214
+ }
215
+ }
216
+ if(!empty($group_prices))
217
+ {
218
+ $prices = array(
219
+ 'min_price' => min($group_prices),
220
+ 'max_price' => max($group_prices)
221
+ );
222
+ }
223
+
224
+ break;
225
+ // -----END -- Grouped Price
226
+ }
227
+ // ----- end Price
228
+ return $prices;
229
+ }
230
+
231
+ protected function _checkProductAvailabilityParam($_product){
232
+ if($_product->getId() && $_product->getIsSalable() && $_product->isVisibleInSiteVisibility() && in_array(Mage::app()->getStore()->getId(), $_product->getStoreIds()) && $_product->getStatus() == '1')
233
+ return true;
234
+ else
235
+ return false;
236
+ }
237
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Categoryicons.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Categoryicons extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/categoryicons');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Devicetokens.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Devicetokens extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/devicetokens');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Licence.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Licence extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/licence');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Multilanguage.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Multilanguage extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/multilanguage');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Notification.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Notification extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/notification');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Observer.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Observer
3
+ {
4
+ public function hookToControllerActionPreDispatch($observer)
5
+ {
6
+ if(!file_exists(Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'mobi_assets' . DS . 'mobicommerce.ini')){
7
+ $collection = Mage::getModel('mobiadmin/licence')->getCollection();
8
+ $count = $collection->count();
9
+ if(empty($count)) {
10
+ $this->sendLicenceData();
11
+ }else{
12
+ file_put_contents(Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'mobi_assets' . DS . 'mobicommerce.ini', md5(sha1($collection->getLastItem()->getMlLicenceKey())));
13
+ }
14
+ }
15
+ }
16
+
17
+ public function sendLicenceData()
18
+ {
19
+ //curl Data Send to mobi build
20
+ $website_url = Mage::getBaseUrl();
21
+ $sales_email = Mage::getStoreConfig('trans_email/ident_sales/email');
22
+ $countryCode = Mage::getStoreConfig('general/country/default');
23
+ $country = Mage::getModel('directory/country')->loadByCode($countryCode)->getName();
24
+ $adminSession = Mage::getSingleton('admin/session');
25
+
26
+ $curlData = array();
27
+ $curlData['website_url'] = $website_url;
28
+ $curlData['sales_email'] = $sales_email;
29
+ $curlData['admin_email'] = '';
30
+ if($adminSession->getUser()){
31
+ $curlData['admin_email'] = $adminSession->getUser()->getEmail();
32
+ }
33
+
34
+ $curlData['country'] = $country;
35
+ $fields_string = '';
36
+ foreach($curlData as $key=>$value) {
37
+ $fields_string .= $key.'='.$value.'&';
38
+ }
39
+ rtrim($fields_string, '&');
40
+
41
+ //echo '<pre>';print_r($curlData);exit;
42
+ $ch = curl_init();
43
+
44
+ $url = Mage::helper('mobiadmin')->curlBuildUrl().'install';
45
+ curl_setopt($ch, CURLOPT_HEADER, FALSE);
46
+ curl_setopt($ch, CURLOPT_NOBODY, TRUE); // remove body
47
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
48
+ curl_setopt($ch,CURLOPT_URL, $url);
49
+ curl_setopt($ch,CURLOPT_POST, count($curlData));
50
+ curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
51
+ $result = curl_exec($ch);
52
+ curl_close($ch);
53
+
54
+ $result = json_decode($result, true);
55
+ $licence_key = $result['data']['licence_key'];
56
+ if(!empty($licence_key)) {
57
+ file_put_contents(Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'mobi_assets' . DS . 'mobicommerce.ini', md5(sha1($licence_key)));
58
+ $data = array(
59
+ 'ml_licence_key' => $licence_key,
60
+ );
61
+ try {
62
+ Mage::getModel('mobiadmin/licence')->setData($data)->save();
63
+ }catch(Exception $e){
64
+ echo $e->getMessage(); exit;
65
+ }
66
+ }
67
+ }
68
+ }
69
+ ?>
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Applications.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiadmin_Model_Resource_Applications extends Mage_Core_Model_Resource_Db_Abstract{
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/applications', 'id');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Applications/Collection.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Applications_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/applications');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Appsetting.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiadmin_Model_Resource_Appsetting extends Mage_Core_Model_Resource_Db_Abstract{
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/appsetting', 'id');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Appsetting/Collection.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Appsetting_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/appsetting');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Appwidget.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiadmin_Model_Resource_Appwidget extends Mage_Core_Model_Resource_Db_Abstract{
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/appwidget', 'id');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Appwidget/Collection.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Appwidget_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/appwidget');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Categoryicons.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiadmin_Model_Resource_Categoryicons extends Mage_Core_Model_Resource_Db_Abstract{
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/categoryicons', 'mci_id');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Categoryicons/Collection.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Categoryicons_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/categoryicons');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Devicetokens.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiadmin_Model_Resource_Devicetokens extends Mage_Core_Model_Resource_Db_Abstract{
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/devicetokens', 'mm_id');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Devicetokens/Collection.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Devicetokens_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/devicetokens');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Licence.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Licence extends Mage_Core_Model_Resource_Db_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/licence','ml_id');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Licence/Collection.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Licence_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/licence');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Multilanguage.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Multilanguage extends Mage_Core_Model_Resource_Db_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/multilanguage','mm_id');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Multilanguage/Collection.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Multilanguage_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/multilanguage');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Notification.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Notification extends Mage_Core_Model_Resource_Db_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/notification','id');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/Model/Resource/Notification/Collection.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_Model_Resource_Notification_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('mobiadmin/notification');
7
+ }
8
+ }
app/code/local/Mobicommerce/Mobiadmin/controllers/IndexController.php ADDED
@@ -0,0 +1,1330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiadmin_IndexController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+
5
+ public function indexAction()
6
+ {
7
+ $this->loadLayout();
8
+ $this->_setActiveMenu('mobiadmin');
9
+ $this->getLayout()->getBlock('head')->setTitle('Manage Mobile Apps');
10
+ $this->renderLayout();
11
+ }
12
+
13
+ public function _setLanguageCode($localeCode)
14
+ {
15
+ Mage::helper('mobiadmin')->setLanguageCodeData($localeCode);
16
+ }
17
+
18
+ public function editAction()
19
+ {
20
+ $id = $this->getRequest()->getParam('id', null);
21
+ $model = Mage::getModel('mobiadmin/applications');
22
+ if($id)
23
+ {
24
+ $model->load((int) $id);
25
+ if ($model->getId()) {
26
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
27
+ if ($data) {
28
+ $model->setData($data)->setId($id);
29
+ }
30
+ } else {
31
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('mobiadmin')->__('Application does not exist'));
32
+ $this->_redirect('*/*/');
33
+ }
34
+ }
35
+ Mage::register('application_data', $model);
36
+ $appLocaleCode = Mage::helper('mobiadmin')->getAppLocaleCode();
37
+ if($appLocaleCode){
38
+ $this->_setLanguageCode($appLocaleCode);
39
+ }
40
+ $this->loadLayout();
41
+ $this->_setActiveMenu('mobiadmin');
42
+ $applicationData = Mage::registry('application_data');
43
+ $this->getLayout()->getBlock('head')->setTitle($this->__('Edit App '.$applicationData->getAppName()));
44
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
45
+ $this->renderLayout();
46
+ }
47
+
48
+ public function saveAction()
49
+ {
50
+ if ( $this->getRequest()->getPost()){
51
+ $AppId = Mage::app()->getRequest()->getPost('appid');
52
+ $postData = $this->getRequest()->getPost();
53
+ $appCode = $postData['appcode'];
54
+ $appKey = $postData['appkey'];
55
+ $error = false;
56
+ /*
57
+ * Saving personalize Data in Media Application Folder
58
+ */
59
+ $appUrlXmlFile = Mage::getBaseDir('media').DS.'mobi_commerce'.DS.$appCode.DS.'personalizer'.DS.'personalizer.xml';
60
+
61
+ $doc = new DOMDocument('1.0');
62
+ $doc->formatOutput = true;
63
+ $root = $doc->createElement('mobicommerce_personalizer');
64
+ $root = $doc->appendChild($root);
65
+ foreach($postData['personalizer'] as $keyOption => $option_value){
66
+ $optioncodenode = $doc->createElement($keyOption);
67
+ $newdoc = $root->appendChild($optioncodenode);
68
+ foreach($option_value as $optioncode => $value){
69
+ $em = $doc->createElement($optioncode);
70
+ $text = $doc->createTextNode($value);
71
+ $em->appendChild($text);
72
+ $newdoc->appendChild($em);
73
+ }
74
+ }
75
+ $doc->save($appUrlXmlFile);
76
+
77
+ /*
78
+ * Create Css File
79
+ */
80
+
81
+ $theme_folder_name = $postData['themename'];
82
+ if(file_exists ($appUrlXmlFile)){
83
+ $appCssFile = Mage::getBaseDir('media').DS.'mobi_commerce'.DS.$appCode.DS.'personalizer'.DS.'personalizer.css';
84
+ $svgParentFolder = Mage::getBaseDir('media').DS.'mobi_assets'.DS.'theme_files'.DS.$theme_folder_name.DS.'personalizer'.DS.'svg';
85
+ $svgFolder = Mage::getBaseDir('media').DS.'mobi_commerce'.DS.$appCode.DS.'personalizer'.DS.'svg';
86
+ $cssOptionPart = array();
87
+ $personalliseXmlData = simplexml_load_file($appUrlXmlFile);
88
+ foreach($personalliseXmlData as $personalliseXmlOption){
89
+ $OptionCssText = $personalliseXmlOption->css;
90
+ $OptionSvgFilenames = $personalliseXmlOption->svg_filenames;
91
+ $OptionCssText = implode("\r\n", explode('|', $OptionCssText));
92
+ $OptionCerrentColor = $personalliseXmlOption->current_value;
93
+ $cssOptionPart[] = str_replace("--COLOR--",$OptionCerrentColor, $OptionCssText);
94
+
95
+ if(!empty($OptionSvgFilenames)){
96
+ $OptionSvgFilenames = explode('|', $OptionSvgFilenames);
97
+ if(!empty($OptionSvgFilenames)){
98
+ foreach($OptionSvgFilenames as $svg_filename){
99
+ if(file_exists($svgParentFolder . DS . $svg_filename)){
100
+ $svg_image = file_get_contents($svgParentFolder . DS. $svg_filename);
101
+ preg_match_all('/<style>(.*?)<\/style>/s', $svg_image, $style_tag);
102
+ $old_style_tag = $style_tag[1][0];
103
+ $property = explode('{', $style_tag[1][0]);
104
+ $property = $property[0];
105
+ preg_match_all('/{(.*?)}/s', $style_tag[1][0], $style_tag);
106
+ $param = explode(':', $style_tag[1][0]);
107
+ $param = $param[0];
108
+ $new_style_tag = $property.'{'.$param.':'.$OptionCerrentColor.'!important;}';
109
+ $svg_image = str_replace($old_style_tag, $new_style_tag, $svg_image);
110
+ file_put_contents($svgFolder . DS . $svg_filename, $svg_image);
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ file_put_contents($appCssFile,implode($cssOptionPart,"\r\n"));
117
+ }
118
+
119
+ /*
120
+ * Saving Application Store Id in Database
121
+ */
122
+
123
+ $setStore = $postData['ddlStore'];
124
+ $appCode = $postData['appcode'];
125
+ $applicationsCollection = Mage::getModel('mobiadmin/applications')->getCollection();
126
+ $applicationsCollection = $applicationsCollection
127
+ ->addFieldToFilter('app_code', $appCode);
128
+
129
+ foreach($applicationsCollection as $application){
130
+ $application->setData('app_storeid', $setStore)->save();
131
+ }
132
+
133
+
134
+ /*
135
+ * Create Media Url From Media Aplication Path
136
+ */
137
+
138
+ $appinfoimageurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'/'. 'mobi_commerce'.'/'.$appCode.'/'.'appinfo'.'/' ;
139
+
140
+ /*
141
+ * Create Media Url From Media Aplication Path For Banner
142
+ */
143
+ $appgalleryimageurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'/'. 'mobi_commerce'.'/'.$appCode.'/'.'home_banners'.'/' ;
144
+
145
+ /*
146
+ * Saving Push Notification Data With IOSPEM File Uploader
147
+ */
148
+ if($_FILES['upload_iospem_file']['name'] != '')
149
+ {
150
+ try{
151
+ $uploader = new Varien_File_Uploader('upload_iospem_file');
152
+ //$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
153
+ $uploader->setAllowRenameFiles(false);
154
+ $uploader->setFilesDispersion(false);
155
+ $uploader->setAllowCreateFolders(true);
156
+ $media_path = Mage::getBaseDir('media') .DS. 'mobi_commerce'.DS.$appCode.DS.'appinfo'.DS ;
157
+ $iospemFilename = time() . $_FILES['upload_iospem_file']['name'];
158
+ $uploader->save($media_path, $iospemFilename);
159
+ }catch (Exception $e){
160
+ Mage::log($e);
161
+ $this->_redirectError(502);
162
+ }
163
+ $data['upload_iospem_file'] = $iospemFilename;
164
+ }
165
+
166
+ if(!isset($postData['pushnotification']['active_push_notification'])){
167
+ $postData['pushnotification']['active_push_notification'] = '0';
168
+ }
169
+
170
+ if(!isset($postData['pushnotification']['sandboxmode'])){
171
+ $postData['pushnotification']['sandboxmode'] = '0';
172
+ }
173
+
174
+ $pushNotificationData = $postData['pushnotification'];
175
+ if($data['upload_iospem_file']){
176
+ $pushNotificationData['upload_iospem_file_url'] = $appinfoimageurl.$data['upload_iospem_file'];
177
+ $pushNotificationData['upload_iospem_file'] = $data['upload_iospem_file'];
178
+ }else{
179
+ $pushNotificationData['upload_iospem_file_url'] = $postData['upload_iospem_file']['value'];
180
+ $pushNotificationData['upload_iospem_file'] = $postData['upload_iospem_file_name'];
181
+ }
182
+ if(isset($postData['upload_iospem_file']['delete']) && $postData['upload_iospem_file']['delete'] == 1){
183
+ $pushNotificationData['upload_iospem_file_url'] = '';
184
+ $pushNotificationData['upload_iospem_file'] = '';
185
+ }
186
+ $pushNotificationSerData = serialize($pushNotificationData);
187
+
188
+ $applicationSettingCollection = Mage::getModel('mobiadmin/appsetting')->getCollection();
189
+ $applicationSettingCollection = $applicationSettingCollection
190
+ ->addFieldToFilter('app_code',$appCode)
191
+ ->addFieldToFilter('setting_code','push_notification');
192
+ foreach($applicationSettingCollection as $pushnotification){
193
+ $pushnotification->setData('value',$pushNotificationSerData)->save();
194
+ }
195
+
196
+ /*
197
+ * Saving Application Information Data With App Share Image
198
+ */
199
+
200
+ if($_FILES['app_share_image']['name'] != '')
201
+ {
202
+ try{
203
+ $uploader = new Varien_File_Uploader('app_share_image');
204
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
205
+ $uploader->setAllowRenameFiles(false);
206
+ $uploader->setFilesDispersion(false);
207
+ $uploader->setAllowCreateFolders(true);
208
+ $media_path = Mage::getBaseDir('media') .DS. 'mobi_commerce'.DS.$appCode.DS.'appinfo'.DS ;
209
+ $shareImagename = time() . $_FILES['app_share_image']['name'];
210
+ $uploader->save($media_path, $shareImagename);
211
+ }catch (Exception $e){
212
+ Mage::log($e);
213
+ $this->_redirectError(502);
214
+ }
215
+ $data['app_share_image'] = $shareImagename;
216
+ }
217
+ $appInfoData = $postData['appinfo'];
218
+ if($data['app_share_image']){
219
+ $appInfoData['app_share_image'] = $appinfoimageurl.$data['app_share_image'];
220
+ }else{
221
+ $appInfoData['app_share_image'] = $postData['app_share_image']['value'];
222
+ }
223
+
224
+ if(isset($postData['app_share_image']['delete']) && $postData['app_share_image']['delete'] == 1)
225
+ {
226
+ $appInfoData['app_share_image'] = '';
227
+ }
228
+
229
+ $appInfoJsonData = serialize($appInfoData);
230
+ $applicationSettingCollection = Mage::getModel('mobiadmin/appsetting')->getCollection();
231
+ $applicationSettingCollection = $applicationSettingCollection
232
+ ->addFieldToFilter('app_code',$appCode)
233
+ ->addFieldToFilter('setting_code','appinfo');
234
+ foreach($applicationSettingCollection as $appinfo){
235
+ $appinfo->setData('value',$appInfoJsonData)->save();
236
+ }
237
+
238
+
239
+ /*
240
+ * Save Labels and Messages Store Wise Data
241
+ */
242
+
243
+ $localeCode = Mage::getStoreConfig('general/locale/code',$setStore);
244
+
245
+ $languageData = $postData['language_data'];
246
+ foreach ($languageData as $mm_id=>$mm_text){
247
+ $applicationLanguageCollection = Mage::getModel('mobiadmin/multilanguage')->getCollection();
248
+ $applicationLanguageCollection = $applicationLanguageCollection
249
+ ->addFieldToFilter('mm_language_code',$localeCode)
250
+ ->addFieldToFilter('mm_id',$mm_id);
251
+ foreach($applicationLanguageCollection as $applicationLanguage){
252
+ $applicationLanguage->setData('mm_text',$mm_text)->save();
253
+ }
254
+ }
255
+
256
+
257
+ /*
258
+ * Save Feature Product Slider Data
259
+ */
260
+ $featured_products = $postData['featured-products'];
261
+ $featuresliderName = $postData['featured-products-slider-name'];
262
+ $featuresliderPosition = $postData['featured-products-slider-position'];
263
+ $featuresliderStatus = $postData['featured-products-slider-status'];
264
+ $selectedFeatureProduct = array();
265
+
266
+ foreach($featured_products as $index=>$featured_product){
267
+ foreach($featured_products[$index] as $selectedfeature){
268
+ $selectedFeatureProduct[] = $selectedfeature;
269
+ }
270
+ }
271
+ $selectedFeatureProduct = implode(",",$selectedFeatureProduct);
272
+
273
+ if(!empty($featuresliderStatus)){
274
+ $slider_status = '1';
275
+ }else{
276
+ $slider_status = '0';
277
+ }
278
+
279
+ $productSliderCollection = Mage::getModel('mobiadmin/appwidget')->getCollection();
280
+ $productSliderCollection = $productSliderCollection->addFieldToFilter('app_code',$appCode)
281
+ ->addFieldToFilter('slider_code','featured-products');
282
+
283
+ foreach($productSliderCollection as $productSlider) {
284
+ $productSlider->setData('slider_label',$featuresliderName)
285
+ ->setData('slider_position',$featuresliderPosition)
286
+ ->setData('slider_productIds',$selectedFeatureProduct)
287
+ ->setData('slider_status',$slider_status)
288
+ ->save();
289
+ }
290
+
291
+ /*
292
+ * Save Best Collection Product Slider Data
293
+ */
294
+ $best_collection = $postData['best-collection'];
295
+ $bestsliderName = $postData['best-collection-slider-name'];
296
+ $bestsliderPosition = $postData['best-collection-slider-position'];
297
+ $bestsliderStatus = $postData['best-collection-slider-status'];
298
+ $selectedBestProduct = array();
299
+ foreach($best_collection as $index=>$bestCollection){
300
+ foreach($best_collection[$index] as $selectedbest){
301
+ $selectedBestProduct[] = $selectedbest;
302
+ }
303
+ }
304
+ $selectedBestProduct = implode(",",$selectedBestProduct);
305
+ if(isset($bestsliderStatus)){
306
+ $slider_status = '1';
307
+ }else{
308
+ $slider_status = '0';
309
+ }
310
+ $productSliderCollection = Mage::getModel('mobiadmin/appwidget')->getCollection();
311
+ $productSliderCollection = $productSliderCollection->addFieldToFilter('app_code',$appCode)
312
+ ->addFieldToFilter('slider_code','best-collection');
313
+ foreach($productSliderCollection as $productSlider) {
314
+ $productSlider->setData('slider_label',$bestsliderName)
315
+ ->setData('slider_position',$bestsliderPosition)
316
+ ->setData('slider_productIds',$selectedBestProduct)
317
+ ->setData('slider_status',$slider_status)
318
+ ->save();
319
+ }
320
+
321
+ /*
322
+ * Save New Arrivals Product Slider Data
323
+ */
324
+ $new_arrivals = $postData['new-arrivals'];
325
+ $newsliderName = $postData['new-arrivals-slider-name'];
326
+ $newsliderPosition = $postData['new-arrivals-slider-position'];
327
+ $newsliderStatus = $postData['new-arrivals-slider-status'];
328
+ $selectedNewProduct = array();
329
+
330
+ foreach($new_arrivals as $index=>$new_arrival){
331
+ foreach($new_arrivals[$index] as $selectednew){
332
+ $selectedNewProduct[] = $selectednew;
333
+ }
334
+ }
335
+ $selectedNewProduct = implode(",",$selectedNewProduct);
336
+ if(isset($newsliderStatus)){
337
+ $slider_status = '1';
338
+ }else{
339
+ $slider_status = '0';
340
+ }
341
+ $productSliderCollection = Mage::getModel('mobiadmin/appwidget')->getCollection();
342
+ $productSliderCollection = $productSliderCollection->addFieldToFilter('app_code',$appCode)
343
+ ->addFieldToFilter('slider_code','new-arrivals');
344
+ foreach($productSliderCollection as $productSlider) {
345
+ $productSlider->setData('slider_label',$newsliderName)
346
+ ->setData('slider_position',$newsliderPosition)
347
+ ->setData('slider_productIds',$selectedNewProduct)
348
+ ->setData('slider_status',$slider_status)
349
+ ->save();
350
+ }
351
+
352
+ /*
353
+ * Save Best Seller Product Slider Data
354
+ */
355
+ $bestSellers = $postData['best-sellers'];
356
+ $bestSliderName = $postData['best-sellers-slider-name'];
357
+ $bestSliderPosition = $postData['best-sellers-slider-position'];
358
+ $bestSliderStatus = $postData['best-sellers-slider-status'];
359
+ $selectedBestProduct = array();
360
+
361
+ foreach($bestSellers as $index=>$best_seller){
362
+ foreach($bestSellers[$index] as $selectedbest){
363
+ $selectedBestProduct[] = $selectedbest;
364
+ }
365
+ }
366
+ $selectedBestProduct = implode(",",$selectedBestProduct);
367
+ if(isset($bestSliderStatus)){
368
+ $slider_status = '1';
369
+ }else{
370
+ $slider_status = '0';
371
+ }
372
+ $productSliderCollection = Mage::getModel('mobiadmin/appwidget')->getCollection();
373
+ $productSliderCollection = $productSliderCollection->addFieldToFilter('app_code',$appCode)
374
+ ->addFieldToFilter('slider_code','best-sellers');
375
+ foreach($productSliderCollection as $productSlider) {
376
+ $productSlider->setData('slider_label',$bestSliderName)
377
+ ->setData('slider_position',$bestSliderPosition)
378
+ ->setData('slider_productIds',$selectedBestProduct)
379
+ ->setData('slider_status',$slider_status)
380
+ ->save();
381
+ }
382
+
383
+ /*
384
+ * Save Push Notification Setting
385
+ */
386
+ $pushnotification= $postData['pushnotifications'];
387
+
388
+ $applicationSettingCollection = Mage::getModel('mobiadmin/appsetting')->getCollection();
389
+ $applicationSettingCollection = $applicationSettingCollection
390
+ ->addFieldToFilter('app_code',$appCode)
391
+ ->addFieldToFilter('setting_code','pushnotifications_settings');
392
+ foreach($applicationSettingCollection as $appinfo){
393
+ $appinfo->setData('value',$pushnotification)->save();
394
+ }
395
+
396
+ /*
397
+ * Save Category Icons
398
+ */
399
+ if(isset($postData['category-icon'])){
400
+ $category_icons = $postData['category-icon'];
401
+
402
+ $cate_index = 0;
403
+ $category_iconarray = array();
404
+ foreach($category_icons as $cat_id => $category_icon){
405
+ $category_iconarray[$cate_index]['category_id'] = $cat_id;
406
+ $category_iconarray[$cate_index]['mobiicon'] = $category_icon;
407
+ $cate_index++;
408
+ }
409
+ //echo $appCode;
410
+
411
+ $category_iconarray = serialize($category_iconarray);
412
+
413
+ $applicationSettingCollection = Mage::getModel('mobiadmin/appsetting')->getCollection();
414
+ $applicationSettingCollection = $applicationSettingCollection
415
+ ->addFieldToFilter('app_code',$appCode)
416
+ ->addFieldToFilter('setting_code','category_icons');
417
+ $category_iconsValue = $applicationSettingCollection->getColumnValues('category_icons');
418
+ if(empty($category_iconsValue)){
419
+ $inserData = array('app_code'=>$appCode,'setting_code'=>'category_icons','value'=>$category_iconarray);
420
+ $model = Mage::getModel('mobiadmin/appsetting')->setData($inserData);
421
+ try {
422
+ $insertId = $model->save()->getId();
423
+ } catch (Exception $e){
424
+ echo $e->getMessage();
425
+ }
426
+ } else {
427
+ foreach($applicationSettingCollection as $categoryIcon){
428
+ $categoryIcon->setData('value',$category_iconarray)->save();
429
+ }
430
+ }
431
+ }
432
+
433
+ /*
434
+ * Save Cms Content Data with Contact Information
435
+ */
436
+ $cmscontentarray = array();
437
+ $cmscontentarray['en_US']['contact_information'] = $postData['contact_information'];
438
+ $cmscontentarray['en_US']['social_media'] = $postData['social_media'];
439
+ $cmscontentarray['en_US']['cms_pages'] = $postData['cms_pages'];
440
+
441
+ $cmscontentarray = serialize($cmscontentarray);
442
+ $applicationSettingCollection = Mage::getModel('mobiadmin/appsetting')->getCollection();
443
+ $applicationSettingCollection = $applicationSettingCollection
444
+ ->addFieldToFilter('app_code',$appCode)
445
+ ->addFieldToFilter('setting_code','cms_settings');
446
+ foreach($applicationSettingCollection as $cmssetting){
447
+ $cmssetting->setData('value',$cmscontentarray)->save();
448
+ }
449
+
450
+
451
+ /*
452
+ * Save Banners Url in Database
453
+ */
454
+ //echo '<pre>';print_r($_FILES);print_r($postData);exit;
455
+ $bannerImages = array();
456
+ $previousBanners = Mage::helper('mobiadmin')->getBannerImagesByAppCode($appCode);
457
+ //echo '<pre>';print_r($previousBanners);exit;
458
+ if(isset($_FILES['banner']['name']) && !empty($_FILES['banner']['name'])){
459
+ foreach($_FILES['banner']['name'] as $banner_key => $banner){
460
+ if($_FILES['banner']['name'][$banner_key] == ''){
461
+ $bannerImages[] = array(
462
+ 'url' => $previousBanners[$banner_key]['url'],
463
+ 'is_active' => isset($postData['bannerisactive'][$banner_key]) ? '1': '0'
464
+ );
465
+ }
466
+ else if($_FILES['banner']['error'][$banner_key] != 0){
467
+ $bannerImages[] = array(
468
+ 'url' => $previousBanners[$banner_key]['url'],
469
+ 'is_active' => isset($postData['bannerisactive'][$banner_key]) ? '1': '0'
470
+ );
471
+ }
472
+ else if(!in_array(strtolower(PATHINFO($_FILES['banner']['name'][$banner_key], PATHINFO_EXTENSION)), array('jpg','jpeg','gif','png'))){
473
+ $bannerImages[] = array(
474
+ 'url' => $previousBanners[$banner_key]['url'],
475
+ 'is_active' => isset($postData['bannerisactive'][$banner_key]) ? '1': '0'
476
+ );
477
+ Mage::getSingleton('core/session')->addError("Image File Type Must PNG, GIF, JPG");
478
+ }
479
+ else{
480
+ try{
481
+ /*
482
+ $uploader = new Varien_File_Uploader('banner4');
483
+ $uploader->setAllowRenameFiles(false);
484
+ $uploader->setFilesDispersion(false);
485
+ $uploader->setAllowCreateFolders(true);
486
+ */
487
+ $media_path = Mage::getBaseDir('media') .DS. 'mobi_commerce'.DS.$appCode.DS.'home_banners'.DS ;
488
+ $filename = rand() . '.' . PATHINFO($_FILES['banner']['name'][$banner_key], PATHINFO_EXTENSION);
489
+ //$uploader->save($media_path, $_FILES['banner']['name'][$banner_key]);
490
+ if (move_uploaded_file($_FILES['banner']['tmp_name'][$banner_key], $media_path . $filename)) {
491
+ $bannerImages[] = array(
492
+ 'url' => $appgalleryimageurl.$filename,
493
+ 'is_active' => isset($postData['bannerisactive'][$banner_key]) ? '1': '0'
494
+ );
495
+ }
496
+ else{
497
+ $bannerImages[] = array(
498
+ 'url' => $previousBanners[$banner_key]['url'],
499
+ 'is_active' => isset($postData['bannerisactive'][$banner_key]) ? '1': '0'
500
+ );
501
+ Mage::getSingleton('core/session')->addError("There is some error uploading file");
502
+ }
503
+ }catch (Exception $e){
504
+ Mage::log($e);
505
+ $this->_redirectError(502);
506
+ }
507
+ }
508
+ }
509
+ }
510
+ //echo '<pre>';print_r($bannerImages);exit;
511
+ $bannerValue = serialize($bannerImages);
512
+
513
+ $applicationSettingCollection = Mage::getModel('mobiadmin/appsetting')->getCollection();
514
+ $applicationSettingCollection = $applicationSettingCollection
515
+ ->addFieldToFilter('app_code',$appCode)
516
+ ->addFieldToFilter('setting_code','banner_settings');
517
+ foreach($applicationSettingCollection as $bannersColl){
518
+ $bannersColl->setData('value',$bannerValue)->save();
519
+ }
520
+
521
+ /*
522
+ * Save Best Sellers Automated Data
523
+ */
524
+ $BestSellerCollection = Mage::helper('mobiadmin')->getBestSellerProduct($setStore);
525
+ $BestSellerProducts = $BestSellerCollection;
526
+ $BestSellerProductIds = array();
527
+ foreach($BestSellerProducts as $BestSellerProduct){
528
+ $BestSellerProductIds[] = $BestSellerProduct->getEntityId();
529
+ }
530
+ $BestSellerProductIds = implode(',',$BestSellerProductIds);
531
+ $sliderStatus = $postData['best-sellers-automated-slider-status'];
532
+ $bestSellerSliderName = $postData['best-sellers-automated-slider-name'];
533
+ $bestSellerSliderPosition = $postData['best-sellers-automated-slider-position'];
534
+
535
+ $slider_settings = $postData['best-sellers-automated'];
536
+ $slider_settings = json_encode($slider_settings);
537
+ if(!empty($sliderStatus)){
538
+ $slider_status = '1';
539
+ }else{
540
+ $slider_status = '0';
541
+ }
542
+ $productSliderCollection = Mage::getModel('mobiadmin/appwidget')->getCollection();
543
+ $productSliderCollection = $productSliderCollection->addFieldToFilter('app_code',$appCode)
544
+ ->addFieldToFilter('slider_code','best-sellers-automated');
545
+ foreach($productSliderCollection as $productSlider) {
546
+ $productSlider->setData('slider_label',$bestSellerSliderName)
547
+ ->setData('slider_position',$bestSellerSliderPosition)
548
+ ->setData('slider_productIds',$BestSellerProductIds)
549
+ ->setData('slider_status',$slider_status)
550
+ ->setData('slider_settings',$slider_settings)
551
+ ->save();
552
+ }
553
+
554
+ /*
555
+ * Save New Products Automated Data in Database
556
+ */
557
+ $NewProductCollection = Mage::helper('mobiadmin')->getNewProductCollection($setStore);
558
+ $NewProducts = $NewProductCollection;
559
+ $NewProductsIds = array();
560
+ foreach($NewProducts as $NewProduct){
561
+ $NewProductsIds[] = $NewProduct->getEntityId();
562
+ }
563
+ $NewProductsIds = implode(',',$NewProductsIds);
564
+ $sliderStatus = $postData['new-arrivals-automated-slider-status'];
565
+ $newArrivalsSliderName = $postData['new-arrivals-automated-slider-name'];
566
+ $newArivalsSliderPosition = $postData['new-arrivals-automated-slider-position'];
567
+ if(!empty($sliderStatus)){
568
+ $slider_status = '1';
569
+ }else{
570
+ $slider_status = '0';
571
+ }
572
+ $productSliderCollection = Mage::getModel('mobiadmin/appwidget')->getCollection();
573
+ $productSliderCollection = $productSliderCollection->addFieldToFilter('app_code',$appCode)
574
+ ->addFieldToFilter('slider_code','new-arrivals-automated');
575
+ foreach($productSliderCollection as $productSlider) {
576
+ $productSlider->setData('slider_label',$newArrivalsSliderName)
577
+ ->setData('slider_position',$newArivalsSliderPosition)
578
+ ->setData('slider_productIds',$NewProductsIds)
579
+ ->setData('slider_status',$slider_status)
580
+ ->save();
581
+ }
582
+
583
+ if(isset($_FILES['popupimage']['name']) && !empty($_FILES['popupimage']['name']))
584
+ {
585
+ try {
586
+ $uploader = new Varien_File_Uploader('popupimage');
587
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
588
+ $uploader->setAllowRenameFiles(false);
589
+ $uploader->setFilesDispersion(false);
590
+ $media_path = Mage::getBaseDir('media') .DS. 'mobi_commerce'.DS.$appCode.DS.'appinfo'.DS ;
591
+ $imgFilename = time() . $_FILES['popupimage']['name'];
592
+ $uploader->save($media_path, $imgFilename);
593
+ $data['popupimage'] = $appinfoimageurl.$imgFilename;
594
+ }catch(Exception $e){
595
+ Mage::log($e);
596
+ $this->_redirectError(502);
597
+ }
598
+ }
599
+
600
+ /*
601
+ * Save Pop Up Setting
602
+ */
603
+ $PopUpData = array();
604
+ $PopUpData['enable'] = $postData['popup']['enable'];
605
+ $PopUpData['cookietime'] = $postData['popup']['cookietime'];
606
+ if(isset($data['popupimage'])){
607
+ $PopUpData['popupimage'] = $data['popupimage'];
608
+ }else{
609
+ $PopUpData['popupimage'] = $postData['popupimage_hidden'];
610
+ }
611
+ if(isset($postData['popupimage']['delete']) && $postData['popupimage']['delete'] == 1)
612
+ {
613
+ $PopUpData['popupimage'] = '';
614
+ }
615
+ $PopUpData = serialize($PopUpData);
616
+ $appPopUpCollection = Mage::getModel('mobiadmin/appsetting')->getCollection();
617
+
618
+ $appPopUpCollection = $appPopUpCollection
619
+ ->addFieldToFilter('app_code',$appCode)
620
+ ->addFieldToFilter('setting_code','popup_setting');
621
+
622
+ if($appPopUpCollection->count() == '0'){
623
+ $appinfoData = array(
624
+ 'app_code' => $appCode,
625
+ 'setting_code' => 'popup_setting',
626
+ 'value' => $PopUpData
627
+ );
628
+
629
+ try {
630
+ Mage::getModel('mobiadmin/appsetting')->setData($appinfoData)->save();
631
+ }catch(Exception $e){
632
+ $errors[] = $e->getMessage();
633
+ }
634
+
635
+ }else{
636
+ foreach($appPopUpCollection as $appPopUp){
637
+ $appPopUp->setData('value',$PopUpData)->save();
638
+ }
639
+ }
640
+
641
+
642
+ /*
643
+ * Sending Android and IOS Push Notification
644
+ * $pushNotificationData push notification Data From Application Setting Tabs
645
+ * $pushnotification pushnotification setting From PushNotification Tabs
646
+ *
647
+ */
648
+ $this->androidpushnotification($pushnotification, $pushNotificationData, $appCode);
649
+ $this->iospushnotification($appCode);
650
+
651
+ if(isset($postData['udid']) && !empty($postData['udid']))
652
+ {
653
+ $udids = $postData['udid'];
654
+ $datatosend = array('udid' => $udids);
655
+
656
+ $ch = curl_init();
657
+ $url = Mage::helper('mobiadmin')->curlBuildUrl().'/build/submitudid/'.$appKey.'/'.$appCode;
658
+ //echo $url;
659
+ curl_setopt($ch, CURLOPT_HEADER, FALSE);
660
+ curl_setopt($ch, CURLOPT_NOBODY, TRUE); // remove body
661
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
662
+ curl_setopt($ch,CURLOPT_URL, $url);
663
+ curl_setopt($ch,CURLOPT_POST, count($datatosend));
664
+ curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($datatosend));
665
+ $result = curl_exec($ch);
666
+ curl_close($ch);
667
+
668
+ $result = json_decode($result, true);
669
+
670
+ if(isset($result)) {
671
+ if($result['status'] == 'success')
672
+ {
673
+ foreach($applicationsCollection as $application){
674
+ $application
675
+ ->setData('udid', $udids)
676
+ ->setData('ios_url', $result['data']['ios_url'])
677
+ ->setData('ios_status', $result['data']['ios_status'])
678
+ ->save();
679
+ }
680
+
681
+ } else {
682
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__($result['message']));
683
+ $this->_redirect('*/*/edit', array(
684
+ 'id' => $AppId,
685
+ '_current'=>true
686
+ ));
687
+ }
688
+ }
689
+ }
690
+ if(!empty($errors) && isset($errors)){
691
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__($errors));
692
+ }else{
693
+ $message = $this->__('Application is successfully Save.');
694
+ Mage::getSingleton('core/session')->addSuccess($message);
695
+ }
696
+
697
+ $AppId = Mage::app()->getRequest()->getPost('appid');
698
+ $this->_redirect('*/*/edit', array(
699
+ 'id' => $AppId,
700
+ '_current'=>true
701
+ ));
702
+ }
703
+ }
704
+
705
+ public function deleteAction()
706
+ {
707
+ $appId = Mage::app()->getRequest()->getParam('id');
708
+ if( $appId ) {
709
+ try {
710
+ $applicationCollection = Mage::getModel('mobiadmin/applications')->getCollection();
711
+ $applicationCollection = $applicationCollection->addFieldToFilter('id',$appId);
712
+ $appData = $applicationCollection->getData();
713
+ $appData = $appData['0'];
714
+ $appCode = $appData['app_code'];
715
+
716
+ /*
717
+ * Delete Interies From Widget Table
718
+ * `mobi_app_widgets`
719
+ */
720
+ $appwidgetModel = Mage::getModel('mobiadmin/appwidget')->getCollection()->addFieldToFilter('app_code',$appCode);
721
+ foreach ($appwidgetModel as $appwidgetModel) {
722
+ $appwidgetModel->delete();
723
+ }
724
+ /*
725
+ * Delete Interies From Application Setting Table
726
+ * `mobicommerce_applications_settings`
727
+ */
728
+
729
+ $applicationSetting = Mage::getModel('mobiadmin/appsetting')->getCollection()->addFieldToFilter('app_code',$appCode);
730
+ foreach ($applicationSetting as $application) {
731
+ $application->delete();
732
+ }
733
+
734
+ /**
735
+ * Delete Interies from Deveice Token table
736
+ * `mobicommerce_devicetokens`
737
+ */
738
+
739
+ $deviceTokenCollection = Mage::getModel('mobiadmin/devicetokens')->getCollection()->addFieldToFilter('md_appcode',$appCode);
740
+ foreach ($deviceTokenCollection as $deviceToken) {
741
+ $deviceToken->delete();
742
+ }
743
+
744
+ /**
745
+ * Delete Interies From Main Table Of Application
746
+ * `mobicommerce_applications`
747
+ */
748
+ $appCollection = Mage::getModel('mobiadmin/applications')->getCollection()->addFieldToFilter('id',$this->getRequest()->getParam('id'));
749
+ foreach($appCollection as $appDelete){
750
+ $appDelete->delete();
751
+ }
752
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Application was successfully deleted'));
753
+ $this->_redirect('*/*/');
754
+ } catch (Exception $e) {
755
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
756
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
757
+ }
758
+ }
759
+ $this->_redirect('*/*/');
760
+ }
761
+
762
+ public function iconsAction()
763
+ {
764
+ $id = $this->getRequest()->getParam('id', null);
765
+ $model = Mage::getModel('mobiadmin/applications')->load($id);
766
+ if($id){
767
+ Mage::register('application_data', $model);
768
+ $this->loadLayout();
769
+ $myBlock = $this->getLayout()->createBlock('mobiadmin/adminhtml_applications_edit_tab_icon');
770
+ $myBlock->setTemplate('mobiadmin/application/edit/tab/icon.phtml');
771
+ $myHtml = $myBlock->toHtml();
772
+ $this->getResponse()->setHeader('Content-Type', 'text/html')
773
+ ->setBody($myHtml);
774
+ return;
775
+ }
776
+ }
777
+
778
+ public function androidpushnotification($pushsetting,$pushnotificationData,$appCode)
779
+ {
780
+ $devicetokens = array();
781
+ $android_key = $pushnotificationData['android_key'];
782
+ $message = $pushsetting;
783
+ $deviceCollection = Mage::getModel('mobiadmin/devicetokens')->getCollection()
784
+ ->addFieldToFilter('md_appcode',$appCode)
785
+ ->addFieldToFilter('md_devicetype','android');
786
+ foreach($deviceCollection as $device) {
787
+ $devicetokens[] = $device->getData('md_devicetoken');
788
+ }
789
+ if(!empty($android_key) && !empty($devicetokens) && !empty($message)){
790
+ $msg = array(
791
+ 'message' => $message,
792
+ 'title' => $message,
793
+ 'vibrate' => 1,
794
+ 'sound' => 1
795
+ );
796
+ $fields = array(
797
+ 'registration_ids' => $devicetokens,
798
+ 'data' => $msg
799
+ );
800
+
801
+ $headers = array(
802
+ 'Authorization: key=' . $android_key,
803
+ 'Content-Type: application/json'
804
+ );
805
+ $ch = curl_init();
806
+ curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
807
+ curl_setopt( $ch,CURLOPT_POST, true );
808
+ curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
809
+ curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
810
+ curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
811
+ curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
812
+ $result = curl_exec($ch );
813
+ curl_close( $ch );
814
+ }
815
+ }
816
+
817
+ function iospushnotification($appCode)
818
+ {
819
+ $deviceToken = array();
820
+ $pemFile = "";
821
+ $passphrase = "";
822
+ $message = "";
823
+ $sandboxmode = false;
824
+
825
+ $deviceCollection = Mage::getModel('mobiadmin/devicetokens')->getCollection()
826
+ ->addFieldToFilter('md_appcode',$appCode)
827
+ ->addFieldToFilter('md_devicetype','android');
828
+ foreach($deviceCollection as $device) {
829
+ $deviceToken[] = $device->getData('md_devicetoken');
830
+ }
831
+
832
+ $pushCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
833
+ ->addFieldToFilter('app_code',$appCode)
834
+ ->addFieldToFilter('setting_code','push_notification');
835
+
836
+ if($pushCollection->count() != '0') {
837
+ $pushUnSerData = $pushCollection->getData();
838
+ $a = unserialize($pushUnSerData['value']);
839
+
840
+ $passphrase = $a['pem_password'];
841
+ if(!empty($a['upload_iospem_file_url'])):
842
+ $pemFile = pathinfo($a['upload_iospem_file_url'], PATHINFO_BASENAME);
843
+ $pemFile = Mage::getBaseDir('media').'/mobi_commerce/'.$data['app_code'].'/certificates/'.$pemFile;
844
+ endif;
845
+
846
+ if(isset($a['sandboxmode']) && $a['sandboxmode'] == '1'):
847
+ $sandboxmode = true;
848
+ endif;
849
+ }
850
+ $pushMessageCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
851
+ ->addFieldToFilter('app_code',$appCode)
852
+ ->addFieldToFilter('setting_code','pushnotifications_settings');
853
+
854
+ if($pushMessageCollection->count() != '0') {
855
+ $pushMessage = $pushMessageCollection->getData();
856
+ $message = $pushMessage['value'];
857
+ }
858
+
859
+
860
+ if(!empty($pemFile) && !empty($message)){
861
+ $ctx = stream_context_create();
862
+ stream_context_set_option($ctx, 'ssl', 'local_cert', $pemFile);
863
+ stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
864
+
865
+ // Open a connection to the APNS server
866
+ $push_url = "ssl://gateway.push.apple.com:2195";
867
+ if($sandboxmode){
868
+ $push_url = "ssl://gateway.sandbox.push.apple.com:2195";
869
+ }
870
+
871
+ $fp = stream_socket_client(
872
+ $push_url, $err,
873
+ $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
874
+
875
+ if (!$fp)
876
+ return "Failed to connect: $err $errstr" . PHP_EOL;
877
+
878
+ //echo 'Connected to APNS' . PHP_EOL;
879
+
880
+ // Create the payload body
881
+ $body['aps'] = array(
882
+ 'alert' => $message,
883
+ 'sound' => 'default'
884
+ );
885
+
886
+ // Encode the payload as JSON
887
+ $payload = json_encode($body);
888
+
889
+ if(!empty($deviceToken))
890
+ {
891
+ foreach ($deviceToken as $key => $value) {
892
+ $msg = chr(0) . pack('n', 32) . pack('H*', $value) . pack('n', strlen($payload)) . $payload;
893
+
894
+ // Send it to the server
895
+ $result = fwrite($fp, $msg, strlen($msg));
896
+
897
+ if (!$result){
898
+ //echo 'Message not delivered' . PHP_EOL;
899
+ }
900
+ else{
901
+ //echo 'Message successfully delivered' . PHP_EOL;
902
+ }
903
+ }
904
+ }
905
+
906
+ // Close the connection to the server
907
+ fclose($fp);
908
+ return true;
909
+ }
910
+ return false;
911
+ }
912
+
913
+ public function newAction()
914
+ {
915
+ $this->loadLayout();
916
+ $this->_setActiveMenu('mobiadmin');
917
+ $this->getLayout()->getBlock('head')->setTitle('Create New Mobile App');
918
+ $this->renderLayout();
919
+ }
920
+
921
+ public function notificationAction()
922
+ {
923
+ $this->loadLayout();
924
+ $this->_setActiveMenu('mobiadmin');
925
+ $this->getLayout()->getBlock('head')->setTitle('Mobicommerce Notification');
926
+ $this->renderLayout();
927
+ }
928
+
929
+ public function massReadAction()
930
+ {
931
+ $ids = Mage::app()->getRequest()->getParam('ids');
932
+
933
+ if(is_array($ids)){
934
+ foreach($ids as $id)
935
+ {
936
+ $model = Mage::getModel('mobiadmin/notification');
937
+
938
+ $model->setId($id)->setReadStatus('1')
939
+ ->save();
940
+ }
941
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('The message has been marked as read.'));
942
+ $this->_redirect('mobicommerce/index/notification');
943
+ }
944
+ $this->_redirect('mobicommerce/index/notification');
945
+
946
+ }
947
+
948
+ public function massDeleteAction()
949
+ {
950
+ $ids = Mage::app()->getRequest()->getParam('ids');
951
+
952
+ if(is_array($ids)){
953
+ foreach($ids as $id)
954
+ {
955
+ $model = Mage::getModel('mobiadmin/notification');
956
+
957
+ $model->setId($id)
958
+ ->delete();
959
+ }
960
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Message was successfully deleted'));
961
+ $this->_redirect('mobicommerce/index/notification');
962
+ }
963
+ $this->_redirect('mobicommerce/index/notification');
964
+ }
965
+
966
+ public function deletenotificationAction()
967
+ {
968
+ if( $this->getRequest()->getParam('id') > 0 ) {
969
+ try {
970
+ $model = Mage::getModel('mobiadmin/notification');
971
+
972
+ $model->setId($this->getRequest()->getParam('id'))
973
+ ->delete();
974
+
975
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Message was successfully deleted'));
976
+ $this->_redirect('mobicommerce/index/notification');
977
+ } catch (Exception $e) {
978
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
979
+ $this->_redirect('*/*/', array('id' => $this->getRequest()->getParam('id')));
980
+ }
981
+ }
982
+ $this->_redirect('mobicommerce/index/notification');
983
+ }
984
+
985
+ public function readnotificationAction()
986
+ {
987
+ if( $this->getRequest()->getParam('id') > 0 ) {
988
+ try {
989
+ $model = Mage::getModel('mobiadmin/notification');
990
+
991
+ $model->setId($this->getRequest()->getParam('id'))
992
+ ->setReadStatus('1')->save();
993
+
994
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('The message has been marked as read.'));
995
+ $this->_redirect('mobicommerce/index/notification');
996
+ } catch (Exception $e) {
997
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
998
+ $this->_redirect('*/*/', array('id' => $this->getRequest()->getParam('id')));
999
+ }
1000
+ }
1001
+ $this->_redirect('mobicommerce/index/notification');
1002
+ }
1003
+
1004
+ public function createAppAction()
1005
+ {
1006
+
1007
+ $refererUrl = $this->_getRefererUrl();
1008
+ $validation = true;
1009
+ if(!empty($_FILES)) {
1010
+ if($_FILES['appsplash']['name'] != '' && strtolower(PATHINFO($_FILES['appsplash']['name'], PATHINFO_EXTENSION)) != 'png'){
1011
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Splash must be png'));
1012
+ Mage::getSingleton('core/session')->setData( 'createapp', Mage::app()->getRequest()->getPost());
1013
+ $validation = false;
1014
+ }
1015
+
1016
+ if($_FILES['applogo']['name'] != '' && strtolower(PATHINFO($_FILES['applogo']['name'], PATHINFO_EXTENSION)) != 'png'){
1017
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Logo must be png'));
1018
+ Mage::getSingleton('core/session')->setData( 'createapp', Mage::app()->getRequest()->getPost());
1019
+ $validation = false;
1020
+ }
1021
+
1022
+ if($_FILES['appicon']['name'] != '' && strtolower(PATHINFO($_FILES['appicon']['name'], PATHINFO_EXTENSION)) != 'png'){
1023
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Icon must be png'));
1024
+ Mage::getSingleton('core/session')->setData( 'createapp', Mage::app()->getRequest()->getPost());
1025
+ $validation = false;
1026
+ }
1027
+
1028
+ if(!$validation)
1029
+ {
1030
+ $url = $refererUrl;
1031
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
1032
+ return;
1033
+ }
1034
+ }
1035
+
1036
+ $postData = Mage::app()->getRequest()->getPost();
1037
+ if(!isset($postData)){
1038
+ $url = $refererUrl;
1039
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
1040
+ return;
1041
+ }
1042
+ $this->_sendEmailBeforeCreateApp($postData);
1043
+ $resource = Mage::getSingleton('core/resource');
1044
+ $connection = $resource->getConnection('core_read');
1045
+ $app_table_name = $resource->getTableName('mobiadmin/applications');
1046
+ $tableStatus = $connection->showTableStatus($app_table_name);
1047
+ $next_app_id = $tableStatus['Auto_increment'];
1048
+ $stores = Mage::app()->getStores();
1049
+ $storeIds = array();
1050
+ foreach($stores as $store){
1051
+ $storeIds[] = $store->getData('store_id');
1052
+ }
1053
+
1054
+ $curlData = array();
1055
+
1056
+ $curlData = $postData;
1057
+ $mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'mobi_commerce/';
1058
+ $mediaMobiAssetUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'mobi_assets/defaults/';
1059
+
1060
+
1061
+ //Upload AppSplash
1062
+ if(isset($_FILES['appsplash']['name']) && !empty($_FILES['appsplash']['name']))
1063
+ {
1064
+ try {
1065
+ $uploader = new Varien_File_Uploader('appsplash');
1066
+ $uploader->setAllowRenameFiles(false);
1067
+ $uploader->setAllowCreateFolders(true);
1068
+ $uploader->setFilesDispersion(false);
1069
+ $media_path = Mage::getBaseDir('media') .DS. 'mobi_commerce';
1070
+ $imgFilename = time() .$_FILES['appsplash']['name'];
1071
+ $uploader->save($media_path, $imgFilename);
1072
+ $curlData['appsplash'] = $mediaUrl.$imgFilename;
1073
+ }catch(Exception $e){
1074
+ Mage::log($e);
1075
+ $this->_redirectError(502);
1076
+ }
1077
+ }
1078
+
1079
+ //Upload applogo
1080
+ if(isset($_FILES['applogo']['name']) && !empty($_FILES['applogo']['name']))
1081
+ {
1082
+ try {
1083
+ $uploader = new Varien_File_Uploader('applogo');
1084
+ $uploader->setAllowRenameFiles(false);
1085
+ $uploader->setFilesDispersion(false);
1086
+ $media_path = Mage::getBaseDir('media') .DS. 'mobi_commerce';
1087
+ $imgFilename = time() .$_FILES['applogo']['name'];
1088
+ $uploader->save($media_path, $imgFilename);
1089
+ $curlData['applogo'] = $mediaUrl.$imgFilename;
1090
+ } catch(Exception $e) {
1091
+ Mage::log($e);
1092
+ $this->_redirectError(502);
1093
+ }
1094
+ }
1095
+
1096
+ //Upload appicon
1097
+ if(isset($_FILES['appicon']['name']) && !empty($_FILES['appicon']['name']))
1098
+ {
1099
+ try {
1100
+ $uploader = new Varien_File_Uploader('appicon');
1101
+ $uploader->setAllowRenameFiles(false);
1102
+ $uploader->setFilesDispersion(false);
1103
+ $media_path = Mage::getBaseDir('media') .DS. 'mobi_commerce';
1104
+ $imgFilename = time() .$_FILES['appicon']['name'];
1105
+ $uploader->save($media_path, $imgFilename);
1106
+ $curlData['appicon'] = $mediaUrl.$imgFilename;
1107
+ }catch(Exception $e){
1108
+ Mage::log($e);
1109
+ $this->_redirectError(502);
1110
+ }
1111
+ }
1112
+
1113
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
1114
+ $db->closeConnection();
1115
+ $db->getConnection();
1116
+ $db = Mage::getSingleton('core/resource')->getConnection('core_write');
1117
+ $db->closeConnection();
1118
+ $db->getConnection();
1119
+
1120
+ if(isset($curlData['appsplash'])){
1121
+ $size = getimagesize($curlData['appsplash']);
1122
+ $maxWidth = 1536;
1123
+ $maxHeight = 2048;
1124
+ if ($size[0] != $maxWidth || $size[1] != $maxHeight)
1125
+ {
1126
+ @unlink($curlData['appsplash']);
1127
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Appsplash Icon dimenssion must be 1536X2048'));
1128
+ Mage::getSingleton('core/session')->setData( 'createapp', Mage::app()->getRequest()->getPost());
1129
+ $url = $refererUrl;
1130
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
1131
+ return;
1132
+ }
1133
+ }
1134
+ if(isset($curlData['appicon'])){
1135
+ $size = getimagesize($curlData['appicon']);
1136
+ $maxWidth = 1024;
1137
+ $maxHeight = 1024;
1138
+ if ($size[0] != $maxWidth || $size[1] != $maxHeight)
1139
+ {
1140
+ @unlink($curlData['appicon']);
1141
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('App Icon dimenssion must be 1024X1024'));
1142
+ Mage::getSingleton('core/session')->setData( 'createapp', Mage::app()->getRequest()->getPost());
1143
+ $url = $refererUrl;
1144
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
1145
+ return;
1146
+ }
1147
+ }
1148
+ if(!isset($curlData['appsplash']))
1149
+ {
1150
+ $curlData['appsplash'] = $mediaMobiAssetUrl.'splash.png';
1151
+ }
1152
+ if(!isset($curlData['applogo'])) {
1153
+ $curlData['applogo'] = $mediaMobiAssetUrl.'logo.png';
1154
+ }
1155
+ if(!isset($curlData['appicon'])) {
1156
+ $curlData['appicon'] = $mediaMobiAssetUrl.'icon.png';
1157
+ }
1158
+ $storeId = $curlData['store'];
1159
+ $curlData['approoturl'] = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
1160
+ $curlData['media_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
1161
+ /* code for licence key */
1162
+ $LicenceModel = Mage::getModel('mobiadmin/licence')->getCollection();
1163
+ $licencekey = "";
1164
+ if($LicenceModel->getLastItem())
1165
+ {
1166
+ $licencekey = $LicenceModel->getLastItem()->getMlLicenceKey();
1167
+ }
1168
+ $curlData['applicencekey'] = $licencekey;
1169
+ /* code for licence key - upto here */
1170
+
1171
+ $fields_string = '';
1172
+ foreach($curlData as $key=>$value) {
1173
+ $fields_string .= $key.'='.$value.'&';
1174
+ }
1175
+ rtrim($fields_string, '&');
1176
+
1177
+ $ch = curl_init();
1178
+
1179
+ $url = Mage::helper('mobiadmin')->curlBuildUrl().'build/add';
1180
+ curl_setopt($ch, CURLOPT_HEADER, FALSE);
1181
+ curl_setopt($ch, CURLOPT_NOBODY, TRUE); // remove body
1182
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
1183
+ curl_setopt($ch,CURLOPT_URL, $url);
1184
+ curl_setopt($ch,CURLOPT_POST, count($curlData));
1185
+ curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($curlData));
1186
+ $result = curl_exec($ch);
1187
+ curl_close($ch);
1188
+
1189
+ $result = json_decode($result, true);
1190
+
1191
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
1192
+ $db->closeConnection();
1193
+ $db->getConnection();
1194
+ $db = Mage::getSingleton('core/resource')->getConnection('core_write');
1195
+ $db->closeConnection();
1196
+ $db->getConnection();
1197
+
1198
+ if(isset($result)) {
1199
+ if($result['status'] == 'success')
1200
+ {
1201
+ $saveData = array();
1202
+ $saveData['app_name'] = $curlData['appname'];
1203
+ $saveData['app_code'] = $result['data']['appcode'];
1204
+ $saveData['app_preview_code'] = $result['data']['appkey'];
1205
+ $saveData['app_logo'] = $curlData['applogo'];
1206
+ $saveData['app_theme_folder_name'] = $curlData['apptheme'];
1207
+ $saveData['app_licence_key'] = '';
1208
+ $android_url = $result['data']['android_url'];
1209
+ $ios_url = $result['data']['ios_url'];
1210
+ $android_status = $result['data']['android_status'];
1211
+ $ios_status = $result['data']['ios_status'];
1212
+ $webapp_url = $result['data']['webapp_url'];
1213
+ $saveData['webapp_url'] = $webapp_url;
1214
+ $udids = $curlData['udid'];
1215
+ if(!empty($udids))
1216
+ {
1217
+ $saveData['udid'] = $udids;
1218
+ }
1219
+ $saveData['android_url'] = $android_url;
1220
+ $saveData['ios_url'] = $ios_url;
1221
+ $saveData['android_status'] = $android_status;
1222
+ $saveData['ios_status'] = $ios_status;
1223
+ if(!empty($licencekey)) {
1224
+ $saveData['app_license_key'] = $licencekey;
1225
+ }
1226
+ if($saveData['app_code']) {
1227
+ Mage::getModel('mobiadmin/applications')->saveApplicationData($saveData ,$storeId);
1228
+ }else{
1229
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__($result['message']));
1230
+ Mage::getSingleton('core/session')->setData( 'createapp', Mage::app()->getRequest()->getPost());
1231
+ }
1232
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Your mobile app has been succesfully created, you can now personalize it through app setting given below.'));
1233
+ $this->_redirect('mobicommerce/index/edit',
1234
+ array(
1235
+ 'id' => $next_app_id,
1236
+ '_current'=>true
1237
+ ));
1238
+ }else {
1239
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__($result['message']));
1240
+ Mage::getSingleton('core/session')->setData( 'createapp', Mage::app()->getRequest()->getPost());
1241
+ $url = $refererUrl;
1242
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
1243
+ return;
1244
+ }
1245
+ }else{
1246
+ $url = $refererUrl;
1247
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
1248
+ return;
1249
+ }
1250
+ }
1251
+
1252
+ public function sendemailAction()
1253
+ {
1254
+ $postData = Mage::app()->getRequest()->getPost();
1255
+ $isAjax = Mage::app()->getRequest()->getParam('isAjax');
1256
+ if($isAjax) {
1257
+ $user = Mage::getSingleton('admin/session');
1258
+ $userEmail = $user->getUser()->getEmail();
1259
+ $userFirstname = $user->getUser()->getFirstname();
1260
+
1261
+ $fromEmail = $userEmail;
1262
+ $fromName = $userFirstname;
1263
+ $toEmail = $postData['emailid'];
1264
+ if($postData['templatetype'] == 'android'){
1265
+ $body = "<b>Hello</b>, <br><br> ".$fromName." has sent you a MobiCommerce Android Demo App to review, by clicking the URL you can download and install the Mobile app in your Mobile Device.<br><br> MobiCommerce Android App URL: ".$postData['appurl']." <br><br><i>'".$this->__('Note: If you have any mobicommerce demo app installed in your mobile device please uninstall that before installing a new mobicommerce demo app')."'</i> <br><br> Regards";
1266
+ }elseif($postData['templatetype'] == 'ios')
1267
+ {
1268
+ $body = "<b>Hello</b>, <br><br> ".$fromName." has sent you a MobiCommerce iOS Demo App to review, by clicking the URL you can download and install the Mobile app in your Mobile Device.<br><br> MobiCommerce iOS App URL: ".$postData['appurl']." <br><br><i>'".$this->__('Note: If you have any mobicommerce demo app installed in your mobile device please uninstall that before installing a new mobicommerce demo app')."'</i> <br><br> Regards";
1269
+ }elseif($postData['templatetype'] == 'website')
1270
+ {
1271
+ $body = "<b>Hello</b>, <br><br> ".$fromName." has sent you a MobiCommerce provided Mobile Website to review, by clicking the URL you can review mobile website in your Mobile Devices.<br><br> MobiCommerce Mobile Website URL: ".$postData['appurl']." <br><br> Regards";
1272
+ }
1273
+ $subject = "Mobicommerce App URL";
1274
+ $mail = new Zend_Mail();
1275
+ $mail->setBodyText('Mobicommerce App Url');
1276
+ $mail->setBodyHtml($body);
1277
+ $mail->setFrom($fromEmail, $fromName);
1278
+ $mail->addTo($toEmail);
1279
+ $mail->setSubject($subject);
1280
+ //$this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true);
1281
+ try {
1282
+ $mail->send();
1283
+ $response['status'] = "success";
1284
+ $response['success'] = 'Successfully sent Email.';
1285
+ $this->getResponse()->setBody(json_encode($response));
1286
+ } catch(Exception $ex) {
1287
+ $response['status'] = "fail";
1288
+ $response['error'] = 'Unable to send email.';
1289
+ $this->getResponse()->setBody(json_encode($response));
1290
+ }
1291
+ }
1292
+ }
1293
+
1294
+ public function _sendEmailBeforeCreateApp($postdata)
1295
+ {
1296
+ if(!empty($postdata))
1297
+ {
1298
+ $appName = $postdata['appname'];
1299
+ $storeId = $postdata['store'];
1300
+ $storeUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
1301
+ $emailId = $postdata['primaryemail'];
1302
+ $phone = $postdata['phone'];
1303
+ if(!empty($postdata['udid']))
1304
+ {
1305
+ $udid = $postdata['udid'];
1306
+ }
1307
+ $body = "App Name:- ".$appName." <br> Store Url:- ".$storeUrl." <br> Email Id :- ".$emailId." <br> Phone Number:- ".$phone."";
1308
+ $toEmail = Mage::helper('mobiadmin')->mobicommerceEmailId();
1309
+ $subject = "Create App Request From ".$storeUrl;
1310
+ $user = Mage::getSingleton('admin/session');
1311
+ $userEmail = $user->getUser()->getEmail();
1312
+ $userFirstname = $user->getUser()->getFirstname();
1313
+
1314
+ $fromEmail = $userEmail;
1315
+ $fromName = $userFirstname;
1316
+ $mail = new Zend_Mail();
1317
+ $mail->setBodyText('Mobicommerce Create App Request');
1318
+ $mail->setBodyHtml($body);
1319
+ $mail->setFrom($fromEmail, $appName);
1320
+ $mail->addTo($toEmail, 'Mobicommerce');
1321
+ $mail->setSubject($subject);
1322
+ try {
1323
+ $mail->send();
1324
+ }catch (Exception $e)
1325
+ {
1326
+
1327
+ }
1328
+ }
1329
+ }
1330
+ }
app/code/local/Mobicommerce/Mobiadmin/etc/adminhtml.xml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <menu>
4
+ <mobiadmin translate="title" module="mobiadmin">
5
+ <title>MobiCommerce</title>
6
+ <sort_order>31</sort_order>
7
+ <children>
8
+ <createnewapp>
9
+ <title>Create New Mobile App</title>
10
+ <sort_order>1</sort_order>
11
+ <action>mobicommerce/index/new</action>
12
+ </createnewapp>
13
+ <appsetting>
14
+ <title>Manage Mobile Apps</title>
15
+ <sort_order>2</sort_order>
16
+ <action>mobicommerce/index/index</action>
17
+ </appsetting>
18
+ <appnotification>
19
+ <title>Notifications</title>
20
+ <sort_order>3</sort_order>
21
+ <action>mobicommerce/index/notification</action>
22
+ </appnotification>
23
+ <appsupport>
24
+ <title>MobiCommerce Support</title>
25
+ <sort_order>4</sort_order>
26
+ </appsupport>
27
+ </children>
28
+ </mobiadmin>
29
+ </menu>
30
+ <acl>
31
+ <resources>
32
+ <admin>
33
+ <children>
34
+ <mobiadmin translate="title" module="mobiadmin">
35
+ <title>Mobi Commerce</title>
36
+ <sort_order>1</sort_order>
37
+ </mobiadmin>
38
+ </children>
39
+ </admin>
40
+ </resources>
41
+ </acl>
42
+ </config>
app/code/local/Mobicommerce/Mobiadmin/etc/config.xml ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Mobicommerce_Mobiadmin>
5
+ <version>1.0.0</version>
6
+ </Mobicommerce_Mobiadmin>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <mobiadmin>
11
+ <class>Mobicommerce_Mobiadmin_Helper</class>
12
+ </mobiadmin>
13
+ </helpers>
14
+ <blocks>
15
+ <mobiadmin>
16
+ <class>Mobicommerce_Mobiadmin_Block</class>
17
+ </mobiadmin>
18
+ <adminhtml>
19
+ <rewrite>
20
+ <page_menu>Mobicommerce_Mobiadmin_Block_Adminhtml_Menu</page_menu>
21
+ </rewrite>
22
+ </adminhtml>
23
+ </blocks>
24
+ <models>
25
+ <mobiadmin>
26
+ <class>Mobicommerce_Mobiadmin_Model</class>
27
+ <resourceModel>mobiadmin_resource</resourceModel>
28
+ </mobiadmin>
29
+ <mobiadmin_resource>
30
+ <class>Mobicommerce_Mobiadmin_Model_Resource</class>
31
+ <entities>
32
+ <applications>
33
+ <table>mobicommerce_applications</table>
34
+ </applications>
35
+ <multilanguage>
36
+ <table>mobicommerce_multilanguage</table>
37
+ </multilanguage>
38
+ <appsetting>
39
+ <table>mobicommerce_applications_settings</table>
40
+ </appsetting>
41
+ <appwidget>
42
+ <table>mobi_app_widgets</table>
43
+ </appwidget>
44
+ <categoryicons>
45
+ <table>mobicommerce_category_icons</table>
46
+ </categoryicons>
47
+ <devicetokens>
48
+ <table>mobicommerce_devicetokens</table>
49
+ </devicetokens>
50
+ <notification>
51
+ <table>mobicommerce_notification</table>
52
+ </notification>
53
+ <licence>
54
+ <table>mobicommerce_licence</table>
55
+ </licence>
56
+ </entities>
57
+ </mobiadmin_resource>
58
+ </models>
59
+ <resources>
60
+ <mobiadmin_setup>
61
+ <setup>
62
+ <module>Mobicommerce_Mobiadmin</module>
63
+ </setup>
64
+ <connection>
65
+ <use>core_setup</use>
66
+ </connection>
67
+ </mobiadmin_setup>
68
+ <mobiadmin_write>
69
+ <connection>
70
+ <use>core_write</use>
71
+ </connection>
72
+ </mobiadmin_write>
73
+ <mobiadmin_read>
74
+ <connection>
75
+ <use>core_read</use>
76
+ </connection>
77
+ </mobiadmin_read>
78
+ </resources>
79
+ <events>
80
+ <controller_action_predispatch>
81
+ <observers>
82
+ <controller_action_before>
83
+ <class>mobiadmin/observer</class>
84
+ <method>hookToControllerActionPreDispatch</method>
85
+ </controller_action_before>
86
+ </observers>
87
+ </controller_action_predispatch>
88
+ </events>
89
+ </global>
90
+ <admin>
91
+ <routers>
92
+ <mobiadmin>
93
+ <use>admin</use>
94
+ <args>
95
+ <module>Mobicommerce_Mobiadmin</module>
96
+ <frontName>mobicommerce</frontName>
97
+ </args>
98
+ </mobiadmin>
99
+ </routers>
100
+ </admin>
101
+ <adminhtml>
102
+ <layout>
103
+ <updates>
104
+ <mobiadmin>
105
+ <file>mobiadmin.xml</file>
106
+ </mobiadmin>
107
+ </updates>
108
+ </layout>
109
+ <translate>
110
+ <modules>
111
+ <mobiadmin>
112
+ <files>
113
+ <default>Mobicommerce_Mobiadmin.csv</default>
114
+ </files>
115
+ </mobiadmin>
116
+ </modules>
117
+ </translate>
118
+ </adminhtml>
119
+ </config>
app/code/local/Mobicommerce/Mobiadmin/sql/mobiadmin_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+
8
+ //Install Notification table mobicommerce_notification
9
+ $sql=<<<SQLTEXT
10
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('mobiadmin/notification')} (
11
+ `id` int(11) NOT NULL AUTO_INCREMENT,
12
+ `type` varchar(20) NOT NULL,
13
+ `date_added` datetime NOT NULL,
14
+ `message` varchar(25000) NOT NULL,
15
+ `read_status` int(11) NOT NULL DEFAULT '0',
16
+ PRIMARY KEY (`id`)
17
+ );
18
+
19
+ SQLTEXT;
20
+
21
+
22
+ $installer->run($sql);
23
+
24
+
25
+
26
+ //Install licence table mobicommerce_licence
27
+ $sql=<<<SQLTEXT
28
+ DROP TABLE IF EXISTS {$installer->getTable('mobiadmin/licence')};
29
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('mobiadmin/licence')} (
30
+ `ml_id` int(11) NOT NULL AUTO_INCREMENT,
31
+ `ml_licence_key` varchar(255) NOT NULL,
32
+ `ml_debugger_mode` enum('yes','no') NOT NULL DEFAULT 'yes',
33
+ `ml_installation_date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
34
+ PRIMARY KEY (`ml_id`)
35
+ );
36
+ SQLTEXT;
37
+ $installer->run($sql);
38
+
39
+
40
+ $connection = $installer->getConnection();
41
+ $connection->addColumn($installer->getTable('mobiadmin/applications'),
42
+ 'app_mode',
43
+ array(
44
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
45
+ 'length' => 100,
46
+ 'nullable' => false,
47
+ 'default' => 'demo',
48
+ 'comment' => 'License Version'
49
+ )
50
+ );
51
+ $connection->addColumn($installer->getTable('mobiadmin/applications'),
52
+ 'ios_url',
53
+ array(
54
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
55
+ 'length' => 255,
56
+ 'nullable' => false,
57
+ 'default' =>'',
58
+ 'comment' => 'iOS URL'
59
+ )
60
+ );
61
+ $connection->addColumn($installer->getTable('mobiadmin/applications'),
62
+ 'android_url',
63
+ array(
64
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
65
+ 'length' => 255,
66
+ 'nullable' => false,
67
+ 'default' =>'',
68
+ 'comment' => 'Android URL'
69
+ )
70
+ );
71
+ $connection->addColumn($installer->getTable('mobiadmin/applications'),
72
+ 'ios_status',
73
+ array(
74
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
75
+ 'length' => 255,
76
+ 'nullable' => false,
77
+ 'default' => '',
78
+ 'comment' => 'iOS Status'
79
+ )
80
+ );
81
+ $connection->addColumn($installer->getTable('mobiadmin/applications'),
82
+ 'android_status',
83
+ array(
84
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
85
+ 'length' => 255,
86
+ 'nullable' => false,
87
+ 'default' => '',
88
+ 'comment' => 'Android Status'
89
+ )
90
+ );
91
+ $connection->addColumn($installer->getTable('mobiadmin/applications'),
92
+ 'udid',
93
+ array(
94
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
95
+ 'length' => 10000,
96
+ 'nullable' => false,
97
+ 'comment' => 'UDID'
98
+ )
99
+ );
100
+ $connection->addColumn($installer->getTable('mobiadmin/applications'),
101
+ 'delivery_status',
102
+ array(
103
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
104
+ 'length' => 255,
105
+ 'nullable' => false,
106
+ 'default' => '',
107
+ 'comment' => 'Deleivery Status'
108
+ )
109
+ );
110
+ $connection->addColumn($installer->getTable('mobiadmin/applications'),
111
+ 'addon_parameters',
112
+ array(
113
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
114
+ 'length' => 10000,
115
+ 'nullable' => false,
116
+ 'default' =>'',
117
+ 'comment' => 'AddOn Parameters'
118
+ )
119
+ );
120
+ $connection->addColumn($installer->getTable('mobiadmin/applications'),
121
+ 'webapp_url',
122
+ array(
123
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
124
+ 'length' => 255,
125
+ 'comment' => 'Mobile Website URL'
126
+ )
127
+ );
128
+
129
+ $installer->endSetup();
130
+
131
+
app/code/local/Mobicommerce/Mobimobileredirect/Helper/Data.php ADDED
@@ -0,0 +1,1316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobimobileredirect_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ /**
5
+ * Mobile detection type.
6
+ *
7
+ * @deprecated since version 2.6.9
8
+ */
9
+ const DETECTION_TYPE_MOBILE = 'mobile';
10
+
11
+ /**
12
+ * Extended detection type.
13
+ *
14
+ * @deprecated since version 2.6.9
15
+ */
16
+ const DETECTION_TYPE_EXTENDED = 'extended';
17
+
18
+ /**
19
+ * A frequently used regular expression to extract version #s.
20
+ *
21
+ * @deprecated since version 2.6.9
22
+ */
23
+ const VER = '([\w._\+]+)';
24
+
25
+ /**
26
+ * Top-level device.
27
+ */
28
+ const MOBILE_GRADE_A = 'A';
29
+
30
+ /**
31
+ * Mid-level device.
32
+ */
33
+ const MOBILE_GRADE_B = 'B';
34
+
35
+ /**
36
+ * Low-level device.
37
+ */
38
+ const MOBILE_GRADE_C = 'C';
39
+
40
+ /**
41
+ * Stores the version number of the current release.
42
+ */
43
+ const VERSION = '2.8.11';
44
+
45
+ /**
46
+ * A type for the version() method indicating a string return value.
47
+ */
48
+ const VERSION_TYPE_STRING = 'text';
49
+
50
+ /**
51
+ * A type for the version() method indicating a float return value.
52
+ */
53
+ const VERSION_TYPE_FLOAT = 'float';
54
+
55
+ /**
56
+ * The User-Agent HTTP header is stored in here.
57
+ * @var string
58
+ */
59
+ protected $userAgent = null;
60
+
61
+ /**
62
+ * HTTP headers in the PHP-flavor. So HTTP_USER_AGENT and SERVER_SOFTWARE.
63
+ * @var array
64
+ */
65
+ protected $httpHeaders = array();
66
+
67
+ /**
68
+ * The matching Regex.
69
+ * This is good for debug.
70
+ * @var string
71
+ */
72
+ protected $matchingRegex = null;
73
+
74
+ /**
75
+ * The matches extracted from the regex expression.
76
+ * This is good for debug.
77
+ * @var string
78
+ */
79
+ protected $matchesArray = null;
80
+
81
+ /**
82
+ * The detection type, using self::DETECTION_TYPE_MOBILE or self::DETECTION_TYPE_EXTENDED.
83
+ *
84
+ * @deprecated since version 2.6.9
85
+ *
86
+ * @var string
87
+ */
88
+ protected $detectionType = self::DETECTION_TYPE_MOBILE;
89
+
90
+ /**
91
+ * HTTP headers that trigger the 'isMobile' detection
92
+ * to be true.
93
+ *
94
+ * @var array
95
+ */
96
+ protected static $mobileHeaders = array(
97
+
98
+ 'HTTP_ACCEPT' => array('matches' => array(
99
+ // Opera Mini; @reference: http://dev.opera.com/articles/view/opera-binary-markup-language/
100
+ 'application/x-obml2d',
101
+ // BlackBerry devices.
102
+ 'application/vnd.rim.html',
103
+ 'text/vnd.wap.wml',
104
+ 'application/vnd.wap.xhtml+xml'
105
+ )),
106
+ 'HTTP_X_WAP_PROFILE' => null,
107
+ 'HTTP_X_WAP_CLIENTID' => null,
108
+ 'HTTP_WAP_CONNECTION' => null,
109
+ 'HTTP_PROFILE' => null,
110
+ // Reported by Opera on Nokia devices (eg. C3).
111
+ 'HTTP_X_OPERAMINI_PHONE_UA' => null,
112
+ 'HTTP_X_NOKIA_GATEWAY_ID' => null,
113
+ 'HTTP_X_ORANGE_ID' => null,
114
+ 'HTTP_X_VODAFONE_3GPDPCONTEXT' => null,
115
+ 'HTTP_X_HUAWEI_USERID' => null,
116
+ // Reported by Windows Smartphones.
117
+ 'HTTP_UA_OS' => null,
118
+ // Reported by Verizon, Vodafone proxy system.
119
+ 'HTTP_X_MOBILE_GATEWAY' => null,
120
+ // Seen this on HTC Sensation. SensationXE_Beats_Z715e.
121
+ 'HTTP_X_ATT_DEVICEID' => null,
122
+ // Seen this on a HTC.
123
+ 'HTTP_UA_CPU' => array('matches' => array('ARM')),
124
+ );
125
+
126
+ /**
127
+ * List of mobile devices (phones).
128
+ *
129
+ * @var array
130
+ */
131
+ protected static $phoneDevices = array(
132
+ 'iPhone' => '\biPhone\b|\biPod\b', // |\biTunes
133
+ 'BlackBerry' => 'BlackBerry|\bBB10\b|rim[0-9]+',
134
+ 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m',
135
+ 'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6',
136
+ // @todo: Is 'Dell Streak' a tablet or a phone? ;)
137
+ 'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b',
138
+ 'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925',
139
+ 'Samsung' => 'Samsung|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750',
140
+ 'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802)',
141
+ 'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533',
142
+ 'Asus' => 'Asus.*Galaxy|PadFone.*Mobile',
143
+ // http://www.micromaxinfo.com/mobiles/smartphones
144
+ // Added because the codes might conflict with Acer Tablets.
145
+ 'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b',
146
+ // @todo Complete the regex.
147
+ 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ;
148
+ 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;)
149
+ // http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA (PANTECH)
150
+ // Most of the VEGA devices are legacy. PANTECH seem to be newer devices based on Android.
151
+ 'Pantech' => 'PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790',
152
+ // http://www.fly-phone.com/devices/smartphones/ ; Included only smartphones.
153
+ 'Fly' => 'IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250',
154
+ 'iMobile' => 'i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)',
155
+ // Added simvalley mobile just for fun. They have some interesting devices.
156
+ // http://www.simvalley.fr/telephonie---gps-_22_telephonie-mobile_telephones_.html
157
+ 'SimValley' => '\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\b',
158
+ // Wolfgang - a brand that is sold by Aldi supermarkets.
159
+ // http://www.wolfgangmobile.com/
160
+ 'Wolfgang' => 'AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q',
161
+ 'Alcatel' => 'Alcatel',
162
+ 'Nintendo' => 'Nintendo 3DS',
163
+ // http://en.wikipedia.org/wiki/Amoi
164
+ 'Amoi' => 'Amoi',
165
+ // http://en.wikipedia.org/wiki/INQ
166
+ 'INQ' => 'INQ',
167
+ // @Tapatalk is a mobile app; http://support.tapatalk.com/threads/smf-2-0-2-os-and-browser-detection-plugin-and-tapatalk.15565/#post-79039
168
+ 'GenericPhone' => 'Tapatalk|PDA;|SAGEM|\bmmp\b|pocket|\bpsp\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\bwap\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser',
169
+ );
170
+
171
+ /**
172
+ * List of tablet devices.
173
+ *
174
+ * @var array
175
+ */
176
+ protected static $tabletDevices = array(
177
+ 'iPad' => 'iPad|iPad.*Mobile', // @todo: check for mobile friendly emails topic.
178
+ 'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)|^.*Android.*Nexus(?:(?!Mobile).)*$',
179
+ 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-I9205|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T707A|SM-T807A|SM-T237P|SM-T807P|SM-P607T|SM-T217T|SM-T337T', // SCH-P709|SCH-P729|SM-T2558 - Samsung Mega - treat them like a regular phone.
180
+ // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html
181
+ 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI)\b',
182
+ // Only the Surface tablets with Windows RT are considered mobile.
183
+ // http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx
184
+ 'SurfaceTablet' => 'Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)',
185
+ // http://shopping1.hp.com/is-bin/INTERSHOP.enfinity/WFS/WW-USSMBPublicStore-Site/en_US/-/USD/ViewStandardCatalog-Browse?CatalogCategoryID=JfIQ7EN5lqMAAAEyDcJUDwMT
186
+ 'HPTablet' => 'HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10',
187
+ // Watch out for PadFone, see #132.
188
+ // http://www.asus.com/de/Tablets_Mobile/Memo_Pad_Products/
189
+ 'AsusTablet' => '^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\bK00F\b|\bK00C\b|\bK00E\b|\bK00L\b|TX201LA|ME176C|ME102A|\bM80TA\b|ME372CL|ME560CG|ME372CG',
190
+ 'BlackBerryTablet' => 'PlayBook|RIM Tablet',
191
+ 'HTCtablet' => 'HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410',
192
+ 'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617',
193
+ 'NookTablet' => 'Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2',
194
+ // http://www.acer.ro/ac/ro/RO/content/drivers
195
+ // http://www.packardbell.co.uk/pb/en/GB/content/download (Packard Bell is part of Acer)
196
+ // http://us.acer.com/ac/en/US/content/group/tablets
197
+ // http://www.acer.de/ac/de/DE/content/models/tablets/
198
+ // Can conflict with Micromax and Motorola phones codes.
199
+ 'AcerTablet' => 'Android.*; \b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\b|W3-810|\bA3-A10\b',
200
+ // http://eu.computers.toshiba-europe.com/innovation/family/Tablets/1098744/banner_id/tablet_footerlink/
201
+ // http://us.toshiba.com/tablets/tablet-finder
202
+ // http://www.toshiba.co.jp/regza/tablet/
203
+ 'ToshibaTablet' => 'Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO',
204
+ // http://www.nttdocomo.co.jp/english/service/developer/smart_phone/technical_info/spec/index.html
205
+ // http://www.lg.com/us/tablets
206
+ 'LGTablet' => '\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\b',
207
+ 'FujitsuTablet' => 'Android.*\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\b',
208
+ // Prestigio Tablets http://www.prestigio.com/support
209
+ 'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD',
210
+ // http://support.lenovo.com/en_GB/downloads/default.page?#
211
+ 'LenovoTablet' => 'Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)',
212
+ // http://www.dell.com/support/home/us/en/04/Products/tab_mob/tablets
213
+ 'DellTablet' => 'Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7',
214
+ // http://www.yarvik.com/en/matrix/tablets/
215
+ 'YarvikTablet' => 'Android.*\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\b',
216
+ 'MedionTablet' => 'Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB',
217
+ 'ArnovaTablet' => 'AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2',
218
+ // http://www.intenso.de/kategorie_en.php?kategorie=33
219
+ // @todo: http://www.nbhkdz.com/read/b8e64202f92a2df129126bff.html - investigate
220
+ 'IntensoTablet' => 'INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004',
221
+ // IRU.ru Tablets http://www.iru.ru/catalog/soho/planetable/
222
+ 'IRUTablet' => 'M702pro',
223
+ 'MegafonTablet' => 'MegaFon V9|\bZTE V9\b|Android.*\bMT7A\b',
224
+ // http://www.e-boda.ro/tablete-pc.html
225
+ 'EbodaTablet' => 'E-Boda (Supreme|Impresspeed|Izzycomm|Essential)',
226
+ // http://www.allview.ro/produse/droseries/lista-tablete-pc/
227
+ 'AllViewTablet' => 'Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)',
228
+ // http://wiki.archosfans.com/index.php?title=Main_Page
229
+ 'ArchosTablet' => '\b(101G9|80G9|A101IT)\b|Qilive 97R|Archos5|\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\b',
230
+ // http://www.ainol.com/plugin.php?identifier=ainol&module=product
231
+ 'AinolTablet' => 'NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark',
232
+ // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER
233
+ // Readers http://www.atsuhiro-me.net/ebook/sony-reader/sony-reader-web-browser
234
+ // http://www.sony.jp/support/tablet/
235
+ 'SonyTablet' => 'Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551',
236
+ // http://www.support.philips.com/support/catalog/worldproducts.jsp?userLanguage=en&userCountry=cn&categoryid=3G_LTE_TABLET_SU_CN_CARE&title=3G%20tablets%20/%20LTE%20range&_dyncharset=UTF-8
237
+ 'PhilipsTablet' => '\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\b',
238
+ // db + http://www.cube-tablet.com/buy-products.html
239
+ 'CubeTablet' => 'Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT',
240
+ // http://www.cobyusa.com/?p=pcat&pcat_id=3001
241
+ 'CobyTablet' => 'MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010',
242
+ // http://www.match.net.cn/products.asp
243
+ 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733',
244
+ // http://www.msi.com/support
245
+ // @todo Research the Windows Tablets.
246
+ 'MSITablet' => 'MSI \b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\b',
247
+ // @todo http://www.kyoceramobile.com/support/drivers/
248
+ // 'KyoceraTablet' => null,
249
+ // @todo http://intexuae.com/index.php/category/mobile-devices/tablets-products/
250
+ // 'IntextTablet' => null,
251
+ // http://pdadb.net/index.php?m=pdalist&list=SMiT (NoName Chinese Tablets)
252
+ // http://www.imp3.net/14/show.php?itemid=20454
253
+ 'SMiTTablet' => 'Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)',
254
+ // http://www.rock-chips.com/index.php?do=prod&pid=2
255
+ 'RockChipTablet' => 'Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A',
256
+ // http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/
257
+ 'FlyTablet' => 'IQ310|Fly Vision',
258
+ // http://www.bqreaders.com/gb/tablets-prices-sale.html
259
+ 'bqTablet' => 'bq.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant)|Maxwell.*Lite|Maxwell.*Plus',
260
+ // http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290
261
+ // http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets)
262
+ 'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim',
263
+ // Nec or Medias Tab
264
+ 'NecTablet' => '\bN-06D|\bN-08D',
265
+ // Pantech Tablets: http://www.pantechusa.com/phones/
266
+ 'PantechTablet' => 'Pantech.*P4100',
267
+ // Broncho Tablets: http://www.broncho.cn/ (hard to find)
268
+ 'BronchoTablet' => 'Broncho.*(N701|N708|N802|a710)',
269
+ // http://versusuk.com/support.html
270
+ 'VersusTablet' => 'TOUCHPAD.*[78910]|\bTOUCHTAB\b',
271
+ // http://www.zync.in/index.php/our-products/tablet-phablets
272
+ 'ZyncTablet' => 'z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900',
273
+ // http://www.positivoinformatica.com.br/www/pessoal/tablet-ypy/
274
+ 'PositivoTablet' => 'TB07STA|TB10STA|TB07FTA|TB10FTA',
275
+ // https://www.nabitablet.com/
276
+ 'NabiTablet' => 'Android.*\bNabi',
277
+ 'KoboTablet' => 'Kobo Touch|\bK080\b|\bVox\b Build|\bArc\b Build',
278
+ // French Danew Tablets http://www.danew.com/produits-tablette.php
279
+ 'DanewTablet' => 'DSlide.*\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\b',
280
+ // Texet Tablets and Readers http://www.texet.ru/tablet/
281
+ 'TexetTablet' => 'NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE',
282
+ // Avoid detecting 'PLAYSTATION 3' as mobile.
283
+ 'PlaystationTablet' => 'Playstation.*(Portable|Vita)',
284
+ // http://www.trekstor.de/surftabs.html
285
+ 'TrekstorTablet' => 'ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab',
286
+ // http://www.pyleaudio.com/Products.aspx?%2fproducts%2fPersonal-Electronics%2fTablets
287
+ 'PyleAudioTablet' => '\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\b',
288
+ // http://www.advandigital.com/index.php?link=content-product&jns=JP001
289
+ // because of the short codenames we have to include whitespaces to reduce the possible conflicts.
290
+ 'AdvanTablet' => 'Android.* \b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\b ',
291
+ // http://www.danytech.com/category/tablet-pc
292
+ 'DanyTechTablet' => 'Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1',
293
+ // http://www.galapad.net/product.html
294
+ 'GalapadTablet' => 'Android.*\bG1\b',
295
+ // http://www.micromaxinfo.com/tablet/funbook
296
+ 'MicromaxTablet' => 'Funbook|Micromax.*\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\b',
297
+ // http://www.karbonnmobiles.com/products_tablet.php
298
+ 'KarbonnTablet' => 'Android.*\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\b',
299
+ // http://www.myallfine.com/Products.asp
300
+ 'AllFineTablet' => 'Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide',
301
+ // http://www.proscanvideo.com/products-search.asp?itemClass=TABLET&itemnmbr=
302
+ 'PROSCANTablet' => '\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\b',
303
+ // http://www.yonesnav.com/products/products.php
304
+ 'YONESTablet' => 'BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026',
305
+ // http://www.cjshowroom.com/eproducts.aspx?classcode=004001001
306
+ // China manufacturer makes tablets for different small brands (eg. http://www.zeepad.net/index.html)
307
+ 'ChangJiaTablet' => 'TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503',
308
+ // http://www.gloryunion.cn/products.asp
309
+ // http://www.allwinnertech.com/en/apply/mobile.html
310
+ // http://www.ptcl.com.pk/pd_content.php?pd_id=284 (EVOTAB)
311
+ // @todo: Softwiner tablets?
312
+ // aka. Cute or Cool tablets. Not sure yet, must research to avoid collisions.
313
+ 'GUTablet' => 'TX-A1301|TX-M9002|Q702|kf026', // A12R|D75A|D77|D79|R83|A95|A106C|R15|A75|A76|D71|D72|R71|R73|R77|D82|R85|D92|A97|D92|R91|A10F|A77F|W71F|A78F|W78F|W81F|A97F|W91F|W97F|R16G|C72|C73E|K72|K73|R96G
314
+ // http://www.pointofview-online.com/showroom.php?shop_mode=product_listing&category_id=118
315
+ 'PointOfViewTablet' => 'TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10',
316
+ // http://www.overmax.pl/pl/katalog-produktow,p8/tablety,c14/
317
+ // @todo: add more tests.
318
+ 'OvermaxTablet' => 'OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)',
319
+ // http://hclmetablet.com/India/index.php
320
+ 'HCLTablet' => 'HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync',
321
+ // http://www.edigital.hu/Tablet_es_e-book_olvaso/Tablet-c18385.html
322
+ 'DPSTablet' => 'DPS Dream 9|DPS Dual 7',
323
+ // http://www.visture.com/index.asp
324
+ 'VistureTablet' => 'V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10',
325
+ // http://www.mijncresta.nl/tablet
326
+ 'CrestaTablet' => 'CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989',
327
+ // MediaTek - http://www.mediatek.com/_en/01_products/02_proSys.php?cata_sn=1&cata1_sn=1&cata2_sn=309
328
+ 'MediatekTablet' => '\bMT8125|MT8389|MT8135|MT8377\b',
329
+ // Concorde tab
330
+ 'ConcordeTablet' => 'Concorde([ ]+)?Tab|ConCorde ReadMan',
331
+ // GoClever Tablets - http://www.goclever.com/uk/products,c1/tablet,c5/
332
+ 'GoCleverTablet' => 'GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042',
333
+ // Modecom Tablets - http://www.modecom.eu/tablets/portal/
334
+ 'ModecomTablet' => 'FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003',
335
+ // Vonino Tablets - http://www.vonino.eu/tablets
336
+ 'VoninoTablet' => '\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\bQ8\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\b',
337
+ // ECS Tablets - http://www.ecs.com.tw/ECSWebSite/Product/Product_Tablet_List.aspx?CategoryID=14&MenuID=107&childid=M_107&LanID=0
338
+ 'ECSTablet' => 'V07OT2|TM105A|S10OT1|TR10CS1',
339
+ // Storex Tablets - http://storex.fr/espace_client/support.html
340
+ // @note: no need to add all the tablet codes since they are guided by the first regex.
341
+ 'StorexTablet' => 'eZee[_\']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab',
342
+ // Generic Vodafone tablets.
343
+ 'VodafoneTablet' => 'SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7',
344
+ // French tablets - Essentiel B http://www.boulanger.fr/tablette_tactile_e-book/tablette_tactile_essentiel_b/cl_68908.htm?multiChoiceToDelete=brand&mc_brand=essentielb
345
+ // Aka: http://www.essentielb.fr/
346
+ 'EssentielBTablet' => 'Smart[ \']?TAB[ ]+?[0-9]+|Family[ \']?TAB2',
347
+ // Ross & Moor - http://ross-moor.ru/
348
+ 'RossMoorTablet' => 'RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711',
349
+ // i-mobile http://product.i-mobilephone.com/Mobile_Device
350
+ 'iMobileTablet' => 'i-mobile i-note',
351
+ // http://www.tolino.de/de/vergleichen/
352
+ 'TolinoTablet' => 'tolino tab [0-9.]+|tolino shine',
353
+ // AudioSonic - a Kmart brand
354
+ // http://www.kmart.com.au/webapp/wcs/stores/servlet/Search?langId=-1&storeId=10701&catalogId=10001&categoryId=193001&pageSize=72&currentPage=1&searchCategory=193001%2b4294965664&sortBy=p_MaxPrice%7c1
355
+ 'AudioSonicTablet' => '\bC-22Q|T7-QC|T-17B|T-17P\b',
356
+ // AMPE Tablets - http://www.ampe.com.my/product-category/tablets/
357
+ // @todo: add them gradually to avoid conflicts.
358
+ 'AMPETablet' => 'Android.* A78 ',
359
+ // Skk Mobile - http://skkmobile.com.ph/product_tablets.php
360
+ 'SkkTablet' => 'Android.* (SKYPAD|PHOENIX|CYCLOPS)',
361
+ // Tecno Mobile (only tablet) - http://www.tecno-mobile.com/index.php/product?filterby=smart&list_order=all&page=1
362
+ 'TecnoTablet' => 'TECNO P9',
363
+ // JXD (consoles & tablets) - http://jxd.hk/products.asp?selectclassid=009008&clsid=3
364
+ 'JXDTablet' => 'Android.*\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\b',
365
+ // i-Joy tablets - http://www.i-joy.es/en/cat/products/tablets/
366
+ 'iJoyTablet' => 'Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)',
367
+ // http://www.intracon.eu/tablet
368
+ 'FX2Tablet' => 'FX2 PAD7|FX2 PAD10',
369
+ // http://www.xoro.de/produkte/
370
+ // @note: Might be the same brand with 'Simply tablets'
371
+ 'XoroTablet' => 'KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151',
372
+ // http://www1.viewsonic.com/products/computing/tablets/
373
+ 'ViewsonicTablet' => 'ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a',
374
+ // http://www.odys.de/web/internet-tablet_en.html
375
+ 'OdysTablet' => 'LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\bXELIO\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10',
376
+ // http://www.captiva-power.de/products.html#tablets-en
377
+ 'CaptivaTablet' => 'CAPTIVA PAD',
378
+ // IconBIT - http://www.iconbit.com/products/tablets/
379
+ 'IconbitTablet' => 'NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S',
380
+ // http://www.teclast.com/topic.php?channelID=70&topicID=140&pid=63
381
+ 'TeclastTablet' => 'T98 4G|\bP80\b|\bX90HD\b|X98 Air|X98 Air 3G|\bX89\b|P80 3G|\bX80h\b|P98 Air|\bX89HD\b|P98 3G|\bP90HD\b|P89 3G|X98 3G|\bP70h\b|P79HD 3G|G18d 3G|\bP79HD\b|\bP89s\b|\bA88\b|\bP10HD\b|\bP19HD\b|G18 3G|\bP78HD\b|\bA78\b|\bP75\b|G17s 3G|G17h 3G|\bP85t\b|\bP90\b|\bP11\b|\bP98t\b|\bP98HD\b|\bG18d\b|\bP85s\b|\bP11HD\b|\bP88s\b|\bA80HD\b|\bA80se\b|\bA10h\b|\bP89\b|\bP78s\b|\bG18\b|\bP85\b|\bA70h\b|\bA70\b|\bG17\b|\bP18\b|\bA80s\b|\bA11s\b|\bP88HD\b|\bA80h\b|\bP76s\b|\bP76h\b|\bP98\b|\bA10HD\b|\bP78\b|\bP88\b|\bA11\b|\bA10t\b|\bP76a\b|\bP76t\b|\bP76e\b|\bP85HD\b|\bP85a\b|\bP86\b|\bP75HD\b|\bP76v\b|\bA12\b|\bP75a\b|\bA15\b|\bP76Ti\b|\bP81HD\b|\bA10\b|\bT760VE\b|\bT720HD\b|\bP76\b|\bP73\b|\bP71\b|\bP72\b|\bT720SE\b|\bC520Ti\b|\bT760\b|\bT720VE\b|T720-3GE|T720-WiFi',
382
+ 'JaytechTablet' => 'TPC-PA762',
383
+ 'BlaupunktTablet' => 'Endeavour 800NG|Endeavour 1010',
384
+ // http://www.digma.ru/support/download/
385
+ // @todo: Ebooks also (if requested)
386
+ 'DigmaTablet' => '\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\b',
387
+ // http://www.evolioshop.com/ro/tablete-pc.html
388
+ // http://www.evolio.ro/support/downloads_static.html?cat=2
389
+ // @todo: Research some more
390
+ 'EvolioTablet' => 'ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\bEvotab\b|\bNeura\b',
391
+ // @todo http://www.lavamobiles.com/tablets-data-cards
392
+ 'LavaTablet' => 'QPAD E704|\bIvoryS\b|E-TAB IVORY',
393
+ // https://www.celkonmobiles.com/?_a=categoryphones&sid=2
394
+ 'CelkonTablet' => 'CT695|CT888|CT[\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\bCT-1\b',
395
+ // http://www.mi.com/en
396
+ 'MiTablet' => '\bMI PAD\b|\bHM NOTE 1W\b',
397
+ // http://www.nbru.cn/index.html
398
+ 'NibiruTablet' => 'Nibiru M1|Nibiru Jupiter One',
399
+ // http://navroad.com/products/produkty/tablety/
400
+ 'NexoTablet' => 'NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI',
401
+ // http://www.datawind.com/ubislate/
402
+ 'UbislateTablet' => 'UbiSlate[\s]?7C',
403
+ // http://www.pocketbook-int.com/ru/support
404
+ 'PocketBookTablet' => 'Pocketbook',
405
+ // http://www.tesco.com/direct/hudl/
406
+ 'Hudl' => 'Hudl HT7S3',
407
+ // http://www.telstra.com.au/home-phone/thub-2/
408
+ 'TelstraTablet' => 'T-Hub2',
409
+ 'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|rk30sdk|\bEVOTAB\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\bM6pro\b|CT1020W|arc 10HD|\bJolla\b'
410
+ );
411
+
412
+ /**
413
+ * List of mobile Operating Systems.
414
+ *
415
+ * @var array
416
+ */
417
+ protected static $operatingSystems = array(
418
+ 'AndroidOS' => 'Android',
419
+ 'BlackBerryOS' => 'blackberry|\bBB10\b|rim tablet os',
420
+ 'PalmOS' => 'PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino',
421
+ 'SymbianOS' => 'Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\bS60\b',
422
+ // @reference: http://en.wikipedia.org/wiki/Windows_Mobile
423
+ 'WindowsMobileOS' => 'Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;',
424
+ // @reference: http://en.wikipedia.org/wiki/Windows_Phone
425
+ // http://wifeng.cn/?r=blog&a=view&id=106
426
+ // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx
427
+ // http://msdn.microsoft.com/library/ms537503.aspx
428
+ 'WindowsPhoneOS' => 'Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;',
429
+ 'iOS' => '\biPhone.*Mobile|\biPod|\biPad',
430
+ // http://en.wikipedia.org/wiki/MeeGo
431
+ // @todo: research MeeGo in UAs
432
+ 'MeeGoOS' => 'MeeGo',
433
+ // http://en.wikipedia.org/wiki/Maemo
434
+ // @todo: research Maemo in UAs
435
+ 'MaemoOS' => 'Maemo',
436
+ 'JavaOS' => 'J2ME/|\bMIDP\b|\bCLDC\b', // '|Java/' produces bug #135
437
+ 'webOS' => 'webOS|hpwOS',
438
+ 'badaOS' => '\bBada\b',
439
+ 'BREWOS' => 'BREW',
440
+ );
441
+
442
+ /**
443
+ * List of mobile User Agents.
444
+ *
445
+ * @var array
446
+ */
447
+ protected static $browsers = array(
448
+ // @reference: https://developers.google.com/chrome/mobile/docs/user-agent
449
+ 'Chrome' => '\bCrMo\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?',
450
+ 'Dolfin' => '\bDolfin\b',
451
+ 'Opera' => 'Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+|Coast/[0-9.]+',
452
+ 'Skyfire' => 'Skyfire',
453
+ 'IE' => 'IEMobile|MSIEMobile', // |Trident/[.0-9]+
454
+ 'Firefox' => 'fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile',
455
+ 'Bolt' => 'bolt',
456
+ 'TeaShark' => 'teashark',
457
+ 'Blazer' => 'Blazer',
458
+ // @reference: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html#//apple_ref/doc/uid/TP40006517-SW3
459
+ 'Safari' => 'Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari',
460
+ // http://en.wikipedia.org/wiki/Midori_(web_browser)
461
+ //'Midori' => 'midori',
462
+ 'Tizen' => 'Tizen',
463
+ 'UCBrowser' => 'UC.*Browser|UCWEB',
464
+ 'baiduboxapp' => 'baiduboxapp',
465
+ 'baidubrowser' => 'baidubrowser',
466
+ // https://github.com/serbanghita/Mobile-Detect/issues/7
467
+ 'DiigoBrowser' => 'DiigoBrowser',
468
+ // http://www.puffinbrowser.com/index.php
469
+ 'Puffin' => 'Puffin',
470
+ // http://mercury-browser.com/index.html
471
+ 'Mercury' => '\bMercury\b',
472
+ // http://en.wikipedia.org/wiki/Obigo_Browser
473
+ 'ObigoBrowser' => 'Obigo',
474
+ // http://en.wikipedia.org/wiki/NetFront
475
+ 'NetFront' => 'NF-Browser',
476
+ // @reference: http://en.wikipedia.org/wiki/Minimo
477
+ // http://en.wikipedia.org/wiki/Vision_Mobile_Browser
478
+ 'GenericBrowser' => 'NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger',
479
+ );
480
+
481
+ /**
482
+ * Utilities.
483
+ *
484
+ * @var array
485
+ */
486
+ protected static $utilities = array(
487
+ // Experimental. When a mobile device wants to switch to 'Desktop Mode'.
488
+ // http://scottcate.com/technology/windows-phone-8-ie10-desktop-or-mobile/
489
+ // https://github.com/serbanghita/Mobile-Detect/issues/57#issuecomment-15024011
490
+ 'DesktopMode' => 'WPDesktop',
491
+ 'TV' => 'SonyDTV|HbbTV', // experimental
492
+ 'WebKit' => '(webkit)[ /]([\w.]+)',
493
+ 'Bot' => 'Googlebot|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|facebookexternalhit',
494
+ 'MobileBot' => 'Googlebot-Mobile|YahooSeeker/M1A1-R2D2',
495
+ // @todo: Include JXD consoles.
496
+ 'Console' => '\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\b',
497
+ 'Watch' => 'SM-V700',
498
+ );
499
+
500
+ /**
501
+ * All possible HTTP headers that represent the
502
+ * User-Agent string.
503
+ *
504
+ * @var array
505
+ */
506
+ protected static $uaHttpHeaders = array(
507
+ // The default User-Agent string.
508
+ 'HTTP_USER_AGENT',
509
+ // Header can occur on devices using Opera Mini.
510
+ 'HTTP_X_OPERAMINI_PHONE_UA',
511
+ // Vodafone specific header: http://www.seoprinciple.com/mobile-web-community-still-angry-at-vodafone/24/
512
+ 'HTTP_X_DEVICE_USER_AGENT',
513
+ 'HTTP_X_ORIGINAL_USER_AGENT',
514
+ 'HTTP_X_SKYFIRE_PHONE',
515
+ 'HTTP_X_BOLT_PHONE_UA',
516
+ 'HTTP_DEVICE_STOCK_UA',
517
+ 'HTTP_X_UCBROWSER_DEVICE_UA'
518
+ );
519
+
520
+ /**
521
+ * The individual segments that could exist in a User-Agent string. VER refers to the regular
522
+ * expression defined in the constant self::VER.
523
+ *
524
+ * @var array
525
+ */
526
+ protected static $properties = array(
527
+
528
+ // Build
529
+ 'Mobile' => 'Mobile/[VER]',
530
+ 'Build' => 'Build/[VER]',
531
+ 'Version' => 'Version/[VER]',
532
+ 'VendorID' => 'VendorID/[VER]',
533
+
534
+ // Devices
535
+ 'iPad' => 'iPad.*CPU[a-z ]+[VER]',
536
+ 'iPhone' => 'iPhone.*CPU[a-z ]+[VER]',
537
+ 'iPod' => 'iPod.*CPU[a-z ]+[VER]',
538
+ //'BlackBerry' => array('BlackBerry[VER]', 'BlackBerry [VER];'),
539
+ 'Kindle' => 'Kindle/[VER]',
540
+
541
+ // Browser
542
+ 'Chrome' => array('Chrome/[VER]', 'CriOS/[VER]', 'CrMo/[VER]'),
543
+ 'Coast' => array('Coast/[VER]'),
544
+ 'Dolfin' => 'Dolfin/[VER]',
545
+ // @reference: https://developer.mozilla.org/en-US/docs/User_Agent_Strings_Reference
546
+ 'Firefox' => 'Firefox/[VER]',
547
+ 'Fennec' => 'Fennec/[VER]',
548
+ // @reference: http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx
549
+ 'IE' => array('IEMobile/[VER];', 'IEMobile [VER]', 'MSIE [VER];'),
550
+ // http://en.wikipedia.org/wiki/NetFront
551
+ 'NetFront' => 'NetFront/[VER]',
552
+ 'NokiaBrowser' => 'NokiaBrowser/[VER]',
553
+ 'Opera' => array( ' OPR/[VER]', 'Opera Mini/[VER]', 'Version/[VER]' ),
554
+ 'Opera Mini' => 'Opera Mini/[VER]',
555
+ 'Opera Mobi' => 'Version/[VER]',
556
+ 'UC Browser' => 'UC Browser[VER]',
557
+ 'MQQBrowser' => 'MQQBrowser/[VER]',
558
+ 'MicroMessenger' => 'MicroMessenger/[VER]',
559
+ 'baiduboxapp' => 'baiduboxapp/[VER]',
560
+ 'baidubrowser' => 'baidubrowser/[VER]',
561
+ 'Iron' => 'Iron/[VER]',
562
+ // @note: Safari 7534.48.3 is actually Version 5.1.
563
+ // @note: On BlackBerry the Version is overwriten by the OS.
564
+ 'Safari' => array( 'Version/[VER]', 'Safari/[VER]' ),
565
+ 'Skyfire' => 'Skyfire/[VER]',
566
+ 'Tizen' => 'Tizen/[VER]',
567
+ 'Webkit' => 'webkit[ /][VER]',
568
+
569
+ // Engine
570
+ 'Gecko' => 'Gecko/[VER]',
571
+ 'Trident' => 'Trident/[VER]',
572
+ 'Presto' => 'Presto/[VER]',
573
+
574
+ // OS
575
+ 'iOS' => ' \bOS\b [VER] ',
576
+ 'Android' => 'Android [VER]',
577
+ 'BlackBerry' => array('BlackBerry[\w]+/[VER]', 'BlackBerry.*Version/[VER]', 'Version/[VER]'),
578
+ 'BREW' => 'BREW [VER]',
579
+ 'Java' => 'Java/[VER]',
580
+ // @reference: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/08/29/introducing-the-ie9-on-windows-phone-mango-user-agent-string.aspx
581
+ // @reference: http://en.wikipedia.org/wiki/Windows_NT#Releases
582
+ 'Windows Phone OS' => array( 'Windows Phone OS [VER]', 'Windows Phone [VER]'),
583
+ 'Windows Phone' => 'Windows Phone [VER]',
584
+ 'Windows CE' => 'Windows CE/[VER]',
585
+ // http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/6be392da-4d2f-41b4-8354-8dcee20c85cd
586
+ 'Windows NT' => 'Windows NT [VER]',
587
+ 'Symbian' => array('SymbianOS/[VER]', 'Symbian/[VER]'),
588
+ 'webOS' => array('webOS/[VER]', 'hpwOS/[VER];'),
589
+ );
590
+
591
+ /**
592
+ * Construct an instance of this class.
593
+ *
594
+ * @param array $headers Specify the headers as injection. Should be PHP _SERVER flavored.
595
+ * If left empty, will use the global _SERVER['HTTP_*'] vars instead.
596
+ * @param string $userAgent Inject the User-Agent header. If null, will use HTTP_USER_AGENT
597
+ * from the $headers array instead.
598
+ */
599
+ public function __construct(
600
+ array $headers = null,
601
+ $userAgent = null
602
+ ) {
603
+ $this->setHttpHeaders($headers);
604
+ $this->setUserAgent($userAgent);
605
+ }
606
+
607
+ /**
608
+ * Get the current script version.
609
+ * This is useful for the demo.php file,
610
+ * so people can check on what version they are testing
611
+ * for mobile devices.
612
+ *
613
+ * @return string The version number in semantic version format.
614
+ */
615
+ public static function getScriptVersion()
616
+ {
617
+ return self::VERSION;
618
+ }
619
+
620
+ /**
621
+ * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers.
622
+ *
623
+ * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract
624
+ * the headers. The default null is left for backwards compatibilty.
625
+ */
626
+ public function setHttpHeaders($httpHeaders = null)
627
+ {
628
+ //use global _SERVER if $httpHeaders aren't defined
629
+ if (!is_array($httpHeaders) || !count($httpHeaders)) {
630
+ $httpHeaders = $_SERVER;
631
+ }
632
+
633
+ //clear existing headers
634
+ $this->httpHeaders = array();
635
+
636
+ //Only save HTTP headers. In PHP land, that means only _SERVER vars that
637
+ //start with HTTP_.
638
+ foreach ($httpHeaders as $key => $value) {
639
+ if (substr($key,0,5) == 'HTTP_') {
640
+ $this->httpHeaders[$key] = $value;
641
+ }
642
+ }
643
+ }
644
+
645
+ /**
646
+ * Retrieves the HTTP headers.
647
+ *
648
+ * @return array
649
+ */
650
+ public function getHttpHeaders()
651
+ {
652
+ return $this->httpHeaders;
653
+ }
654
+
655
+ /**
656
+ * Retrieves a particular header. If it doesn't exist, no exception/error is caused.
657
+ * Simply null is returned.
658
+ *
659
+ * @param string $header The name of the header to retrieve. Can be HTTP compliant such as
660
+ * "User-Agent" or "X-Device-User-Agent" or can be php-esque with the
661
+ * all-caps, HTTP_ prefixed, underscore seperated awesomeness.
662
+ *
663
+ * @return string|null The value of the header.
664
+ */
665
+ public function getHttpHeader($header)
666
+ {
667
+ //are we using PHP-flavored headers?
668
+ if (strpos($header, '_') === false) {
669
+ $header = str_replace('-', '_', $header);
670
+ $header = strtoupper($header);
671
+ }
672
+
673
+ //test the alternate, too
674
+ $altHeader = 'HTTP_' . $header;
675
+
676
+ //Test both the regular and the HTTP_ prefix
677
+ if (isset($this->httpHeaders[$header])) {
678
+ return $this->httpHeaders[$header];
679
+ } elseif (isset($this->httpHeaders[$altHeader])) {
680
+ return $this->httpHeaders[$altHeader];
681
+ }
682
+
683
+ return null;
684
+ }
685
+
686
+ public function getMobileHeaders()
687
+ {
688
+ return self::$mobileHeaders;
689
+ }
690
+
691
+ /**
692
+ * Get all possible HTTP headers that
693
+ * can contain the User-Agent string.
694
+ *
695
+ * @return array List of HTTP headers.
696
+ */
697
+ public function getUaHttpHeaders()
698
+ {
699
+ return self::$uaHttpHeaders;
700
+ }
701
+
702
+ /**
703
+ * Set the User-Agent to be used.
704
+ *
705
+ * @param string $userAgent The user agent string to set.
706
+ *
707
+ * @return string|null
708
+ */
709
+ public function setUserAgent($userAgent = null)
710
+ {
711
+ if (!empty($userAgent)) {
712
+ return $this->userAgent = $userAgent;
713
+ } else {
714
+ $this->userAgent = null;
715
+ foreach ($this->getUaHttpHeaders() as $altHeader) {
716
+ if (!empty($this->httpHeaders[$altHeader])) { // @todo: should use getHttpHeader(), but it would be slow. (Serban)
717
+ $this->userAgent .= $this->httpHeaders[$altHeader] . " ";
718
+ }
719
+ }
720
+
721
+ return $this->userAgent = (!empty($this->userAgent) ? trim($this->userAgent) : null);
722
+
723
+ }
724
+ }
725
+
726
+ /**
727
+ * Retrieve the User-Agent.
728
+ *
729
+ * @return string|null The user agent if it's set.
730
+ */
731
+ public function getUserAgent()
732
+ {
733
+ return $this->userAgent;
734
+ }
735
+
736
+ /**
737
+ * Set the detection type. Must be one of self::DETECTION_TYPE_MOBILE or
738
+ * self::DETECTION_TYPE_EXTENDED. Otherwise, nothing is set.
739
+ *
740
+ * @deprecated since version 2.6.9
741
+ *
742
+ * @param string $type The type. Must be a self::DETECTION_TYPE_* constant. The default
743
+ * parameter is null which will default to self::DETECTION_TYPE_MOBILE.
744
+ */
745
+ public function setDetectionType($type = null)
746
+ {
747
+ if ($type === null) {
748
+ $type = self::DETECTION_TYPE_MOBILE;
749
+ }
750
+
751
+ if ($type != self::DETECTION_TYPE_MOBILE && $type != self::DETECTION_TYPE_EXTENDED) {
752
+ return;
753
+ }
754
+
755
+ $this->detectionType = $type;
756
+ }
757
+
758
+ public function getMatchingRegex()
759
+ {
760
+ return $this->matchingRegex;
761
+ }
762
+
763
+ public function getMatchesArray()
764
+ {
765
+ return $this->matchesArray;
766
+ }
767
+
768
+ /**
769
+ * Retrieve the list of known phone devices.
770
+ *
771
+ * @return array List of phone devices.
772
+ */
773
+ public static function getPhoneDevices()
774
+ {
775
+ return self::$phoneDevices;
776
+ }
777
+
778
+ /**
779
+ * Retrieve the list of known tablet devices.
780
+ *
781
+ * @return array List of tablet devices.
782
+ */
783
+ public static function getTabletDevices()
784
+ {
785
+ return self::$tabletDevices;
786
+ }
787
+
788
+ /**
789
+ * Alias for getBrowsers() method.
790
+ *
791
+ * @return array List of user agents.
792
+ */
793
+ public static function getUserAgents()
794
+ {
795
+ return self::getBrowsers();
796
+ }
797
+
798
+ /**
799
+ * Retrieve the list of known browsers. Specifically, the user agents.
800
+ *
801
+ * @return array List of browsers / user agents.
802
+ */
803
+ public static function getBrowsers()
804
+ {
805
+ return self::$browsers;
806
+ }
807
+
808
+ /**
809
+ * Retrieve the list of known utilities.
810
+ *
811
+ * @return array List of utilities.
812
+ */
813
+ public static function getUtilities()
814
+ {
815
+ return self::$utilities;
816
+ }
817
+
818
+ /**
819
+ * Method gets the mobile detection rules. This method is used for the magic methods $detect->is*().
820
+ *
821
+ * @deprecated since version 2.6.9
822
+ *
823
+ * @return array All the rules (but not extended).
824
+ */
825
+ public static function getMobileDetectionRules()
826
+ {
827
+ static $rules;
828
+
829
+ if (!$rules) {
830
+ $rules = array_merge(
831
+ self::$phoneDevices,
832
+ self::$tabletDevices,
833
+ self::$operatingSystems,
834
+ self::$browsers
835
+ );
836
+ }
837
+
838
+ return $rules;
839
+
840
+ }
841
+
842
+ /**
843
+ * Method gets the mobile detection rules + utilities.
844
+ * The reason this is separate is because utilities rules
845
+ * don't necessary imply mobile. This method is used inside
846
+ * the new $detect->is('stuff') method.
847
+ *
848
+ * @deprecated since version 2.6.9
849
+ *
850
+ * @return array All the rules + extended.
851
+ */
852
+ public function getMobileDetectionRulesExtended()
853
+ {
854
+ static $rules;
855
+
856
+ if (!$rules) {
857
+ // Merge all rules together.
858
+ $rules = array_merge(
859
+ self::$phoneDevices,
860
+ self::$tabletDevices,
861
+ self::$operatingSystems,
862
+ self::$browsers,
863
+ self::$utilities
864
+ );
865
+ }
866
+
867
+ return $rules;
868
+ }
869
+
870
+ /**
871
+ * Retrieve the current set of rules.
872
+ *
873
+ * @deprecated since version 2.6.9
874
+ *
875
+ * @return array
876
+ */
877
+ public function getRules()
878
+ {
879
+ if ($this->detectionType == self::DETECTION_TYPE_EXTENDED) {
880
+ return self::getMobileDetectionRulesExtended();
881
+ } else {
882
+ return self::getMobileDetectionRules();
883
+ }
884
+ }
885
+
886
+ /**
887
+ * Retrieve the list of mobile operating systems.
888
+ *
889
+ * @return array The list of mobile operating systems.
890
+ */
891
+ public static function getOperatingSystems()
892
+ {
893
+ return self::$operatingSystems;
894
+ }
895
+
896
+ /**
897
+ * Check the HTTP headers for signs of mobile.
898
+ * This is the fastest mobile check possible; it's used
899
+ * inside isMobile() method.
900
+ *
901
+ * @return bool
902
+ */
903
+ public function checkHttpHeadersForMobile()
904
+ {
905
+
906
+ foreach ($this->getMobileHeaders() as $mobileHeader => $matchType) {
907
+ if ( isset($this->httpHeaders[$mobileHeader]) ) {
908
+ if ( is_array($matchType['matches']) ) {
909
+ foreach ($matchType['matches'] as $_match) {
910
+ if ( strpos($this->httpHeaders[$mobileHeader], $_match) !== false ) {
911
+ return true;
912
+ }
913
+ }
914
+
915
+ return false;
916
+ } else {
917
+ return true;
918
+ }
919
+ }
920
+ }
921
+
922
+ return false;
923
+
924
+ }
925
+
926
+ /**
927
+ * Magic overloading method.
928
+ *
929
+ * @method boolean is[...]()
930
+ * @param string $name
931
+ * @param array $arguments
932
+ * @return mixed
933
+ * @throws BadMethodCallException when the method doesn't exist and doesn't start with 'is'
934
+ */
935
+ public function __call($name, $arguments)
936
+ {
937
+ //make sure the name starts with 'is', otherwise
938
+ if (substr($name, 0, 2) != 'is') {
939
+ throw new BadMethodCallException("No such method exists: $name");
940
+ }
941
+
942
+ $this->setDetectionType(self::DETECTION_TYPE_MOBILE);
943
+
944
+ $key = substr($name, 2);
945
+
946
+ return $this->matchUAAgainstKey($key);
947
+ }
948
+
949
+ /**
950
+ * Find a detection rule that matches the current User-agent.
951
+ *
952
+ * @param null $userAgent deprecated
953
+ * @return boolean
954
+ */
955
+ protected function matchDetectionRulesAgainstUA($userAgent = null)
956
+ {
957
+ // Begin general search.
958
+ foreach ($this->getRules() as $_regex) {
959
+ if (empty($_regex)) {
960
+ continue;
961
+ }
962
+ if ($this->match($_regex, $userAgent)) {
963
+ return true;
964
+ }
965
+ }
966
+
967
+ return false;
968
+ }
969
+
970
+ /**
971
+ * Search for a certain key in the rules array.
972
+ * If the key is found the try to match the corresponding
973
+ * regex agains the User-Agent.
974
+ *
975
+ * @param string $key
976
+ * @param null $userAgent deprecated
977
+ * @return mixed
978
+ */
979
+ protected function matchUAAgainstKey($key, $userAgent = null)
980
+ {
981
+ // Make the keys lowercase so we can match: isIphone(), isiPhone(), isiphone(), etc.
982
+ $key = strtolower($key);
983
+
984
+ //change the keys to lower case
985
+ $_rules = array_change_key_case($this->getRules());
986
+
987
+ if (array_key_exists($key, $_rules)) {
988
+ if (empty($_rules[$key])) {
989
+ return null;
990
+ }
991
+
992
+ return $this->match($_rules[$key], $userAgent);
993
+ }
994
+
995
+ return false;
996
+ }
997
+
998
+ /**
999
+ * Check if the device is mobile.
1000
+ * Returns true if any type of mobile device detected, including special ones
1001
+ * @param null $userAgent deprecated
1002
+ * @param null $httpHeaders deprecated
1003
+ * @return bool
1004
+ */
1005
+ public function isMobile($userAgent = null, $httpHeaders = null)
1006
+ {
1007
+
1008
+ if ($httpHeaders) {
1009
+ $this->setHttpHeaders($httpHeaders);
1010
+ }
1011
+
1012
+ if ($userAgent) {
1013
+ $this->setUserAgent($userAgent);
1014
+ }
1015
+
1016
+ $this->setDetectionType(self::DETECTION_TYPE_MOBILE);
1017
+
1018
+ if ($this->checkHttpHeadersForMobile()) {
1019
+ return true;
1020
+ } else {
1021
+ return $this->matchDetectionRulesAgainstUA();
1022
+ }
1023
+
1024
+ }
1025
+
1026
+ /**
1027
+ * Check if the device is a tablet.
1028
+ * Return true if any type of tablet device is detected.
1029
+ *
1030
+ * @param string $userAgent deprecated
1031
+ * @param array $httpHeaders deprecated
1032
+ * @return bool
1033
+ */
1034
+ public function isTablet($userAgent = null, $httpHeaders = null)
1035
+ {
1036
+ $this->setDetectionType(self::DETECTION_TYPE_MOBILE);
1037
+
1038
+ foreach (self::$tabletDevices as $_regex) {
1039
+ if ($this->match($_regex, $userAgent)) {
1040
+ return true;
1041
+ }
1042
+ }
1043
+
1044
+ return false;
1045
+ }
1046
+
1047
+ /**
1048
+ * This method checks for a certain property in the
1049
+ * userAgent.
1050
+ * @todo: The httpHeaders part is not yet used.
1051
+ *
1052
+ * @param string $key
1053
+ * @param string $userAgent deprecated
1054
+ * @param string $httpHeaders deprecated
1055
+ * @return bool|int|null
1056
+ */
1057
+ public function is($key, $userAgent = null, $httpHeaders = null)
1058
+ {
1059
+ // Set the UA and HTTP headers only if needed (eg. batch mode).
1060
+ if ($httpHeaders) {
1061
+ $this->setHttpHeaders($httpHeaders);
1062
+ }
1063
+
1064
+ if ($userAgent) {
1065
+ $this->setUserAgent($userAgent);
1066
+ }
1067
+
1068
+ $this->setDetectionType(self::DETECTION_TYPE_EXTENDED);
1069
+
1070
+ return $this->matchUAAgainstKey($key);
1071
+ }
1072
+
1073
+ /**
1074
+ * Some detection rules are relative (not standard),
1075
+ * because of the diversity of devices, vendors and
1076
+ * their conventions in representing the User-Agent or
1077
+ * the HTTP headers.
1078
+ *
1079
+ * This method will be used to check custom regexes against
1080
+ * the User-Agent string.
1081
+ *
1082
+ * @param $regex
1083
+ * @param string $userAgent
1084
+ * @return bool
1085
+ *
1086
+ * @todo: search in the HTTP headers too.
1087
+ */
1088
+ public function match($regex, $userAgent = null)
1089
+ {
1090
+ // Escape the special character which is the delimiter.
1091
+ $regex = str_replace('/', '\/', $regex);
1092
+ $match = (bool) preg_match('/'.$regex.'/is', (!empty($userAgent) ? $userAgent : $this->userAgent), $matches);
1093
+ // If positive match is found, store the results for debug.
1094
+ if ($match) {
1095
+ $this->matchingRegex = $regex;
1096
+ $this->matchesArray = $matches;
1097
+ }
1098
+
1099
+ return $match;
1100
+ }
1101
+
1102
+ /**
1103
+ * Get the properties array.
1104
+ *
1105
+ * @return array
1106
+ */
1107
+ public static function getProperties()
1108
+ {
1109
+ return self::$properties;
1110
+ }
1111
+
1112
+ /**
1113
+ * Prepare the version number.
1114
+ *
1115
+ * @todo Remove the error supression from str_replace() call.
1116
+ *
1117
+ * @param string $ver The string version, like "2.6.21.2152";
1118
+ *
1119
+ * @return float
1120
+ */
1121
+ public function prepareVersionNo($ver)
1122
+ {
1123
+ $ver = str_replace(array('_', ' ', '/'), '.', $ver);
1124
+ $arrVer = explode('.', $ver, 2);
1125
+
1126
+ if (isset($arrVer[1])) {
1127
+ $arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions.
1128
+ }
1129
+
1130
+ return (float) implode('.', $arrVer);
1131
+ }
1132
+
1133
+ /**
1134
+ * Check the version of the given property in the User-Agent.
1135
+ * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)
1136
+ *
1137
+ * @param string $propertyName The name of the property. See self::getProperties() array
1138
+ * keys for all possible properties.
1139
+ * @param string $type Either self::VERSION_TYPE_STRING to get a string value or
1140
+ * self::VERSION_TYPE_FLOAT indicating a float value. This parameter
1141
+ * is optional and defaults to self::VERSION_TYPE_STRING. Passing an
1142
+ * invalid parameter will default to the this type as well.
1143
+ *
1144
+ * @return string|float The version of the property we are trying to extract.
1145
+ */
1146
+ public function version($propertyName, $type = self::VERSION_TYPE_STRING)
1147
+ {
1148
+ if (empty($propertyName)) {
1149
+ return false;
1150
+ }
1151
+
1152
+ //set the $type to the default if we don't recognize the type
1153
+ if ($type != self::VERSION_TYPE_STRING && $type != self::VERSION_TYPE_FLOAT) {
1154
+ $type = self::VERSION_TYPE_STRING;
1155
+ }
1156
+
1157
+ $properties = self::getProperties();
1158
+
1159
+ // Check if the property exists in the properties array.
1160
+ if (array_key_exists($propertyName, $properties)) {
1161
+
1162
+ // Prepare the pattern to be matched.
1163
+ // Make sure we always deal with an array (string is converted).
1164
+ $properties[$propertyName] = (array) $properties[$propertyName];
1165
+
1166
+ foreach ($properties[$propertyName] as $propertyMatchString) {
1167
+
1168
+ $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString);
1169
+
1170
+ // Escape the special character which is the delimiter.
1171
+ $propertyPattern = str_replace('/', '\/', $propertyPattern);
1172
+
1173
+ // Identify and extract the version.
1174
+ preg_match('/'.$propertyPattern.'/is', $this->userAgent, $match);
1175
+
1176
+ if (!empty($match[1])) {
1177
+ $version = ( $type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1] );
1178
+
1179
+ return $version;
1180
+ }
1181
+
1182
+ }
1183
+
1184
+ }
1185
+
1186
+ return false;
1187
+ }
1188
+
1189
+ /**
1190
+ * Retrieve the mobile grading, using self::MOBILE_GRADE_* constants.
1191
+ *
1192
+ * @return string One of the self::MOBILE_GRADE_* constants.
1193
+ */
1194
+ public function mobileGrade()
1195
+ {
1196
+ $isMobile = $this->isMobile();
1197
+
1198
+ if (
1199
+ // Apple iOS 4-7.0 � Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3 / 5.1 / 6.1), iPad 3 (5.1 / 6.0), iPad Mini (6.1), iPad Retina (7.0), iPhone 3GS (4.3), iPhone 4 (4.3 / 5.1), iPhone 4S (5.1 / 6.0), iPhone 5 (6.0), and iPhone 5S (7.0)
1200
+ $this->isIOS() && $this->version('iPad', self::VERSION_TYPE_FLOAT)>=4.3 ||
1201
+ $this->isIOS() && $this->version('iPhone', self::VERSION_TYPE_FLOAT)>=4.3 ||
1202
+ $this->isIOS() && $this->version('iPod', self::VERSION_TYPE_FLOAT)>=4.3 ||
1203
+
1204
+ // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5)
1205
+ // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM
1206
+ // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices
1207
+ // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7
1208
+ ( $this->version('Android', self::VERSION_TYPE_FLOAT)>2.1 && $this->is('Webkit') ) ||
1209
+
1210
+ // Windows Phone 7.5-8 - Tested on the HTC Surround (7.5), HTC Trophy (7.5), LG-E900 (7.5), Nokia 800 (7.8), HTC Mazaa (7.8), Nokia Lumia 520 (8), Nokia Lumia 920 (8), HTC 8x (8)
1211
+ $this->version('Windows Phone OS', self::VERSION_TYPE_FLOAT)>=7.5 ||
1212
+
1213
+ // Tested on the Torch 9800 (6) and Style 9670 (6), BlackBerry� Torch 9810 (7), BlackBerry Z10 (10)
1214
+ $this->is('BlackBerry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)>=6.0 ||
1215
+ // Blackberry Playbook (1.0-2.0) - Tested on PlayBook
1216
+ $this->match('Playbook.*Tablet') ||
1217
+
1218
+ // Palm WebOS (1.4-3.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0), HP TouchPad (3.0)
1219
+ ( $this->version('webOS', self::VERSION_TYPE_FLOAT)>=1.4 && $this->match('Palm|Pre|Pixi') ) ||
1220
+ // Palm WebOS 3.0 - Tested on HP TouchPad
1221
+ $this->match('hp.*TouchPad') ||
1222
+
1223
+ // Firefox Mobile 18 - Tested on Android 2.3 and 4.1 devices
1224
+ ( $this->is('Firefox') && $this->version('Firefox', self::VERSION_TYPE_FLOAT)>=18 ) ||
1225
+
1226
+ // Chrome for Android - Tested on Android 4.0, 4.1 device
1227
+ ( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT)>=4.0 ) ||
1228
+
1229
+ // Skyfire 4.1 - Tested on Android 2.3 device
1230
+ ( $this->is('Skyfire') && $this->version('Skyfire', self::VERSION_TYPE_FLOAT)>=4.1 && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT)>=2.3 ) ||
1231
+
1232
+ // Opera Mobile 11.5-12: Tested on Android 2.3
1233
+ ( $this->is('Opera') && $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT)>=11.5 && $this->is('AndroidOS') ) ||
1234
+
1235
+ // Meego 1.2 - Tested on Nokia 950 and N9
1236
+ $this->is('MeeGoOS') ||
1237
+
1238
+ // Tizen (pre-release) - Tested on early hardware
1239
+ $this->is('Tizen') ||
1240
+
1241
+ // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser
1242
+ // @todo: more tests here!
1243
+ $this->is('Dolfin') && $this->version('Bada', self::VERSION_TYPE_FLOAT)>=2.0 ||
1244
+
1245
+ // UC Browser - Tested on Android 2.3 device
1246
+ ( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android', self::VERSION_TYPE_FLOAT)>=2.3 ) ||
1247
+
1248
+ // Kindle 3 and Fire - Tested on the built-in WebKit browser for each
1249
+ ( $this->match('Kindle Fire') ||
1250
+ $this->is('Kindle') && $this->version('Kindle', self::VERSION_TYPE_FLOAT)>=3.0 ) ||
1251
+
1252
+ // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet
1253
+ $this->is('AndroidOS') && $this->is('NookTablet') ||
1254
+
1255
+ // Chrome Desktop 16-24 - Tested on OS X 10.7 and Windows 7
1256
+ $this->version('Chrome', self::VERSION_TYPE_FLOAT)>=16 && !$isMobile ||
1257
+
1258
+ // Safari Desktop 5-6 - Tested on OS X 10.7 and Windows 7
1259
+ $this->version('Safari', self::VERSION_TYPE_FLOAT)>=5.0 && !$isMobile ||
1260
+
1261
+ // Firefox Desktop 10-18 - Tested on OS X 10.7 and Windows 7
1262
+ $this->version('Firefox', self::VERSION_TYPE_FLOAT)>=10.0 && !$isMobile ||
1263
+
1264
+ // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7
1265
+ $this->version('IE', self::VERSION_TYPE_FLOAT)>=7.0 && !$isMobile ||
1266
+
1267
+ // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7
1268
+ $this->version('Opera', self::VERSION_TYPE_FLOAT)>=10 && !$isMobile
1269
+ ){
1270
+ return self::MOBILE_GRADE_A;
1271
+ }
1272
+
1273
+ if (
1274
+ $this->isIOS() && $this->version('iPad', self::VERSION_TYPE_FLOAT)<4.3 ||
1275
+ $this->isIOS() && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<4.3 ||
1276
+ $this->isIOS() && $this->version('iPod', self::VERSION_TYPE_FLOAT)<4.3 ||
1277
+
1278
+ // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770
1279
+ $this->is('Blackberry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)>=5 && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<6 ||
1280
+
1281
+ //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3
1282
+ ($this->version('Opera Mini', self::VERSION_TYPE_FLOAT)>=5.0 && $this->version('Opera Mini', self::VERSION_TYPE_FLOAT)<=7.0 &&
1283
+ ($this->version('Android', self::VERSION_TYPE_FLOAT)>=2.3 || $this->is('iOS')) ) ||
1284
+
1285
+ // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1)
1286
+ $this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') ||
1287
+
1288
+ // @todo: report this (tested on Nokia N71)
1289
+ $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT)>=11 && $this->is('SymbianOS')
1290
+ ){
1291
+ return self::MOBILE_GRADE_B;
1292
+ }
1293
+
1294
+ if (
1295
+ // Blackberry 4.x - Tested on the Curve 8330
1296
+ $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<=5.0 ||
1297
+ // Windows Mobile - Tested on the HTC Leo (WinMo 5.2)
1298
+ $this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT)<=5.2 ||
1299
+
1300
+ // Tested on original iPhone (3.1), iPhone 3 (3.2)
1301
+ $this->isIOS() && $this->version('iPad', self::VERSION_TYPE_FLOAT)<=3.2 ||
1302
+ $this->isIOS() && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<=3.2 ||
1303
+ $this->isIOS() && $this->version('iPod', self::VERSION_TYPE_FLOAT)<=3.2 ||
1304
+
1305
+ // Internet Explorer 7 and older - Tested on Windows XP
1306
+ $this->version('IE', self::VERSION_TYPE_FLOAT)<=7.0 && !$isMobile
1307
+ ){
1308
+ return self::MOBILE_GRADE_C;
1309
+ }
1310
+
1311
+ //All older smartphone platforms and featurephones - Any device that doesn't support media queries
1312
+ //will receive the basic, C grade experience.
1313
+ return self::MOBILE_GRADE_C;
1314
+ }
1315
+ }
1316
+
app/code/local/Mobicommerce/Mobimobileredirect/etc/config.xml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Mobicommerce_Mobimobileredirect>
5
+ <version>0.1.0</version>
6
+ </Mobicommerce_Mobimobileredirect>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <mobimobileredirect>
11
+ <class>Mobicommerce_Mobimobileredirect_Helper</class>
12
+ </mobimobileredirect>
13
+ </helpers>
14
+ <models>
15
+ <mobimobileredirect>
16
+ <class>Mobicommerce_Mobimobileredirect_Model</class>
17
+ </mobimobileredirect>
18
+ </models>
19
+ <blocks>
20
+ <mobimobileredirect>
21
+ <class>Mobicommerce_Mobimobileredirect_Block</class>
22
+ </mobimobileredirect>
23
+ </blocks>
24
+ </global>
25
+ <frontend>
26
+ <layout>
27
+ <updates>
28
+ <mobimobileredirect>
29
+ <file>mobiredirect.xml</file>
30
+ </mobimobileredirect>
31
+ </updates>
32
+ </layout>
33
+ </frontend>
34
+ <default>
35
+ <mobimobileredirect>
36
+ <isactive_group>
37
+ <isactive_value>0</isactive_value>
38
+ </isactive_group>
39
+ </mobimobileredirect>
40
+ </default>
41
+ <adminhtml>
42
+ <acl>
43
+ <resources>
44
+ <admin>
45
+ <children>
46
+ <system>
47
+ <children>
48
+ <config>
49
+ <children>
50
+ <mobimobileredirect translate="title" module="mobimobileredirect">
51
+ <title>Mobimobile Redirect ACL</title>
52
+ <sort_order>99</sort_order>
53
+ </mobimobileredirect>
54
+ </children>
55
+ </config>
56
+ </children>
57
+ </system>
58
+ </children>
59
+ </admin>
60
+ </resources>
61
+ </acl>
62
+ </adminhtml>
63
+ </config>
app/code/local/Mobicommerce/Mobimobileredirect/etc/system.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <mobimobileredirect translate="label" module="mobimobileredirect">
5
+ <label>Mobicommerce Mobile Redirect</label>
6
+ <sort_order>1000</sort_order>
7
+ </mobimobileredirect>
8
+ </tabs>
9
+ <sections>
10
+ <mobimobileredirect translate="label" module="mobimobileredirect">
11
+ <label>Mobicommerce Mobile Options</label>
12
+ <tab>mobimobileredirect</tab>
13
+ <sort_order>1000</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+ <groups>
18
+ <isactive_group translate="label" module="mobimobileredirect">
19
+ <label>Mobicommerce Mobile Enable Module</label>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>1000</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <isactive_value translate="label">
27
+ <label>Enable Module: </label>
28
+ <frontend_type>select</frontend_type>
29
+ <sort_order>90</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <source_model>adminhtml/system_config_source_yesno</source_model>
34
+ </isactive_value>
35
+ </fields>
36
+ </isactive_group>
37
+ </groups>
38
+ </mobimobileredirect>
39
+ </sections>
40
+ </config>
app/code/local/Mobicommerce/Mobipayments/Controller/Action.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ abstract class Mobicommerce_Mobipayments_Controller_Action extends Mage_Core_Controller_Front_Action {
3
+
4
+ protected $_data;
5
+
6
+ public function preDispatch() {
7
+ parent::preDispatch();
8
+ $this->setRequestData();
9
+ }
10
+
11
+ public function dataToJson($data) {
12
+ $this->setData($data);
13
+ $this->dispatchEventChangeData($this->getActionName('_return'), $data);
14
+ $this->_data = $this->getData();
15
+ return Mage::helper('core')->jsonEncode($this->_data);
16
+ }
17
+
18
+ public function dispatchEventChangeData($event_name, $data) {
19
+ Mage::dispatchEvent($event_name, array('object' => $this, 'data' => $data));
20
+ }
21
+
22
+ public function getActionName($last = '') {
23
+ return $this->getFullActionName() . $last;
24
+ }
25
+
26
+ public function printResult($data) {
27
+ $json_data = $this->dataToJson($data);
28
+ if(isset($_GET['callback']) && $_GET['callback']!=''){
29
+ print $_GET['callback'] ."(".$json_data.")";exit;
30
+ }else{
31
+ header('content-type:application/json');
32
+ }
33
+ echo $json_data;
34
+ }
35
+
36
+ public function setRequestData(){
37
+ $this->setData($this->getRequest()->getParams());
38
+ $this->dispatchEventChangeData($this->getActionName(), $this->_data);
39
+ $this->_data = $this->getData();
40
+ }
41
+
42
+ public function getData() {
43
+ return $this->_data;
44
+ }
45
+
46
+ public function setData($data) {
47
+ $this->_data = $data;
48
+ }
49
+
50
+ }
51
+
52
+ ?>
app/code/local/Mobicommerce/Mobipayments/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobipayments_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/local/Mobicommerce/Mobipayments/Model/Abstract.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobipayments_Model_Abstract extends Mage_Payment_Model_Method_Abstract {
3
+
4
+ public function successStatus($success = array('SUCCESS')) {
5
+ return array('status' => 'SUCCESS',
6
+ 'message' => $success,
7
+ );
8
+ }
9
+
10
+ public function errorStatus($error = array('0','opps! unknown Error ')) {
11
+ return array(
12
+ 'status' => 'FAIL',
13
+ //'message' => array('errorcode' => $error[0], 'description' => $error[1]),
14
+ 'message' => is_array($error)?$error[0]:$error,
15
+ );
16
+ }
17
+
18
+
19
+ public function checkUserLoginSession(){
20
+ return Mage::getSingleton('customer/session')->isLoggedIn();
21
+ }
22
+
23
+
24
+ public function _getStoreId(){
25
+ return Mage::app()->getStore()->getStoreId();
26
+ //return Mage::app()->getStore()->getId()
27
+ }
28
+ public function _getStoreName(){
29
+ return Mage::app()->getStore()->getName();
30
+ //return Mage::app()->getStore()->getId()
31
+ }
32
+
33
+ public function _getWebsiteId(){
34
+ return Mage::app()->getStore()->getWebsiteId();
35
+ }
36
+ public function eventChangeData($name_event, $value) {
37
+ Mage::dispatchEvent($name_event, $value);
38
+ }
39
+ }
app/code/local/Mobicommerce/Mobipayments/Model/Paymill.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobipayments_Model_Paymill extends Mage_Core_Model_Abstract {
3
+
4
+ public function getConfigData(){
5
+ $config = array(
6
+ "private_key" => Mage::helper('paymill/OptionHelper')->getPrivateKey(),
7
+ "public_key" => Mage::helper('paymill/OptionHelper')->getPublicKey(),
8
+ "description" => Mage::getStoreConfig('payment/paymill_creditcard/checkout_desc', Mage::app()->getStore()->getStoreId()),
9
+ );
10
+ return $config;
11
+ }
12
+ }
app/code/local/Mobicommerce/Mobipayments/Model/Standard.php ADDED
@@ -0,0 +1,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobipayments_Model_Standard extends Mobicommerce_Mobipayments_Model_Abstract {
3
+ protected $_code = 'mobipayments';
4
+
5
+ protected $_isInitializeNeeded = true;
6
+ protected $_canUseInternal = true;
7
+ protected $_canUseForMultishipping = false;
8
+ protected $_canUseCheckout = true;
9
+ protected $_order = null;
10
+
11
+ const PAYER_ID = 'payer_id';
12
+ const PAYER_EMAIL = 'email';
13
+ const PAYER_STATUS = 'payer_status';
14
+ const ADDRESS_ID = 'address_id';
15
+ const ADDRESS_STATUS = 'address_status';
16
+ const PROTECTION_EL = 'protection_eligibility';
17
+ const FRAUD_FILTERS = 'collected_fraud_filters';
18
+ const CORRELATION_ID = 'correlation_id';
19
+ const AVS_CODE = 'avs_result';
20
+ const CVV2_MATCH = 'cvv2_check_result';
21
+ const CENTINEL_VPAS = 'centinel_vpas_result';
22
+ const CENTINEL_ECI = 'centinel_eci_result';
23
+ // Next two fields are required for Brazil
24
+ const BUYER_TAX_ID = 'buyer_tax_id';
25
+ const BUYER_TAX_ID_TYPE = 'buyer_tax_id_type';
26
+
27
+ const PAYMENT_STATUS = 'payment_status';
28
+ const PENDING_REASON = 'pending_reason';
29
+ const IS_FRAUD = 'is_fraud_detected';
30
+ const PAYMENT_STATUS_GLOBAL = 'paypal_payment_status';
31
+ const PENDING_REASON_GLOBAL = 'paypal_pending_reason';
32
+ const IS_FRAUD_GLOBAL = 'paypal_is_fraud_detected';
33
+
34
+ protected $_paymentMap = array(
35
+ self::PAYER_ID => 'payer_id',
36
+ self::PAYER_EMAIL => 'payer_email',
37
+ self::PAYER_STATUS => 'payer_status',
38
+ self::ADDRESS_ID => 'paypal_address_id',
39
+ self::ADDRESS_STATUS => 'paypal_address_status',
40
+ self::PROTECTION_EL => 'protection_eligibility',
41
+ self::FRAUD_FILTERS => 'paypal_fraud_filters',
42
+ self::CORRELATION_ID => 'paypal_correlation_id',
43
+ self::AVS_CODE => 'paypal_avs_code',
44
+ self::CVV2_MATCH => 'paypal_cvv2_match',
45
+ self::CENTINEL_VPAS => self::CENTINEL_VPAS,
46
+ self::CENTINEL_ECI => self::CENTINEL_ECI,
47
+ self::BUYER_TAX_ID => self::BUYER_TAX_ID,
48
+ self::BUYER_TAX_ID_TYPE => self::BUYER_TAX_ID_TYPE,
49
+ );
50
+
51
+ protected $_systemMap = array(
52
+ self::PAYMENT_STATUS => self::PAYMENT_STATUS_GLOBAL,
53
+ self::PENDING_REASON => self::PENDING_REASON_GLOBAL,
54
+ self::IS_FRAUD => self::IS_FRAUD_GLOBAL,
55
+ );
56
+
57
+ public function getOrderPlaceRedirectUrl() {
58
+ //return Mage::getUrl('mygateway/payment/redirect', array('_secure' => true));
59
+ return null;
60
+ }
61
+
62
+ public function getSuccess($messaage=''){
63
+ return $this->successStatus($messaage);
64
+ }
65
+
66
+ public function processPayment($data){
67
+ //if($this->getRequest()->isPost()) {
68
+ if($data) {
69
+
70
+ /*
71
+ /* Your gateway's code to make sure the reponse you
72
+ /* just got is from the gatway and not from some weirdo.
73
+ /* This generally has some checksum or other checks,
74
+ /* and is provided by the gateway.
75
+ /* For now, we assume that the gateway's response is valid
76
+ */
77
+
78
+ $session = Mage::getSingleton('checkout/session');
79
+ $quoteId = $session->getMobiPaypalQuoteId(false);
80
+ $session->setQuoteId($session->getMobiPaypalQuoteId(true));
81
+ Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();
82
+ //return $this->successStatus("$quoteId processed successfully");
83
+ $validated = true;
84
+ //$orderId = '100000001'; // Generally sent by gateway
85
+
86
+ if($validated) {
87
+ $response = $data['response'];
88
+ $paymentId = $response['id'];
89
+ //return $this->errorStatus($paymentId);
90
+ $configData = $this->getPaypalConfig();
91
+ $accessToken = $this->__getAccessToken($configData);
92
+ if(!empty($accessToken)){
93
+ $paymentDetails = $this->__getPaymentDetails($accessToken, $paymentId, $configData);
94
+
95
+ // Payment was successful, so update the order's state, send order email and move to the success page
96
+ $orderId = $session->getMobiPaypalInvoiceId(true);
97
+
98
+ //$this->_order = Mage::getModel('sales/order');
99
+ //$this->_order->loadByIncrementId($orderId);
100
+ $this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
101
+
102
+ /* added newly */
103
+ $parentTransactionId = null;
104
+ $skipFraudDetection = false;
105
+ $this->_importPaymentInformation($paymentDetails);
106
+ $payment = $this->_order->getPayment();
107
+ //$payment->setTransactionId($paymentDetails->id)
108
+ $payment->setTransactionId($paymentDetails->transactions[0]->related_resources[0]->sale->id)
109
+ ->setCurrencyCode($paymentDetails->transactions[0]->amount->currency)
110
+ ->setParentTransactionId($parentTransactionId)
111
+ ->setIsTransactionClosed(0)
112
+ ->registerCaptureNotification(
113
+ $paymentDetails->transactions[0]->amount->total,
114
+ true
115
+ );
116
+ $this->_order->save();
117
+ /* added newly - upto here */
118
+
119
+ //$this->_order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
120
+
121
+ $this->_order->sendNewOrderEmail();
122
+ $this->_order->setEmailSent(true);
123
+
124
+ $this->_order->save();
125
+
126
+ Mage::getSingleton('checkout/session')->unsQuoteId();
127
+ $return = $this->successStatus("$orderId processed successfully");
128
+ $return['data']['invoice_number'] = $orderId;
129
+ $return['data']['order_data'] = Mage::getModel('mobiservices/user')->_getOrderHistory();
130
+ //Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure'=>true));
131
+ return $return;
132
+ }
133
+ else{
134
+ return $this->errorStatus("Invalid Access Token");
135
+ }
136
+ }
137
+ else {
138
+ // There is a problem in the response we got
139
+ $this->cancelAction();
140
+ Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure'=>true));
141
+ }
142
+ }
143
+ else{
144
+ return $this->errorStatus("Post data not received at php side");
145
+ }
146
+ }
147
+
148
+ protected function _importPaymentInformation($response)
149
+ {
150
+ $payment = $this->_order->getPayment();
151
+ $was = $payment->getAdditionalInformation();
152
+ $from = array(
153
+ 'payer_id' => $response->payer->payer_info->payer_id,
154
+ 'payer_email' => $response->payer->payer_info->email,
155
+ 'payer_status' => $response->payer->status,
156
+ 'protection_eligibility' => $response->transactions[0]->related_resources[0]->sale->protection_eligibility,
157
+ 'payment_mode' => $response->transactions[0]->related_resources[0]->sale->payment_mode,
158
+ 'payment_status' => $response->transactions[0]->related_resources[0]->sale->state,
159
+ 'pending_reason' => $response->transactions[0]->related_resources[0]->sale->reason_code,
160
+ );
161
+ /*
162
+ if (isset($from['payment_status'])) {
163
+ $from['payment_status'] = $this->_filterPaymentStatus($this->getRequestData('payment_status'));
164
+ }
165
+ */
166
+
167
+ // collect fraud filters
168
+ $this->importToPayment($from, $payment);
169
+
170
+ /**
171
+ * Detect pending payment, frauds
172
+ * TODO: implement logic in one place
173
+ * @see Mage_Paypal_Model_Pro::importPaymentInfo()
174
+ */
175
+ /*
176
+ if ($this->_info->isPaymentReviewRequired($payment)) {
177
+ $payment->setIsTransactionPending(true);
178
+ if ($fraudFilters) {
179
+ $payment->setIsFraudDetected(true);
180
+ }
181
+ }
182
+ */
183
+ $fraudFilters = false;
184
+ if ($from['pending_reason'] == 'PAYMENT_REVIEW') {
185
+ $payment->setIsTransactionPending(true);
186
+ if ($fraudFilters) {
187
+ $payment->setIsFraudDetected(true);
188
+ }
189
+ }
190
+
191
+ if (strtolower($from['payment_status']) == 'completed') {
192
+ $payment->setIsTransactionApproved(true);
193
+ } elseif (strtolower($from['payment_status']) == 'failed') {
194
+ $payment->setIsTransactionDenied(true);
195
+ }
196
+
197
+ return $was != $payment->getAdditionalInformation();
198
+ }
199
+
200
+ public function importToPayment($from, Mage_Payment_Model_Info $payment)
201
+ {
202
+ $fullMap = array_merge($this->_paymentMap, $this->_systemMap);
203
+ if (is_object($from)) {
204
+ $from = array($from, 'getDataUsingMethod');
205
+ }
206
+ Varien_Object_Mapper::accumulateByMap($from, array($payment, 'setAdditionalInformation'), $fullMap);
207
+ }
208
+
209
+ protected function _filterPaymentStatus($paymentStatus)
210
+ {
211
+ switch ($paymentStatus) {
212
+ case 'Created': // break is intentionally omitted
213
+ case 'Completed': return Mage_Paypal_Model_Info::PAYMENTSTATUS_COMPLETED;
214
+ case 'approved': return Mage_Paypal_Model_Info::PAYMENTSTATUS_COMPLETED;
215
+ case 'Denied': return Mage_Paypal_Model_Info::PAYMENTSTATUS_DENIED;
216
+ case 'Expired': return Mage_Paypal_Model_Info::PAYMENTSTATUS_EXPIRED;
217
+ case 'Failed': return Mage_Paypal_Model_Info::PAYMENTSTATUS_FAILED;
218
+ case 'Pending': return Mage_Paypal_Model_Info::PAYMENTSTATUS_PENDING;
219
+ case 'pending': return Mage_Paypal_Model_Info::PAYMENTSTATUS_PENDING;
220
+ case 'Refunded': return Mage_Paypal_Model_Info::PAYMENTSTATUS_REFUNDED;
221
+ case 'Reversed': return Mage_Paypal_Model_Info::PAYMENTSTATUS_REVERSED;
222
+ case 'Canceled_Reversal': return Mage_Paypal_Model_Info::PAYMENTSTATUS_UNREVERSED;
223
+ case 'Processed': return Mage_Paypal_Model_Info::PAYMENTSTATUS_PROCESSED;
224
+ case 'Voided': return Mage_Paypal_Model_Info::PAYMENTSTATUS_VOIDED;
225
+ }
226
+ return '';
227
+ }
228
+
229
+ public function __getAccessToken($configData){
230
+ //https://api.sandbox.paypal.com/v1/oauth2/token
231
+ //https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI
232
+ if($configData['isSandbox'] == '1')
233
+ $url = "https://api.sandbox.paypal.com/v1/oauth2/token";
234
+ else
235
+ $url = "https://api.paypal.com/v1/oauth2/token";
236
+ $ch = curl_init($url);
237
+ curl_setopt($ch, CURLOPT_HEADER, false);
238
+ curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
239
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array(
240
+ 'Accept: application/json',
241
+ 'Accept-Language: en_US'
242
+ ));
243
+ curl_setopt($ch,CURLOPT_POST,true);
244
+ //curl_setopt($ch,CURLOPT_POSTFIELDS,array('grant_type' => 'client_credentials'));
245
+ curl_setopt($ch,CURLOPT_POSTFIELDS,'grant_type=client_credentials');
246
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
247
+ curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
248
+ curl_setopt($ch, CURLOPT_USERPWD, $configData['apiUsername'].':'.$configData['apiPassword']);
249
+
250
+ $res = curl_exec($ch);
251
+ $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
252
+
253
+ //print_r($res);exit;
254
+ curl_close($ch);
255
+ try{
256
+ $res = json_decode($res);
257
+ return $res->access_token;
258
+ }
259
+ catch(Exception $e){
260
+ return null;
261
+ }
262
+ }
263
+
264
+ public function __getPaymentDetails($accessToken = null, $paymentId = null, $configData = null){
265
+ if($configData['isSandbox'] == '1')
266
+ $url = "https://api.sandbox.paypal.com/v1/payments/payment/";
267
+ else
268
+ $url = "https://api.paypal.com/v1/payments/payment/";
269
+ $ch = curl_init($url.$paymentId);
270
+ curl_setopt($ch, CURLOPT_HEADER, false);
271
+ curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
272
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array(
273
+ 'Content-Type: application/json',
274
+ 'Authorization: Bearer '.$accessToken
275
+ ));
276
+ //curl_setopt($ch,CURLOPT_POST,true);
277
+ //curl_setopt($ch,CURLOPT_POSTFIELDS,array('grant_type' => 'client_credentials'));
278
+ //curl_setopt($ch,CURLOPT_POSTFIELDS,'grant_type=client_credentials');
279
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
280
+ //curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
281
+ //curl_setopt($ch, CURLOPT_USERPWD, 'AXK9pBDQ_6bsGFE6tjiIiIj758F7YxE18dzQhE8k3r9mlDxxmF5Yysz9egNt:EE0j1xBSbSJMwkTH6we0WjtMEDjtz1dwnOl4DsdzP_-tEbcRLhg8K0TOSi_P');
282
+
283
+ $res = curl_exec($ch);
284
+ $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
285
+ curl_close($ch);
286
+ $res = json_decode($res);
287
+ return $res;
288
+ }
289
+
290
+ public function getConfigParam($key){
291
+ return $this->getConfigData($key);
292
+ }
293
+
294
+ public function getPaypalConfig(){
295
+ $data = array(
296
+ 'code' => $this->_code,
297
+ 'title' => $this->getConfigParam('title'),
298
+ 'clientId' => $this->getConfigParam('clientid'),
299
+ 'title' => $this->getConfigParam('title'),
300
+ 'apiUsername' => $this->getConfigParam('api_username'),
301
+ 'apiPassword' => $this->getConfigParam('api_password'),
302
+ 'merchantName' => $this->getConfigParam('merchant_name'),
303
+ 'privacyPolicyUrl' => $this->getConfigParam('privacy_policy_url'),
304
+ 'aggrementUrl' => $this->getConfigParam('aggrement_url'),
305
+ 'title' => $this->getConfigParam('title'),
306
+ 'isSandbox' => $this->getConfigParam('dropdown'),
307
+ 'allow_direct_credit_card' => $this->getConfigParam('allow_direct_credit_card'),
308
+ 'newOrderStatus' => $this->getConfigParam('order_status'),
309
+ );
310
+ return $data;
311
+ }
312
+
313
+ public function isAvailable($quote = null){
314
+ $session = Mage::getSingleton('checkout/session');
315
+ $activePaypalMobile = $session->getActivePaypalMobile();
316
+
317
+ if($activePaypalMobile == '1')
318
+ return parent::isAvailable($quote);
319
+ else
320
+ return false;
321
+ }
322
+ }
323
+ ?>
app/code/local/Mobicommerce/Mobipayments/controllers/PaymentController.php ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Mobipayments Payment Controller
4
+ By: Yash Shah
5
+ yash.shah@rightwaysolution.com
6
+ */
7
+
8
+ class Mobicommerce_Mobipayments_PaymentController extends Mobicommerce_Mobipayments_Controller_Action {
9
+ protected $_order = null;
10
+ // The redirect action is triggered when someone places an order
11
+ public function redirectAction() {
12
+ $this->loadLayout();
13
+ $block = $this->getLayout()->createBlock('Mage_Core_Block_Template','mobipayments',array('template' => 'mobipayments/redirect.phtml'));
14
+ $this->getLayout()->getBlock('content')->append($block);
15
+ $this->renderLayout();
16
+ }
17
+
18
+ public function initPaypalMobileAction(){
19
+ $data = $this->getData();
20
+ //$result = Mage::getModel('mobiservices/shoppingcart_cart')->getCartDetails();
21
+ $session = Mage::getSingleton('checkout/session');
22
+ //$session->setPaypalStandardQuoteId($session->getQuoteId());
23
+ $session->setMobiPaypalQuoteId($session->getQuoteId());
24
+ //$this->getResponse()->setBody($this->getLayout()->createBlock('paypal/standard_redirect')->toHtml());
25
+ //$session->unsQuoteId();
26
+ //$result = Mage::getModel('mobipayments/standard')->getSuccess("Payment Init Successfully");
27
+
28
+ $result = array();
29
+ //print_r($this->getRequest()->getPost('agreement', array()));exit;
30
+
31
+ try {
32
+ $requiredAgreements = Mage::helper('checkout')->getRequiredAgreementIds();
33
+ if ($requiredAgreements) {
34
+ //$postedAgreements = array_keys($this->getRequest()->getPost('agreement', array()));
35
+ $postedAgreements = $data['agreement'];
36
+ $diff = array_diff($requiredAgreements, $postedAgreements);
37
+ if ($diff) {
38
+ $result = Mage::getModel('mobipayments/abstract')->errorStatus($this->__('Please agree to all the terms and conditions before placing the order.'));
39
+ $this->printResult($result);exit;
40
+ }
41
+ }
42
+
43
+ $payment = $data['payment'];
44
+ if ($payment) {
45
+ if (version_compare(Mage::getVersion(), '1.8.0.0', '>=') === true) {
46
+ $payment['checks'] = Mage_Payment_Model_Method_Abstract::CHECK_USE_CHECKOUT
47
+ | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_COUNTRY
48
+ | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_CURRENCY
49
+ | Mage_Payment_Model_Method_Abstract::CHECK_ORDER_TOTAL_MIN_MAX
50
+ | Mage_Payment_Model_Method_Abstract::CHECK_ZERO_TOTAL;
51
+ }
52
+ else{
53
+ $payment['checks'] = null;
54
+ }
55
+ $this->getOnepage()->getQuote()->getPayment()->importData($payment);
56
+ }
57
+
58
+ $this->getOnepage()->saveOrder();
59
+
60
+ $redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();
61
+ $result = Mage::getModel('mobipayments/abstract')->successStatus();
62
+ } catch (Mage_Payment_Model_Info_Exception $e) {
63
+ $message = $e->getMessage();
64
+ $result = Mage::getModel('mobipayments/abstract')->errorStatus($message);
65
+ $this->printResult($result);exit;
66
+ } catch (Mage_Core_Exception $e) {
67
+ Mage::logException($e);
68
+ Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
69
+ $message = $e->getMessage();
70
+ $result = Mage::getModel('mobipayments/abstract')->errorStatus($message);
71
+ $this->printResult($result);exit;
72
+ } catch (Exception $e) {
73
+ Mage::logException($e);
74
+ Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
75
+ $message = $e->getMessage();
76
+ $result = Mage::getModel('mobipayments/abstract')->errorStatus($message);
77
+ $this->printResult($result);exit;
78
+ }
79
+ $result['data']['cart_details']= Mage::getModel('mobiservices/shoppingcart_cart')->getCartInfo();
80
+ $this->getOnepage()->getQuote()->save();
81
+ $session->setMobiPaypalInvoiceId($this->_getCheckoutSession()->getLastRealOrderId());
82
+ /**
83
+ * when there is redirect to third party, we don't want to save order yet.
84
+ * we will save the order in return action.
85
+ */
86
+ /*
87
+ if (isset($redirectUrl)) {
88
+ $result['redirect'] = $redirectUrl;
89
+ }
90
+ */
91
+
92
+ //$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
93
+ $session->unsQuoteId();
94
+ $this->printResult($result);
95
+ }
96
+
97
+ protected function _getCheckoutSession() {
98
+ return Mage::getSingleton('checkout/session');
99
+ }
100
+
101
+ /**
102
+ * Get one page checkout model
103
+ *
104
+ * @return Mage_Checkout_Model_Type_Onepage
105
+ */
106
+ public function getOnepage()
107
+ {
108
+ return Mage::getSingleton('checkout/type_onepage');
109
+ }
110
+
111
+ // The response action is triggered when your gateway sends back a response after processing the customer's payment
112
+ public function responseAction() {
113
+ $data = $this->getData();
114
+ $result = Mage::getModel('mobipayments/standard')->processPayment($data);
115
+ $this->printResult($result);
116
+ }
117
+
118
+ // The cancel action is triggered when an order is to be cancelled
119
+ public function cancelAction() {
120
+ if (Mage::getSingleton('checkout/session')->getLastRealOrderId()) {
121
+ $order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
122
+ if($order->getId()) {
123
+ // Flag the order as 'cancelled' and save it
124
+ $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Gateway has declined the payment.')->save();
125
+ }
126
+ }
127
+ $result = Mage::getModel('mobiservices/shoppingcart_cart')->getCartDetails($data);
128
+ $this->printResult($result);
129
+ }
130
+
131
+ public function ipnAction(){
132
+ //$_POST['txn_id'] = 'PAY-5T061578FA718311AKQV6MXQ';
133
+ $post = $_GET;
134
+ if(!empty($post)){
135
+ $txn_id = $post['txn_id'];
136
+
137
+ $orders = Mage::getModel('sales/order_payment_transaction')->getCollection()
138
+ ->addAttributeToFilter('txn_id', array('eq' => $txn_id));
139
+
140
+ $order_ids = array();
141
+ if(!empty($orders)){
142
+ foreach($orders as $order){
143
+ $txnData = $order->getData();
144
+ $order_ids[] = $txnData['order_id'];
145
+ }
146
+ }
147
+ $order_ids = array_unique($order_ids);
148
+
149
+ if(!empty($order_ids)){
150
+ foreach($order_ids as $order_id){
151
+ $order = Mage::getModel('sales/order')->load($order_id);
152
+ $paymentStatus = strtolower($post['payment_status']);
153
+
154
+ switch($paymentStatus){
155
+ case 'completed':
156
+ $payment = $order->getPayment();
157
+ //print_r($payment->getData());exit;
158
+ $payment->setTransactionId($txn_id)
159
+ ->setCurrencyCode($post['mc_currency'])
160
+ ->setPreparedMessage('Payment done')
161
+ ->setShouldCloseParentTransaction(true)
162
+ ->setIsTransactionClosed(0)
163
+ ->registerCaptureNotification(
164
+ $post['mc_gross'],
165
+ true
166
+ );
167
+ $order->save();
168
+ /*
169
+ $payment->setIsTransactionApproved(true)
170
+ ->setIsTransactionClosed(1);
171
+ */
172
+ $order->save();
173
+ //echo '<pre>';print_r($order->getData());exit;
174
+ break;
175
+
176
+ case 'reverse':
177
+ $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Administrator declined the payment')->save();
178
+ break;
179
+
180
+ default:
181
+ break;
182
+ }
183
+ }
184
+ }
185
+ }
186
+ else{
187
+ die('404');
188
+ }
189
+ }
190
+ /*
191
+ public function testAction(){
192
+ $orderId = '100000209 ';.
193
+ $order = Mage::getModel('sales/order');
194
+ $order->loadByIncrementId($orderId);
195
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
196
+ $order->save();
197
+ print_r($order->getData());
198
+ }
199
+
200
+
201
+ public function _getPaymentMethodsAction(){
202
+ print_r(Mage::getModel('mobipayments/standard')->getModuleData('api_password'));exit;
203
+ }
204
+
205
+ public function testAction(){
206
+ file_put_contents('test.txt', $_POST);exit;
207
+ $configData = Mage::getModel('mobipayments/standard')->getPaypalConfig();
208
+ $paymentDetails = Mage::getModel('mobipayments/standard')->__getPaymentDetails(Mage::getModel('mobipayments/standard')->__getAccessToken($configData), 'PAY-12F401981V3164446KQRIU5Q', $configData);
209
+ echo $paymentDetails->transactions[0]->amount->total;
210
+ print_r($paymentDetails);exit;
211
+ $orderId = '100000008';
212
+ $this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
213
+ $payment = $this->_order->getPayment();
214
+ $payment->setTransactionId('PAY-12F401981V3164446KQRIU5Q')
215
+ ->setCurrencyCode('USD')
216
+ ->setParentTransactionId(null)
217
+ ->setIsTransactionClosed(0)
218
+ ->registerCaptureNotification(
219
+ '255.00',
220
+ true
221
+ );
222
+ $this->_order->save();
223
+ print_r('yash');
224
+ }
225
+ */
226
+ }
app/code/local/Mobicommerce/Mobipayments/controllers/PaymillController.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Mobipayments Paymill Controller
4
+ By: Yash Shah
5
+ yash.shah@rightwaysolution.com
6
+ */
7
+
8
+ class Mobicommerce_Mobipayments_PaymillController extends Mobicommerce_Mobipayments_Controller_Action {
9
+
10
+
11
+ }
app/code/local/Mobicommerce/Mobipayments/etc/config.xml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Mobicommerce_Mobipayments>
5
+ <version>1.0.0</version>
6
+ </Mobicommerce_Mobipayments>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <mobipayments>
11
+ <class>Mobicommerce_Mobipayments_Model</class>
12
+ </mobipayments>
13
+ </models>
14
+ <helpers>
15
+ <mobipayments>
16
+ <class>Mobicommerce_Mobipayments_Helper</class>
17
+ </mobipayments>
18
+ </helpers>
19
+ <blocks>
20
+ <mobipayments>
21
+ <class>Mobicommerce_Mobipayments_Block</class>
22
+ </mobipayments>
23
+ </blocks>
24
+ </global>
25
+ <default>
26
+ <payment>
27
+ <mobipayments>
28
+ <model>mobipayments/standard</model>
29
+ <active>0</active>
30
+ <order_status>pending</order_status>
31
+ <title>Paypal</title>
32
+ <payment_action>sale</payment_action>
33
+ <allowspecific>0</allowspecific>
34
+ <sort_order>1</sort_order>
35
+ </mobipayments>
36
+ </payment>
37
+ </default>
38
+ <frontend>
39
+ <routers>
40
+ <mobipayments>
41
+ <use>standard</use>
42
+ <args>
43
+ <module>Mobicommerce_Mobipayments</module>
44
+ <frontName>mobipayments</frontName>
45
+ </args>
46
+ </mobipayments>
47
+ </routers>
48
+ </frontend>
49
+ </config>
app/code/local/Mobicommerce/Mobipayments/etc/system.xml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <payment>
5
+ <groups>
6
+ <mobipayments translate="label comment" module="mobipayments">
7
+ <label>Mobi Paypal</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>300</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ </active>
23
+ <title translate="label">
24
+ <label>Title</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>20</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </title>
31
+ <clientid translate="label comment">
32
+ <label>Client Id</label>
33
+ <comment>Enter client id for paypal</comment>
34
+ <frontend_type>text</frontend_type>
35
+ <sort_order>21</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ </clientid>
40
+ <api_username translate="label comment">
41
+ <label>API Username</label>
42
+ <comment>Enter API username for paypal</comment>
43
+ <frontend_type>text</frontend_type>
44
+ <sort_order>22</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ </api_username>
49
+ <api_password translate="label comment">
50
+ <label>API Password</label>
51
+ <comment>Enter API password for paypal</comment>
52
+ <frontend_type>text</frontend_type>
53
+ <sort_order>23</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>1</show_in_store>
57
+ </api_password>
58
+ <merchant_name translate="label comment">
59
+ <label>Merchant Name</label>
60
+ <comment>Enter Merchant Name</comment>
61
+ <frontend_type>text</frontend_type>
62
+ <sort_order>24</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <show_in_store>1</show_in_store>
66
+ </merchant_name>
67
+ <privacy_policy_url translate="label comment">
68
+ <label>Merchant Privacy Policy Url</label>
69
+ <comment>Enter Merchant Privacy Policy Url</comment>
70
+ <frontend_type>text</frontend_type>
71
+ <sort_order>25</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ </privacy_policy_url>
76
+ <aggrement_url translate="label comment">
77
+ <label>Merchant Agreement Url</label>
78
+ <comment>Enter Merchant Agreement Url</comment>
79
+ <frontend_type>text</frontend_type>
80
+ <sort_order>26</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>1</show_in_website>
83
+ <show_in_store>1</show_in_store>
84
+ </aggrement_url>
85
+ <dropdown translate="label comment">
86
+ <label>Sandbox Mode</label>
87
+ <comment>Yes/no</comment>
88
+ <frontend_type>select</frontend_type>
89
+ <source_model>adminhtml/system_config_source_yesno</source_model>
90
+ <sort_order>28</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>0</show_in_website>
93
+ <show_in_store>0</show_in_store>
94
+ </dropdown>
95
+ <allow_direct_credit_card translate="label comment">
96
+ <label>Allow Direct Credit Card Payments</label>
97
+ <comment>Please note that paypal supports this method only for US and UK</comment>
98
+ <frontend_type>select</frontend_type>
99
+ <source_model>adminhtml/system_config_source_yesno</source_model>
100
+ <sort_order>29</sort_order>
101
+ <show_in_default>1</show_in_default>
102
+ <show_in_website>0</show_in_website>
103
+ <show_in_store>0</show_in_store>
104
+ </allow_direct_credit_card>
105
+ <order_status translate="label">
106
+ <label>New Order Status</label>
107
+ <frontend_type>select</frontend_type>
108
+ <source_model>adminhtml/system_config_source_order_status</source_model>
109
+ <sort_order>50</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ <show_in_store>0</show_in_store>
113
+ </order_status>
114
+ <allowspecific translate="label">
115
+ <label>Payment Applicable From</label>
116
+ <frontend_type>select</frontend_type>
117
+ <sort_order>61</sort_order>
118
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>0</show_in_store>
122
+ </allowspecific>
123
+ <specificcountry translate="label">
124
+ <label>Countries Payment Applicable From</label>
125
+ <frontend_type>multiselect</frontend_type>
126
+ <sort_order>70</sort_order>
127
+ <source_model>adminhtml/system_config_source_country</source_model>
128
+ <show_in_default>1</show_in_default>
129
+ <show_in_website>1</show_in_website>
130
+ <show_in_store>0</show_in_store>
131
+ <depends>
132
+ <allowspecific>1</allowspecific>
133
+ </depends>
134
+ </specificcountry>
135
+ <sort_order translate="label">
136
+ <label>Sort Order</label>
137
+ <frontend_type>text</frontend_type>
138
+ <sort_order>100</sort_order>
139
+ <show_in_default>1</show_in_default>
140
+ <show_in_website>1</show_in_website>
141
+ <show_in_store>0</show_in_store>
142
+ </sort_order>
143
+ </fields>
144
+ </mobipayments>
145
+ </groups>
146
+ </payment>
147
+ </sections>
148
+ </config>
app/code/local/Mobicommerce/Mobipaypaloffline/Block/Form/Mobipaypaloffline.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Payment
23
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Block for Bank Transfer payment method form
29
+ */
30
+ class Mobicommerce_Mobipaypaloffline_Block_Form_Mobipaypaloffline extends Mage_Payment_Block_Form
31
+ {
32
+
33
+ /**
34
+ * Instructions text
35
+ *
36
+ * @var string
37
+ */
38
+ protected $_instructions;
39
+
40
+ /**
41
+ * Block construction. Set block template.
42
+ */
43
+ protected function _construct()
44
+ {
45
+ parent::_construct();
46
+ $this->setTemplate('mobipaypaloffline/form/mobipaypaloffline.phtml');
47
+ }
48
+
49
+ /**
50
+ * Get instructions text from config
51
+ *
52
+ * @return string
53
+ */
54
+ public function getInstructions()
55
+ {
56
+ if (is_null($this->_instructions)) {
57
+ $this->_instructions = $this->getMethod()->getInstructions();
58
+ }
59
+ return $this->_instructions;
60
+ }
61
+
62
+ }
app/code/local/Mobicommerce/Mobipaypaloffline/Block/Info/Mobipaypaloffline.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mobicommerce_Mobipaypaloffline
23
+ * @copyright Copyright (c) 2014 Mobicommerce. (http://www.mobi-commerce.net)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Block for Bank Transfer payment method form
29
+ */
30
+ class Mobicommerce_Mobipaypaloffline_Block_Info_Mobipaypaloffline extends Mage_Payment_Block_Info
31
+ {
32
+ /**
33
+ * Block construction. Set block template.
34
+ */
35
+ protected function _construct()
36
+ {
37
+ parent::_construct();
38
+ //$this->setTemplate('mobipaypaloffline/info/mobipaypaloffline.phtml');
39
+ }
40
+
41
+ protected function _prepareSpecificInformation($transport = null)
42
+ {
43
+ if (null !== $this->_paymentSpecificInformation) {
44
+ return $this->_paymentSpecificInformation;
45
+ }
46
+ $info = $this->getInfo();
47
+ $transport = new Varien_Object();
48
+ $transport = parent::_prepareSpecificInformation($transport);
49
+
50
+ $payer_email = $info->getMobipaypalofflinePayerEmail();
51
+ $payer_name = $info->getMobipaypalofflinePayerName();
52
+
53
+ $payer_email = $payer_email ? $payer_email : '--NOT SPECIFIED--';
54
+ $payer_name = $payer_name ? $payer_name : '--NOT SPECIFIED--';
55
+
56
+ $transport->addData(array(
57
+ Mage::helper('payment')->__('Payer Email') => $payer_email,
58
+ Mage::helper('payment')->__('Payer Name') => $payer_name
59
+ ));
60
+ return $transport;
61
+ }
62
+
63
+ /**
64
+ * Retrieve payment method model
65
+ *
66
+ * @return Mage_Payment_Model_Method_Abstract
67
+ */
68
+ /*
69
+ public function getMethod()
70
+ {
71
+ $method = $this->getData('method');
72
+
73
+ if (!($method instanceof Mage_Payment_Model_Method_Abstract)) {
74
+ Mage::throwException($this->__('Cannot retrieve the payment method model object.'));
75
+ }
76
+ return $method;
77
+ }
78
+
79
+ /**
80
+ * Retrieve payment method code
81
+ *
82
+ * @return string
83
+ */
84
+ /*
85
+ public function getMethodCode()
86
+ {
87
+ return $this->getMethod()->getCode();
88
+ }
89
+
90
+ /**
91
+ * Retrieve field value data from payment info object
92
+ *
93
+ * @param string $field
94
+ * @return mixed
95
+ */
96
+ /*
97
+ public function getInfoData($field)
98
+ {
99
+ return $this->escapeHtml($this->getMethod()->getInfoInstance()->getData($field));
100
+ }
101
+ */
102
+
103
+ }
app/code/local/Mobicommerce/Mobipaypaloffline/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobipaypaloffline_Helper_Data extends Mage_Core_Helper_Abstract{
4
+
5
+
6
+ }
app/code/local/Mobicommerce/Mobipaypaloffline/Model/Source/Display.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Display mobipaypaloffline payment method options
5
+ */
6
+ class Mobicommerce_Mobipaypaloffline_Model_Source_Display
7
+ {
8
+ protected $_displayOptions = array(
9
+ 'MOBILE' => 'Mobile Only',
10
+ 'WEBSITE' => 'Website Only',
11
+ 'BOTH' => 'Mobile And Website both'
12
+ );
13
+
14
+ public function toOptionArray()
15
+ {
16
+ $displayOptions = $this->_displayOptions;
17
+ $options = array();
18
+ foreach ($displayOptions as $code => $label) {
19
+ $options[] = array(
20
+ 'value' => $code,
21
+ 'label' => $label
22
+ );
23
+ }
24
+ return $options;
25
+ }
26
+ }
app/code/local/Mobicommerce/Mobipaypaloffline/Model/Standard.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobipaypaloffline_Model_Standard extends Mage_Payment_Model_Method_Abstract
4
+ {
5
+ protected $_code = 'mobipaypaloffline';
6
+ protected $_canUseInternal = true;
7
+ protected $_canUseCheckout = true;
8
+ protected $_canUseForMultishipping = true;
9
+
10
+ /**
11
+ * Bank Transfer payment block paths
12
+ *
13
+ * @var string
14
+ */
15
+ protected $_formBlockType = 'mobipaypaloffline/form_mobipaypaloffline';
16
+ protected $_infoBlockType = 'mobipaypaloffline/info_mobipaypaloffline';
17
+
18
+ /**
19
+ * Get instructions text from config
20
+ *
21
+ * @return string
22
+ */
23
+ public function getInstructions()
24
+ {
25
+ return trim($this->getConfigData('instructions'));
26
+ }
27
+
28
+ public function assignData($data)
29
+ {
30
+ if (!($data instanceof Varien_Object)) {
31
+ $data = new Varien_Object($data);
32
+ }
33
+ $info = $this->getInfoInstance();
34
+ $info->setMobipaypalofflinePayerEmail($data->getMobipaypalofflinePayerEmail())
35
+ ->setMobipaypalofflinePayerName($data->getMobipaypalofflinePayerName());
36
+ return $this;
37
+ }
38
+
39
+ public function validate()
40
+ {
41
+ parent::validate();
42
+
43
+ $info = $this->getInfoInstance();
44
+ $payerEmail = $info->getMobipaypalofflinePayerEmail();
45
+ $payerName = $info->getMobipaypalofflinePayerName();
46
+ if(empty($payerEmail)){
47
+ $errorCode = 'invalid_data';
48
+ $errorMsg = $this->_getHelper()->__('Email is required field');
49
+ }
50
+
51
+ if($errorMsg){
52
+ Mage::throwException($errorMsg);
53
+ }
54
+ return $this;
55
+ }
56
+
57
+ public function isAvailable($quote = null){
58
+ $session = Mage::getSingleton('checkout/session');
59
+ $is_enabled = parent::isAvailable($quote);
60
+ $activePaypalMobile = $session->getActivePaypalMobile();
61
+
62
+ if(!$is_enabled)
63
+ return false;
64
+ else{
65
+ $display_option = $this->getConfigData('display_option');
66
+ if($display_option == 'BOTH'){
67
+ return true;
68
+ }
69
+ else if($display_option == 'MOBILE'){
70
+ if($activePaypalMobile == '1')
71
+ return true;
72
+ else
73
+ return false;
74
+ }
75
+ else if($display_option == 'WEBSITE'){
76
+ if($activePaypalMobile == '1')
77
+ return false;
78
+ else
79
+ return true;
80
+ }
81
+ }
82
+ }
83
+
84
+ }
85
+ ?>
app/code/local/Mobicommerce/Mobipaypaloffline/etc/config.xml ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Mobicommerce_Mobipaypaloffline>
5
+ <version>1.0.0</version>
6
+ </Mobicommerce_Mobipaypaloffline>
7
+ </modules>
8
+
9
+ <global>
10
+ <blocks>
11
+ <mobipaypaloffline>
12
+ <class>Mobicommerce_Mobipaypaloffline_Block</class>
13
+ </mobipaypaloffline>
14
+ </blocks>
15
+ <helpers>
16
+ <mobipaypaloffline>
17
+ <class>Mobicommerce_Mobipaypaloffline_Helper</class>
18
+ </mobipaypaloffline>
19
+ </helpers>
20
+ <models>
21
+ <mobipaypaloffline>
22
+ <class>Mobicommerce_Mobipaypaloffline_Model</class>
23
+ </mobipaypaloffline>
24
+ </models>
25
+
26
+ <resources>
27
+ <mobipaypaloffline_setup>
28
+ <setup>
29
+ <module>Mobicommerce_Mobipaypaloffline</module>
30
+ </setup>
31
+ <connection>
32
+ <use>core_setup</use>
33
+ </connection>
34
+ </mobipaypaloffline_setup>
35
+ <mobipaypaloffline_write>
36
+ <connection>
37
+ <use>core_write</use>
38
+ </connection>
39
+ </mobipaypaloffline_write>
40
+ <mobipaypaloffline_read>
41
+ <connection>
42
+ <use>core_read</use>
43
+ </connection>
44
+ </mobipaypaloffline_read>
45
+ </resources>
46
+
47
+ <fieldsets>
48
+ <sales_convert_quote_payment>
49
+ <mobipaypaloffline_payer_email>
50
+ <to_order_payment>*</to_order_payment>
51
+ </mobipaypaloffline_payer_email>
52
+ <mobipaypaloffline_payer_name>
53
+ <to_order_payment>*</to_order_payment>
54
+ </mobipaypaloffline_payer_name>
55
+ </sales_convert_quote_payment>
56
+ </fieldsets>
57
+ </global>
58
+
59
+ <default>
60
+ <payment>
61
+ <mobipaypaloffline>
62
+ <active>0</active>
63
+ <model>mobipaypaloffline/standard</model>
64
+ <order_status>pending</order_status>
65
+ <title>Mobicommerce Paypal Offline</title>
66
+ <display_option>MOBILE</display_option>
67
+ <allowspecific>0</allowspecific>
68
+ <group>offline</group>
69
+ </mobipaypaloffline>
70
+ </payment>
71
+ </default>
72
+ </config>
app/code/local/Mobicommerce/Mobipaypaloffline/etc/system.xml ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <payment>
5
+ <groups>
6
+ <mobipaypaloffline translate="label" module="mobipaypaloffline">
7
+ <label>Mobi Paypal Offline</label>
8
+ <sort_order>305</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>0</show_in_store>
12
+ <fields>
13
+ <active translate="label">
14
+ <label>Enabled</label>
15
+ <frontend_type>select</frontend_type>
16
+ <source_model>adminhtml/system_config_source_yesno</source_model>
17
+ <sort_order>1</sort_order>
18
+ <show_in_default>1</show_in_default>
19
+ <show_in_website>1</show_in_website>
20
+ <show_in_store>0</show_in_store>
21
+ </active>
22
+ <title translate="label">
23
+ <label>Title</label>
24
+ <frontend_type>text</frontend_type>
25
+ <sort_order>2</sort_order>
26
+ <show_in_default>1</show_in_default>
27
+ <show_in_website>1</show_in_website>
28
+ <show_in_store>0</show_in_store>
29
+ </title>
30
+ <display_option translate="label">
31
+ <label>Display Option</label>
32
+ <frontend_type>select</frontend_type>
33
+ <source_model>Mobicommerce_Mobipaypaloffline_Model_Source_Display</source_model>
34
+ <sort_order>3</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>0</show_in_store>
38
+ </display_option>
39
+ <instructions translate="label">
40
+ <label>Instructions</label>
41
+ <frontend_type>textarea</frontend_type>
42
+ <sort_order>4</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>0</show_in_store>
46
+ </instructions>
47
+ <order_status translate="label">
48
+ <label>New order status</label>
49
+ <frontend_type>select</frontend_type>
50
+ <source_model>adminhtml/system_config_source_order_status</source_model>
51
+ <sort_order>5</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>0</show_in_store>
55
+ </order_status>
56
+ <allowspecific translate="label">
57
+ <label>Payment from Applicable Countries</label>
58
+ <frontend_type>allowspecific</frontend_type>
59
+ <sort_order>50</sort_order>
60
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>0</show_in_store>
64
+ </allowspecific>
65
+ <specificcountry translate="label">
66
+ <label>Payment from Specific Countries</label>
67
+ <frontend_type>multiselect</frontend_type>
68
+ <sort_order>51</sort_order>
69
+ <source_model>adminhtml/system_config_source_country</source_model>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>0</show_in_store>
73
+ <can_be_empty>1</can_be_empty>
74
+ </specificcountry>
75
+ <min_order_total translate="label">
76
+ <label>Minimum Order Total</label>
77
+ <frontend_type>text</frontend_type>
78
+ <sort_order>98</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>0</show_in_store>
82
+ </min_order_total>
83
+ <max_order_total translate="label">
84
+ <label>Maximum Order Total</label>
85
+ <frontend_type>text</frontend_type>
86
+ <sort_order>99</sort_order>
87
+ <show_in_default>1</show_in_default>
88
+ <show_in_website>1</show_in_website>
89
+ <show_in_store>0</show_in_store>
90
+ </max_order_total>
91
+ <sort_order translate="label">
92
+ <label>Sort Order</label>
93
+ <frontend_type>text</frontend_type>
94
+ <sort_order>100</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>0</show_in_store>
98
+ </sort_order>
99
+ </fields>
100
+ </mobipaypaloffline>
101
+ </groups>
102
+ </payment>
103
+ </sections>
104
+ </config>
app/code/local/Mobicommerce/Mobipaypaloffline/sql/mobipaypaloffline_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $this->startSetup();
3
+ $this->run("
4
+
5
+ ALTER TABLE `{$this->getTable('sales/quote_payment')}` ADD `mobipaypaloffline_payer_email` VARCHAR( 255 ) NOT NULL ;
6
+ ALTER TABLE `{$this->getTable('sales/quote_payment')}` ADD `mobipaypaloffline_payer_name` VARCHAR( 255 ) NOT NULL ;
7
+
8
+ ALTER TABLE `{$this->getTable('sales/order_payment')}` ADD `mobipaypaloffline_payer_email` VARCHAR( 255 ) NOT NULL ;
9
+ ALTER TABLE `{$this->getTable('sales/order_payment')}` ADD `mobipaypaloffline_payer_name` VARCHAR( 255 ) NOT NULL ;
10
+
11
+ ");
12
+ $this->endSetup();
app/code/local/Mobicommerce/Mobiservices/Block/Connector.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Block_Connector extends Mage_Core_Block_Template {
4
+
5
+ private $_connectorVersion = '';
6
+
7
+ public function _prepareLayout()
8
+ {
9
+ return parent::_prepareLayout();
10
+ }
11
+
12
+ public function _setConnectorVersion($connectorVersion)
13
+ {
14
+ $this->_connectorVersion = $connectorVersion;
15
+ }
16
+
17
+ public function _getConnectorVersion()
18
+ {
19
+ return $this->_connectorVersion;
20
+ }
21
+
22
+ public function _getConnectorModel($model)
23
+ {
24
+ $modelpath = $this->connectorDefinition($this->_connectorVersion, 'mobiservices');
25
+ if(empty($modelpath))
26
+ return $model;
27
+ else
28
+ return str_replace('mobiservices/', 'mobiservices/'.$modelpath.'_', $model);
29
+ }
30
+
31
+ protected function connectorDefinition($connectorVersion = null, $module = 'mobiservices')
32
+ {
33
+ if(empty($connectorVersion))
34
+ return false;
35
+
36
+ $connector = array(
37
+ '1x0x3' => array(
38
+ 'mobiadmin' => array(
39
+ 'version' => '1.0.0',
40
+ 'modelpath' => ''
41
+ ),
42
+ 'mobiservices' => array(
43
+ 'version' => '1.0.3',
44
+ 'modelpath' => '1x0x3'
45
+ ),
46
+ 'mobipaypaloffline' => array(
47
+ 'version' => '1.0.0',
48
+ 'modelpath' => ''
49
+ ),
50
+ 'mobipayments' => array(
51
+ 'version' => '1.0.0',
52
+ 'modelpath' => ''
53
+ ),
54
+ ),
55
+ '1.3.1' => array(
56
+ 'mobiadmin' => array(
57
+ 'version' => '1.0.0',
58
+ 'modelpath' => ''
59
+ ),
60
+ 'mobiservices' => array(
61
+ 'version' => '1.3.1',
62
+ 'modelpath' => '1x3x1'
63
+ ),
64
+ 'mobipaypaloffline' => array(
65
+ 'version' => '1.0.0',
66
+ 'modelpath' => ''
67
+ ),
68
+ 'mobipayments' => array(
69
+ 'version' => '1.0.0',
70
+ 'modelpath' => ''
71
+ ),
72
+ ),
73
+ );
74
+ if(isset($connector[$connectorVersion][$module]['modelpath']) && !empty($connector[$connectorVersion][$module]['modelpath']))
75
+ return $connector[$connectorVersion][$module]['modelpath'];
76
+ return false;
77
+ }
78
+ }
app/code/local/Mobicommerce/Mobiservices/Controller/Action.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ abstract class Mobicommerce_Mobiservices_Controller_Action extends Mage_Core_Controller_Front_Action {
3
+
4
+ protected $_data;
5
+
6
+ public function preDispatch()
7
+ {
8
+ parent::preDispatch();
9
+ $this->setRequestData();
10
+ }
11
+
12
+ public function dataToJson($data)
13
+ {
14
+ $this->setData($data);
15
+ $this->dispatchEventChangeData($this->getActionName('_return'), $data);
16
+ $this->_data = $this->getData();
17
+ return Mage::helper('core')->jsonEncode($this->_data);
18
+ }
19
+
20
+ public function dispatchEventChangeData($event_name, $data)
21
+ {
22
+ Mage::dispatchEvent($event_name, array('object' => $this, 'data' => $data));
23
+ }
24
+
25
+ public function getActionName($last = '')
26
+ {
27
+ return $this->getFullActionName() . $last;
28
+ }
29
+
30
+ public function printResult($data)
31
+ {
32
+ $json_data = $this->dataToJson($data);
33
+ if(isset($_GET['callback']) && $_GET['callback']!=''){
34
+ print $_GET['callback'] ."(".$json_data.")";
35
+ }else{
36
+ header('content-type:application/json');
37
+ echo $json_data;
38
+ }
39
+ exit;
40
+ }
41
+
42
+ public function setRequestData()
43
+ {
44
+ $this->setData($this->getRequest()->getParams());
45
+ $this->dispatchEventChangeData($this->getActionName(), $this->_data);
46
+ $this->_data = $this->getData();
47
+ }
48
+
49
+ public function getData()
50
+ {
51
+ return $this->_data;
52
+ }
53
+
54
+ public function setData($data)
55
+ {
56
+ $this->_data = $data;
57
+ if(isset($this->_data['connectorVersion'])){
58
+ Mage::getBlockSingleton('mobiservices/connector')->_setConnectorVersion($this->_data['connectorVersion']);
59
+ }
60
+ }
61
+ }
62
+ ?>
app/code/local/Mobicommerce/Mobiservices/Helper/Mobicommerce.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiservices_Helper_Mobicommerce extends Mage_Core_Helper_Abstract {
3
+
4
+ /* function to remove entire directory with all files in it */
5
+ public function rrmdir($dir, $include_basedir = true)
6
+ {
7
+ if (is_dir($dir)) {
8
+ $objects = scandir($dir);
9
+ foreach ($objects as $object) {
10
+ if ($object != "." && $object != "..") {
11
+ if (filetype($dir."/".$object) == "dir") $this->rrmdir($dir."/".$object); else unlink($dir."/".$object);
12
+ }
13
+ }
14
+ reset($objects);
15
+ if($include_basedir)
16
+ rmdir($dir);
17
+ }
18
+ }
19
+ }
app/code/local/Mobicommerce/Mobiservices/Helper/Shoppingcart.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mobicommerce_Mobiservices_Helper_Shoppingcart extends Mage_Core_Helper_Abstract {
3
+
4
+ public function formatOptionsCart($options) {
5
+ $data = array();
6
+ foreach ($options as $option) {
7
+ $data[] = array(
8
+ 'option_title' => $option['label'],
9
+ 'option_value' => $option['value'],
10
+ 'option_price' => isset($option['price']) == true ? $option['price'] : 0,
11
+ );
12
+ }
13
+ return $data;
14
+ }
15
+
16
+ public function getOptions(Mage_Catalog_Model_Product_Configuration_Item_Interface $item) {
17
+ return array_merge(
18
+ $this->getBundleOptions($item),
19
+ $this->formatOptionsCart(Mage::helper('catalog/product_configuration')->getCustomOptions($item))
20
+ );
21
+ }
22
+
23
+ /**
24
+ * it is for magento < 1.5.0.0
25
+ * @param Mage_Sales_Model_Quote_Item $item
26
+ * @return options
27
+ */
28
+ public function getUsedProductOption(Mage_Sales_Model_Quote_Item $item) {
29
+ $typeId = $item->getProduct()->getTypeId();
30
+ switch ($typeId) {
31
+ case Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE:
32
+ return $this->getConfigurableOptions($item);
33
+ break;
34
+ case Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE:
35
+ return $this->getGroupedOptions($item);
36
+ break;
37
+ }
38
+
39
+ return $this->getCustomOptions($item);
40
+ }
41
+
42
+ public function getConfigurableOptions(Mage_Catalog_Model_Product_Configuration_Item_Interface $item)
43
+ {
44
+ $product = $item->getProduct();
45
+ $typeId = $product->getTypeId();
46
+ $attributes = $product->getTypeInstance(true)
47
+ ->getSelectedAttributesInfo($product);
48
+ return array_merge($attributes, $this->getCustomOptions($item));
49
+ }
50
+
51
+ public function getGroupedOptions(Mage_Catalog_Model_Product_Configuration_Item_Interface $item)
52
+ {
53
+ $product = $item->getProduct();
54
+ $typeId = $product->getTypeId();
55
+ $options = array();
56
+ /**
57
+ * @var Mage_Catalog_Model_Product_Type_Grouped
58
+ */
59
+ $typeInstance = $product->getTypeInstance(true);
60
+ $associatedProducts = $typeInstance->getAssociatedProducts($product);
61
+
62
+ if ($associatedProducts) {
63
+ foreach ($associatedProducts as $associatedProduct) {
64
+ $qty = $item->getOptionByCode('associated_product_' . $associatedProduct->getId());
65
+ $option = array(
66
+ 'label' => $associatedProduct->getName(),
67
+ 'value' => ($qty && $qty->getValue()) ? $qty->getValue() : 0
68
+ );
69
+
70
+ $options[] = $option;
71
+ }
72
+ }
73
+
74
+ $options = array_merge($options, $this->getCustomOptions($item));
75
+ $isUnConfigured = true;
76
+ foreach ($options as &$option) {
77
+ if ($option['value']) {
78
+ $isUnConfigured = false;
79
+ break;
80
+ }
81
+ }
82
+ return $isUnConfigured ? array() : $options;
83
+ }
84
+
85
+ public function getCustomOptions(Mage_Sales_Model_Quote_Item $item) {
86
+ $options = array();
87
+ $product = $item->getProduct();
88
+
89
+ if ($optionIds = $item->getOptionByCode('option_ids')) {
90
+ $options = array();
91
+ foreach (explode(',', $optionIds->getValue()) as $optionId) {
92
+ if ($option = $product->getOptionById($optionId)) {
93
+
94
+ $quoteItemOption = $item->getOptionByCode('option_' . $option->getId());
95
+
96
+ $group = $option->groupFactory($option->getType())
97
+ ->setOption($option)
98
+ ->setQuoteItemOption($quoteItemOption);
99
+
100
+ $options[] = array(
101
+ 'label' => $option->getTitle(),
102
+ 'value' => $group->getFormattedOptionValue($quoteItemOption->getValue()),
103
+ 'print_value' => $group->getPrintableOptionValue($quoteItemOption->getValue()),
104
+ 'option_id' => $option->getId(),
105
+ 'option_type' => $option->getType(),
106
+ 'custom_view' => $group->isCustomizedView()
107
+ );
108
+ }
109
+ }
110
+ }
111
+ if ($addOptions = $item->getOptionByCode('additional_options')) {
112
+ $options = array_merge($options, unserialize($addOptions->getValue()));
113
+ }
114
+ return $this->formatOptionsCart($options);
115
+ }
116
+
117
+ public function getBundleOptions(Mage_Catalog_Model_Product_Configuration_Item_Interface $item) {
118
+ $options = array();
119
+ $product = $item->getProduct();
120
+ /**
121
+ * @var Mage_Bundle_Model_Product_Type
122
+ */
123
+ $typeInstance = $product->getTypeInstance(true);
124
+
125
+ // get bundle options
126
+ $optionsQuoteItemOption = $item->getOptionByCode('bundle_option_ids');
127
+ $bundleOptionsIds = $optionsQuoteItemOption ? unserialize($optionsQuoteItemOption->getValue()) : array();
128
+ if ($bundleOptionsIds) {
129
+ /**
130
+ * @var Mage_Bundle_Model_Mysql4_Option_Collection
131
+ */
132
+ $optionsCollection = $typeInstance->getOptionsByIds($bundleOptionsIds, $product);
133
+
134
+ // get and add bundle selections collection
135
+ $selectionsQuoteItemOption = $item->getOptionByCode('bundle_selection_ids');
136
+
137
+ $selectionsCollection = $typeInstance->getSelectionsByIds(
138
+ unserialize($selectionsQuoteItemOption->getValue()), $product
139
+ );
140
+
141
+ $bundleOptions = $optionsCollection->appendSelections($selectionsCollection, true);
142
+ foreach ($bundleOptions as $bundleOption) {
143
+ if ($bundleOption->getSelections()) {
144
+ $bundleSelections = $bundleOption->getSelections();
145
+ $option = array();
146
+ foreach ($bundleSelections as $bundleSelection) {
147
+ $check = array();
148
+ $qty = Mage::helper('bundle/catalog_product_configuration')->getSelectionQty($product, $bundleSelection->getSelectionId()) * 1;
149
+ if ($qty) {
150
+ $check[] = $qty . ' x ' . $this->escapeHtml($bundleSelection->getName());
151
+ $option[] = array(
152
+ 'option_title' => $bundleOption->getTitle(),
153
+ 'option_value' => $qty . ' x ' . $this->escapeHtml($bundleSelection->getName()),
154
+ 'option_price' => Mage::helper('bundle/catalog_product_configuration')->getSelectionFinalPrice($item, $bundleSelection),
155
+ );
156
+ }
157
+ }
158
+
159
+ if ($check)
160
+ $options[] = $option;
161
+
162
+ }
163
+ }
164
+ }
165
+
166
+ return $options;
167
+ }
168
+
169
+ public function getDownloadableOptions(Mage_Catalog_Model_Product_Configuration_Item_Interface $item) {
170
+ $options = array();
171
+ $product = $item->getProduct();
172
+ /**
173
+ * @var Mage_Bundle_Model_Product_Type
174
+ */
175
+ $typeInstance = $product->getTypeInstance(true);
176
+
177
+ // get bundle options
178
+ $optionsQuoteItemOption = $item->getOptionByCode('downloadable_link_ids');
179
+ $downlodableOptionsIds = $optionsQuoteItemOption ? $optionsQuoteItemOption->getValue() : array();
180
+ if(!empty($downlodableOptionsIds)){
181
+ $downlodableOptionsIds = explode(",", $downlodableOptionsIds);
182
+ }
183
+ $optionsCollection = $typeInstance->getLinks($product);
184
+ $option = array();
185
+ foreach ($optionsCollection as $_item) {
186
+ if (in_array($_item->getId(), $downlodableOptionsIds)) {
187
+ $option[] = $_item->getTitle();
188
+ }
189
+ }
190
+ if(!empty($option)){
191
+ $options[] = array(
192
+ 'option_title' => "Links",
193
+ 'option_value' => implode(", ", $option),
194
+ );
195
+ }
196
+ //return $options;
197
+ return array_merge(
198
+ $options,
199
+ $this->formatOptionsCart(Mage::helper('catalog/product_configuration')->getCustomOptions($item))
200
+ );
201
+ }
202
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Abstract.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Abstract extends Mage_Core_Model_Abstract {
4
+
5
+ public function successStatus($success = array('SUCCESS'))
6
+ {
7
+ return array(
8
+ 'status' => 'SUCCESS',
9
+ 'message' => $success,
10
+ );
11
+ }
12
+
13
+ public function errorStatus($error = array('0','opps! unknown Error '))
14
+ {
15
+ return array(
16
+ 'status' => 'FAIL',
17
+ 'message' => is_array($error)?$error[0]:$error,
18
+ );
19
+ }
20
+
21
+ public function checkUserLoginSession()
22
+ {
23
+ return Mage::getSingleton('customer/session')->isLoggedIn();
24
+ }
25
+
26
+ public function _getStoreId()
27
+ {
28
+ return Mage::app()->getStore()->getStoreId();
29
+ }
30
+
31
+ public function _getStoreName()
32
+ {
33
+ return Mage::app()->getStore()->getName();
34
+ }
35
+
36
+ public function _getWebsiteId()
37
+ {
38
+ return Mage::app()->getStore()->getWebsiteId();
39
+ }
40
+
41
+ public function eventChangeData($name_event, $value)
42
+ {
43
+ Mage::dispatchEvent($name_event, $value);
44
+ }
45
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Appsetting.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Appsetting extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function getCmsdata($data)
6
+ {
7
+ $cmsCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
8
+ ->addFieldToFilter('app_code', $data['appcode'])
9
+ ->addFieldToFilter('setting_code', 'cms_settings');
10
+
11
+ if($cmsCollection->getSize()){
12
+ foreach($cmsCollection as $cmsData){
13
+ return Mage::helper('mobiadmin')->_jsonUnserialize($cmsData['value']);
14
+ }
15
+ }
16
+ else{
17
+ return null;
18
+ }
19
+ }
20
+
21
+ public function getAppinfo($data)
22
+ {
23
+ $AppinfoCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
24
+ ->addFieldToFilter('app_code', $data['appcode'])
25
+ ->addFieldToFilter('setting_code', 'appinfo');
26
+
27
+ if($AppinfoCollection->getSize()){
28
+ foreach($AppinfoCollection as $appinfo){
29
+ return Mage::helper('mobiadmin')->_jsonUnserialize($appinfo['value']);
30
+ }
31
+ }
32
+ else{
33
+ return null;
34
+ }
35
+ }
36
+
37
+ public function getPushdata($data)
38
+ {
39
+ $pushCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
40
+ ->addFieldToFilter('app_code', $data['appcode'])
41
+ ->addFieldToFilter('setting_code', 'push_notification');
42
+
43
+ if($pushCollection->getSize()){
44
+ foreach($pushCollection as $pushCollection){
45
+ return Mage::helper('mobiadmin')->_jsonUnserialize($pushCollection['value']);
46
+ }
47
+ }
48
+ else{
49
+ return null;
50
+ }
51
+ }
52
+
53
+ public function getHomepageBanners($data)
54
+ {
55
+ $bannersArray = array();
56
+ $bannersCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
57
+ ->addFieldToFilter('app_code', $data['appcode'])
58
+ ->addFieldToFilter('setting_code', 'banner_settings');
59
+
60
+ if($bannersCollection->getSize()){
61
+ foreach($bannersCollection as $banners){
62
+ $banners = Mage::helper('mobiadmin')->_jsonUnserialize($banners['value']);
63
+ if($banners){
64
+ foreach($banners as $banner){
65
+ if($banner['is_active'] == '1'){
66
+ $bannersArray[] = $banner['url'];
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ return $bannersArray;
73
+ }
74
+
75
+ public function getPopupdata($data)
76
+ {
77
+ $popupCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
78
+ ->addFieldToFilter('app_code', $data['appcode'])
79
+ ->addFieldToFilter('setting_code', 'popup_setting');
80
+
81
+ if($popupCollection->getSize()){
82
+ foreach($popupCollection as $pushCollection){
83
+ return Mage::helper('mobiadmin')->_jsonUnserialize($pushCollection['value']);
84
+ }
85
+ }
86
+ else{
87
+ return null;
88
+ }
89
+ }
90
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Catalog/Catalog.php ADDED
@@ -0,0 +1,1242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Catalog_Catalog extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function _categoryTreeList($storeId = null, $appcode = null)
6
+ {
7
+ if(!empty($storeId))
8
+ $parentId = Mage::app()->getStore($storeId)->getRootCategoryId();
9
+ else
10
+ $parentId = Mage::app()->getStore()->getRootCategoryId();
11
+ $tree = Mage::getResourceSingleton('catalog/category_tree')->load();
12
+ $root = $tree->getNodeById($parentId);
13
+ if($root && $root->getId() == 1) {
14
+ $root->setName(Mage::helper('catalog')->__('Root'));
15
+ }
16
+ $collection = Mage::getModel('catalog/category')->getCollection()
17
+ ->addAttributeToSelect('name')
18
+ ->addAttributeToFilter('is_active','1')
19
+ //->addAttributeToFilter('display_mode',array('nlike'=>'PAGE'))
20
+ ->addAttributeToFilter('include_in_menu','1');
21
+
22
+ $tree->addCollectionData($collection, true);
23
+
24
+ $categories = $this->_nodeToArray($root);
25
+ $categories = $this->_make_tree_to_list($categories['children']);
26
+ $categories = $this->_remove_category_children($categories);
27
+ $categories = $this->_attachCategoryIcon($categories, $appcode);
28
+ return $categories;
29
+ }
30
+
31
+ public function getCatalogSearch($data)
32
+ {
33
+ $keyword = $data['q'];
34
+ $_helper = Mage::helper('catalogsearch');
35
+ $queryParam = str_replace('%20', ' ', $keyword);
36
+ Mage::app()->getRequest()->setParam($_helper->getQueryParamName(), $queryParam);
37
+ /** @var $query Mage_CatalogSearch_Model_Query */
38
+ $query = $_helper->getQuery();
39
+ $query->setStoreId(Mage::app()->getStore()->getId());
40
+
41
+ if ($query->getQueryText() != '') {
42
+ $check = false;
43
+ if (Mage::helper('catalogsearch')->isMinQueryLength()) {
44
+ $query->setId(0)
45
+ ->setIsActive(1)
46
+ ->setIsProcessed(1);
47
+ } else {
48
+ if ($query->getId()) {
49
+ $query->setPopularity($query->getPopularity() + 1);
50
+ } else {
51
+ $query->setPopularity(1);
52
+ }
53
+
54
+ if ($query->getRedirect()) {
55
+ $query->save();
56
+ //break
57
+ $check = true;
58
+ } else {
59
+ $query->prepare();
60
+ }
61
+ }
62
+ if ($check == FALSE) {
63
+ Mage::helper('catalogsearch')->checkNotes();
64
+ if (!Mage::helper('catalogsearch')->isMinQueryLength()) {
65
+ $query->save();
66
+ }
67
+ }
68
+ } else {
69
+ return $this->statusError();
70
+ }
71
+ if (method_exists($_helper, 'getEngine')) {
72
+ $engine = Mage::helper('catalogsearch')->getEngine();
73
+ if ($engine instanceof Varien_Object) {
74
+ $isLayeredNavigationAllowed = $engine->isLeyeredNavigationAllowed();
75
+ } else {
76
+ $isLayeredNavigationAllowed = true;
77
+ }
78
+ } else {
79
+ $isLayeredNavigationAllowed = true;
80
+ }
81
+ $layer = Mage::getSingleton('catalogsearch/layer');
82
+ $collection = $layer->getProductCollection();
83
+ return $collection;
84
+ }
85
+
86
+ function _nodeToArray(Varien_Data_Tree_Node $node)
87
+ {
88
+ $result = array();
89
+ $result['category_id'] = $node->getId();
90
+ $result['parent_id'] = $node->getParentId();
91
+ $result['name'] = $node->getName();
92
+ $result['is_active'] = $node->getIsActive();
93
+ $result['position'] = $node->getPosition();
94
+ $result['level'] = $node->getLevel();
95
+ $result['children'] = array();
96
+ $category = Mage::getModel('catalog/category')->load($node->getId());
97
+ //$result['imageurl'] = $this->getResizedImage($category->getImageUrl(),300,300);
98
+ $result['imageurl'] = $this->getResizedImage(Mage::getBaseUrl('media').'catalog/category/'.$category->getThumbnail(),300,300);
99
+ $result['products_count'] = $this->_getProductCountForCategory($category);
100
+
101
+ foreach ($node->getChildren() as $child) {
102
+ $result['children'][] = $this->_nodeToArray($child);
103
+ }
104
+
105
+ return $result;
106
+ }
107
+
108
+ public function _remove_category_children($categories = array())
109
+ {
110
+ if(!empty($categories))
111
+ {
112
+ foreach($categories as $key => $category)
113
+ {
114
+ $categories[$key]['children'] = count($category['children']);
115
+ }
116
+ }
117
+ return $categories;
118
+ }
119
+
120
+ public function _make_tree_to_list($categories = null, $category_result = array())
121
+ {
122
+ if(!empty($categories))
123
+ {
124
+ foreach($categories as $category)
125
+ {
126
+ $category_result[] = $category;
127
+ if(count($category['children']) > 0)
128
+ {
129
+ $category_result = $this->_make_tree_to_list($category['children'], $category_result);
130
+ }
131
+ }
132
+ }
133
+ return $category_result;
134
+ }
135
+
136
+ public function _getProductCountForCategory($category)
137
+ {
138
+ $product_total=0;
139
+ $storeId = $this->_getStoreId();
140
+ $pCollection = $category->getProductCollection()
141
+ ->addAttributeToSelect('*')
142
+ ->setStoreId($storeId)
143
+ ->addFinalPrice();
144
+
145
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($pCollection);
146
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($pCollection);
147
+ $pCollection->addUrlRewrite(0);
148
+
149
+ $product_total = $pCollection->getSize();
150
+ return $product_total;
151
+ }
152
+
153
+ public function getCatrgories()
154
+ {
155
+ $categoriesTree = $this->successStatus();
156
+ $categoriesTree['data']['categories'] = $this->_categoryTreeList();
157
+ return $categoriesTree;
158
+ }
159
+
160
+ public function productList($data)
161
+ {
162
+ $storeId = $this->_getStoreId();
163
+
164
+ $pCollection = Mage::getModel('catalog/product')->getCollection()
165
+ ->addAttributeToSelect('*')
166
+ ->addAttributeToFilter('status', '1')
167
+ ->addAttributeToFilter('visibility', '4')
168
+ ->setStoreId($storeId)
169
+ ->addFinalPrice();
170
+
171
+ if($data['category_id'] != '')
172
+ {
173
+ $pCollection->joinField('category_id',
174
+ 'catalog/category_product_index',
175
+ 'category_id',
176
+ 'product_id=entity_id',
177
+ "{{table}}.store_id='".$storeId."' AND {{table}}.visibility IN (4) AND {{table}}.category_id = '".$data['category_id']."'",
178
+ 'INNER');
179
+ //->addAttributeToFilter('category_id', array('in' => $data['category_id']));
180
+ }
181
+
182
+ if($data['q'] != '')
183
+ {
184
+ $pCollection = $this->getCatalogSearch($data);
185
+ }
186
+ //echo '<pre>';print_r($data);exit;
187
+ if(!empty($data['filter']))
188
+ {
189
+ $filterData = array();
190
+ $filter = (string)$data['filter'];
191
+ if(!empty($filter)):
192
+ $filter = explode('&', $filter);
193
+ if(!empty($filter)):
194
+ foreach($filter as $fdata):
195
+ $explode = explode('=', $fdata);
196
+ if(count($explode) == 2):
197
+ if(array_key_exists($explode[0], $filterData))
198
+ $filterData[$explode[0]][] = $explode[1];
199
+ else
200
+ $filterData[$explode[0]] = array($explode[1]);
201
+ endif;
202
+ endforeach;
203
+ endif;
204
+ endif;
205
+
206
+ if(!empty($filterData)):
207
+ foreach($filterData as $fkey => $fdata):
208
+ if(count($fdata) == 1):
209
+ $filterData[$fkey] = $fdata[0];
210
+ endif;
211
+ endforeach;
212
+ endif;
213
+ $data['filter'] = $filterData;
214
+ //print_r($filterData);exit;
215
+ if(!empty($data['filter'])):
216
+ //$pCollection->addAttributeToSelect('*');
217
+ foreach($data['filter'] as $key => $value)
218
+ {
219
+ if(is_array($value))
220
+ {
221
+ //print_r($key);exit;
222
+ if($key == "price")
223
+ {
224
+ foreach($value as $option)
225
+ {
226
+ $option = explode("-",$option);
227
+ $option = explode("-",$value);
228
+ if($option[0] == '') $option[0] = 0;
229
+ if($option[1] == '') $option[1] = 100000000;
230
+ $pCollection->addAttributeToFilter($key,array('from'=>$option[0],'to'=>$option[1]));
231
+ }
232
+ }
233
+ else
234
+ {
235
+ $optionArray = array();
236
+ foreach($value as $option)
237
+ {
238
+ //$pCollection->addAttributeToFilter($key,$option);
239
+ $optionArray[] = array('attribute'=> $key, 'finset'=> $option);
240
+ //echo $key . ":" . $option;exit;
241
+ }
242
+ $pCollection->addAttributeToFilter($optionArray);
243
+ }
244
+ }
245
+ else
246
+ {
247
+ if($key == "price")
248
+ {
249
+ //foreach($value as $option)
250
+ {
251
+ //$option = explode("-",$option);
252
+ $option = explode("-",$value);
253
+ if($option[0] == '') $option[0] = 0;
254
+ if($option[1] == '') $option[1] = 100000000;
255
+ $pCollection->addAttributeToFilter($key,array('from'=>$option[0],'to'=>$option[1]));
256
+ }
257
+ }
258
+ else{
259
+ //print_r(array($key, $value));exit;
260
+ $value = (int)$value;
261
+ //$pCollection->addAttributeToFilter($key,array("finset"=>$value));
262
+ $pCollection->joinField($key.'_idx',
263
+ 'catalog_product_index_eav',
264
+ null,
265
+ 'entity_id=entity_id',
266
+ "{{table}}.store_id='".$storeId."' AND {{table}}.value = '".$value."'",
267
+ 'INNER');
268
+ //$pCollection->addAttributeToFilter('color', 27);
269
+ /*
270
+ $pCollection->addAttributeToFilter(
271
+ array(
272
+ array('attribute' => 'color', 'null' => true),
273
+ array('attribute' => 'color', 'in' => array(27)),
274
+ ),
275
+ '',
276
+ 'INNER'
277
+ );
278
+ */
279
+ //$pCollection->addFieldToFilter($key,array('eq' => $option));
280
+ }
281
+ }
282
+ }
283
+ endif;
284
+ }
285
+ //echo $pCollection->getSelect()->__toString();exit;
286
+ switch ($data['order'])
287
+ {
288
+ case "price-l-h":
289
+ $pCollection->setOrder('price', 'asc');
290
+ break;
291
+ case "price-h-l":
292
+ $pCollection->setOrder('price', 'desc');
293
+ break;
294
+ case "rating-h-l":
295
+ $pCollection->joinField('rating_score',
296
+ 'review_entity_summary',
297
+ 'rating_summary',
298
+ 'entity_pk_value=entity_id',
299
+ array('entity_type'=>1, 'store_id'=> Mage::app()->getStore()->getId()),
300
+ 'left'
301
+ );
302
+ $pCollection->setOrder('rating_score', 'desc');
303
+ break;
304
+ case "name-a-z":
305
+ $pCollection->setOrder('name', 'asc');
306
+ break;
307
+ case "name-z-a":
308
+ $pCollection->setOrder('name', 'desc');
309
+ break;
310
+ case "newest_first":
311
+ $pCollection->setOrder('entity_id', 'desc');
312
+ break;
313
+ default:
314
+ $pCollection->setOrder('ordered_qty', 'asc'); //most_popular
315
+ }
316
+
317
+ if(isset($data['category_id']) && !empty($data['category_id'])):
318
+ $category = Mage::getModel("catalog/category")->load($data['category_id']);
319
+ $layer = Mage::getModel("catalog/layer");
320
+ $layer->setCurrentCategory($category);
321
+ $attributes = $layer->getFilterableAttributes();
322
+ $filter = array(
323
+ "message" => "",
324
+ "data" => array()
325
+ );
326
+
327
+ try{
328
+ if(count($attributes)>0)
329
+ {
330
+ foreach ($attributes as $attribute)
331
+ {
332
+ if ($attribute->getAttributeCode() == 'price') {
333
+ $filterBlockName = 'catalog/layer_filter_price';
334
+ } elseif ($attribute->getBackendType() == 'decimal') {
335
+ $filterBlockName = 'catalog/layer_filter_decimal';
336
+ } else {
337
+ $filterBlockName = 'catalog/layer_filter_attribute';
338
+ }
339
+
340
+ $result = Mage::getBlockSingleton($filterBlockName)->setLayer($layer)->setAttributeModel($attribute)->init();
341
+ if($result->getItems())
342
+ {
343
+ $attributeCode = (string)$attribute->getAttributeCode();
344
+ $fd = array();
345
+ $fd['attributeCode'] = $attributeCode;
346
+ $fd['type'] = $attribute->getFrontendInput();
347
+ $fd['label'] = $attribute->getFrontendLabel();
348
+ $fd['code'] = $attribute->getId();
349
+ $j = 0;
350
+ foreach($result->getItems() as $option)
351
+ {
352
+ $fd['options'][$j]['label'] = $option->getLabel();
353
+ $fd['options'][$j]['value'] = $option->getValue();
354
+ $fd['options'][$j]['count'] = $option->getCount();
355
+ $j++;
356
+ }
357
+ $filter['data'][] = $fd;
358
+ }
359
+ }
360
+ }
361
+ }
362
+ catch(Exception $e){
363
+ $filter['message'] = $e->getMessage();
364
+ }
365
+ endif;
366
+
367
+ $pCollection->addUrlRewrite(0);
368
+
369
+ if(!isset($data['page']) || $data['page']=="") $data['page']=1;
370
+ if(!isset($data['limit']) || $data['limit']=="") $data['limit']=20;
371
+ $data['offset'] = ($data['page']-1) * $data['limit'];
372
+
373
+ $productList = array();
374
+ $product_total = $pCollection->getSize();
375
+ $pCollection->setPageSize($data['offset'] + $data['limit']);
376
+
377
+ if ($data['offset'] > $product_total)
378
+ return $this->errorStatus(array('opps! No information found'));
379
+ $check_limit = 0;
380
+ $check_offset = 0;
381
+
382
+ foreach ($pCollection as $product) {
383
+ if (++$check_offset <= $data['offset']) {
384
+ continue;
385
+ }
386
+ if (++$check_limit > $data['limit'])
387
+ break;
388
+
389
+ $stock = true;
390
+ if (version_compare(Mage::getVersion(), '1.4.0.1', '=') === true) {
391
+ if (!$product->isSaleable()) $stock = false;
392
+ }
393
+
394
+ $info_product = array(
395
+ 'product_id' => $product->getId(),
396
+ 'entity_id' => $product->getId(),
397
+ 'name' => $product->getName(),
398
+ 'type_id' => $product->getTypeId(),
399
+ 'price' => $product->getPrice(),
400
+ 'special_price' => $product->getFinalPrice(),
401
+ 'stock_status' => $stock,
402
+ 'reviews' => $ratings[5],
403
+ 'product_small_image_url' => Mage::helper('catalog/image')->init($product, 'small_image')->resize(300)->__toString(),
404
+ 'product_image_url' => Mage::helper('catalog/image')->init($product, 'small_image')->resize(300)->__toString(),
405
+ //'product_image' => $this->getImageProduct($product, null, $width, $height),
406
+ //'manufacturer_name' => $product->getAttributeText('manufacturer') == false ? '' : $product->getAttributeText('manufacturer'),
407
+ 'product_reviews' => $this->_getProductReviews($product->getId())
408
+ );
409
+
410
+ $prices = $this->_productPrices($product);
411
+ //---- add bundle and grouped price into product info array
412
+ if ($prices) {
413
+ $info_product = array_merge($info_product, $prices);
414
+ }
415
+
416
+ $requestObj = Mage::app()->getFrontController()->getRequest();
417
+ $event_name = $requestObj->getRequestedRouteName() . '_' .
418
+ $requestObj->getRequestedControllerName() . '_' .
419
+ $requestObj->getRequestedActionName();
420
+
421
+ $name_of_event= $event_name. '_product_detail';
422
+ //$event_name = $this->getControllerName() . '_product_detail';
423
+ $event_value = array(
424
+ 'object' => $this,
425
+ 'product' => $product
426
+ );
427
+ Mage::dispatchEvent($name_of_event, $event_value);
428
+ $productList[] = $info_product;
429
+ }
430
+
431
+ $information = $this->successStatus();
432
+ $information['message'] = array($product_total);
433
+ $information['data']['products'] = $productList;
434
+ $information['data']['filters'] = $filter;
435
+ $information['data']['product_count'] = $product_total;
436
+
437
+ return $information;
438
+ }
439
+
440
+ public function getRandomProducts($randomCount = 10)
441
+ {
442
+ $storeId = $this->_getStoreId();
443
+ $pCollection = Mage::getModel('catalog/product')->getCollection()
444
+ ->addAttributeToSelect('*')
445
+ ->addAttributeToFilter('status', '1')
446
+ ->addAttributeToFilter('visibility', '4')
447
+ ->setStoreId($storeId)
448
+ ->addFinalPrice();
449
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($pCollection);
450
+ $pCollection->getSelect()->order('RAND()');
451
+ $pCollection->getSelect()->limit($randomCount);
452
+
453
+ $products = array();
454
+ if(!empty($pCollection)){
455
+ foreach ($pCollection as $key => $_product) {
456
+ $row = array();
457
+ $row['entity_id'] = $_product->getId();
458
+ $row['entity_type_id'] = $_product->getEntityTypeId();
459
+ $row['attribute_set_id'] = $_product->getAttributeSetId();
460
+ $row['type_id'] = $_product->getTypeId();
461
+ $row['sku'] = $_product->getSku();
462
+ $row['name'] = $_product->getName();
463
+ $row['price'] = $_product->getPrice();
464
+ $row['final_price'] = $_product->getFinalPrice();
465
+ $row['special_price'] = $_product->getSpecialPrice();
466
+ $row['is_salable'] = $_product->getIsSalable();
467
+ $row['status'] = $_product->getStatus();
468
+ $row['product_thumbnail_url'] = Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(200)->__toString();
469
+ $products[] = $row;
470
+ }
471
+ }
472
+
473
+ return $products;
474
+ }
475
+
476
+ function getProductRatingStar($productId)
477
+ {
478
+ $reviews = Mage::getModel('review/review')
479
+ ->getResourceCollection()
480
+ ->addStoreFilter(Mage::app()->getStore()->getId())
481
+ ->addEntityFilter('product', $productId)
482
+ ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
483
+ ->setDateOrder()
484
+ ->addRateVotes();
485
+
486
+ $starReview = array();
487
+ $starReview[0] = 0;
488
+ $starReview[1] = 0;
489
+ $starReview[2] = 0;
490
+ $starReview[3] = 0;
491
+ $starReview[4] = 0;
492
+ $starReview[5] = 0;
493
+ if (count($reviews) > 0) {
494
+ foreach ($reviews->getItems() as $review) {
495
+ $starReview[5]++;
496
+ $tmp2 = 0;
497
+ foreach ($review->getRatingVotes() as $vote) {
498
+ $tmp2 += ($vote->getPercent() / 20);
499
+ }
500
+ $tmp1 = (int) ($tmp2 / count($review->getRatingVotes()));
501
+ $tmp3 = $tmp2 % 3;
502
+ $tmp1 = $tmp3 < 5 ? $tmp1 : $tmp1 + 1;
503
+ if ($tmp1 == 1) {
504
+ $starReview[0]++;
505
+ } elseif ($tmp1 == 2) {
506
+ $starReview[1]++;
507
+ } elseif ($tmp1 == 3) {
508
+ $starReview[2]++;
509
+ } elseif ($tmp1 == 4) {
510
+ $starReview[3]++;
511
+ } elseif ($tmp1 == 5) {
512
+ $starReview[4]++;
513
+ } elseif ($tmp1 == 0) {
514
+ $starReview[5]--;
515
+ }
516
+ }
517
+ }
518
+ return $starReview;
519
+ }
520
+
521
+ /**
522
+ * added by yash
523
+ * for getting product reviews
524
+ */
525
+ function _getProductReviews($productId)
526
+ {
527
+ $reviews = Mage::getModel('review/review')
528
+ ->getResourceCollection()
529
+ ->addStoreFilter(Mage::app()->getStore()->getId())
530
+ ->addEntityFilter('product', $productId)
531
+ ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
532
+ ->setDateOrder()
533
+ ->addRateVotes();
534
+
535
+ $reviews_array = array();
536
+ $ratings = array();
537
+
538
+ if (count($reviews) > 0) {
539
+ foreach ($reviews->getItems() as $review) {
540
+ $reviewData = $review->getData();
541
+ $averageUserVoting = 0;
542
+
543
+ $votes = Mage::getModel('rating/rating_option_vote')
544
+ ->getResourceCollection()
545
+ ->setReviewFilter($reviewData['review_id'])
546
+ ->setStoreFilter(Mage::app()->getStore()->getId())
547
+ ->load();
548
+ $votesData = $votes->getData();
549
+ if(!empty($votesData)):
550
+ foreach($votesData as $vdata):
551
+ $averageUserVoting += $vdata['value'];
552
+ $ratings[] = $vdata['value'];
553
+ endforeach;
554
+ $averageUserVoting = round(($averageUserVoting / count($votesData)), 2);
555
+ endif;
556
+ $reviewData['votes'] = $votesData;
557
+ $reviewData['averageUserVoting'] = $averageUserVoting;
558
+
559
+ //$reviews_array[] = $review->getData();
560
+ $reviews_array[] = $reviewData;
561
+ }
562
+ }
563
+ $averageRating = round((array_sum($ratings)/count($ratings)),2);
564
+
565
+ $result_array = array(
566
+ 'reviewsCount' => count($reviews),
567
+ 'averageRating' => $averageRating,
568
+ 'reviews' => $reviews_array,
569
+ );
570
+ return $result_array;
571
+ }
572
+
573
+ public function productInfo($data)
574
+ {
575
+ $product_id = $data['product_id'];
576
+ $product = Mage::getModel('catalog/product')->load($product_id);
577
+ if (!$product->getId()) {
578
+ $information = $this->errorStatus("Product_Does_Not_Exists");
579
+ return $information;
580
+ }
581
+
582
+ $option = $this->_getAllProductOptions($product);
583
+ $prices = $this->_productPrices($product);
584
+
585
+ $images=array();
586
+ $i=0;
587
+ foreach ($product->getMediaGallery('images') as $image) {
588
+ if ($image['disabled']) {
589
+ continue;
590
+ }
591
+ $images[$i]['full_image_url'] = Mage::helper('catalog/image')->init($product, 'thumbnail',$image['file'])->resize(300)->__toString();
592
+ $images[$i]['id'] = isset($image['value_id']) ? $image['value_id'] : null;
593
+ $images[$i]['position'] = $image['position'];
594
+ $images[$i]['label'] = $image['label'];
595
+ $i++;
596
+ }
597
+ if(empty($images)){
598
+ $images[] = array(
599
+ 'full_image_url' => Mage::helper('catalog/image')->init($product, 'image')->resize(200)->__toString(),
600
+ 'id' => '0',
601
+ 'position' => '1',
602
+ 'label' => 'Base Image',
603
+ );
604
+ }
605
+
606
+ $stock = true;
607
+ if (version_compare(Mage::getVersion(), '1.4.0.1', '=') === true) {
608
+ if (!$product->isSaleable()) $stock = false;
609
+ }
610
+
611
+ $productInfo = array(
612
+ 'product_id' => $product_id,
613
+ 'name' => $product->getName(),
614
+ 'url' => $product->getProductUrl(),
615
+ 'type' => $product->getTypeId(),
616
+ 'attributeSetName' => Mage::getModel("eav/entity_attribute_set")->load($product->getAttributeSetId())->getAttributeSetName(),
617
+ 'price' => $product->getPrice(),
618
+ 'special_price' => $product->getFinalPrice(),
619
+ 'description' => Mage::helper('catalog/output')->productAttribute($product, $product->getDescription(), 'description'),
620
+ 'short_description' => Mage::helper('catalog/output')->productAttribute($product, $product->getShortDescription(), 'short_description'),
621
+ 'max_qty' => (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty(),
622
+ 'product_images' => $images,
623
+ 'product_thumbnail_url' => Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(200)->__toString(),
624
+ 'stock_status' => $stock,
625
+ 'options' => $option,
626
+ 'product_reviews' => $this->_getProductReviews($product_id)
627
+ );
628
+
629
+ if ($prices) {
630
+ $productInfo = array_merge($productInfo, $prices);
631
+ }
632
+
633
+ $productInfo = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/custom'))->getCustomProductDetailFields($product, $productInfo);
634
+
635
+ $requestObj = Mage::app()->getFrontController()->getRequest();
636
+ $event_name = $requestObj->getRequestedRouteName() . '_' .
637
+ $requestObj->getRequestedControllerName() . '_' .
638
+ $requestObj->getRequestedActionName();
639
+
640
+ $name_of_event= $event_name. '_product_detail';
641
+
642
+ $event_value = array(
643
+ 'object' => $this,
644
+ 'product' => $product
645
+ );
646
+ Mage::dispatchEvent($name_of_event, $event_value);
647
+ $information = '';
648
+
649
+ if (count($productInfo)) {
650
+ if(isset($data['addRecentViews']) && $data['addRecentViews'] == '1'){
651
+ Mage::dispatchEvent('catalog_controller_product_view', array('product' => $product));
652
+ Mage::getSingleton('catalog/session')->setLastViewedProductId($product->getId());
653
+ }
654
+ $information = $this->successStatus();
655
+ $information['data']['product_details'] = $productInfo;
656
+ $information['data']['related_products'] = $this->getRelatedProducts($product);
657
+ $information['data']['product_details']['ratingOptions'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/review'))->_getRatingOptions(array(
658
+ "product_id" => $product_id,
659
+ ));
660
+ if(isset($data['addRecentViews']) && $data['addRecentViews'] == '1'){
661
+ $information['data']['recentlyViewed'] = $this->getRecentlyViewedProducts();
662
+ }
663
+ } else {
664
+ $information = $this->errorStatus();
665
+ }
666
+ return $information;
667
+ }
668
+
669
+ public function _productPrices($product)
670
+ {
671
+ // ----- Get Price for bundle and ground products
672
+ $type = $product->getTypeId();
673
+ switch ($type) {
674
+ case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE :
675
+ /*
676
+ ----- Bundle price
677
+ */
678
+ $prices = array();
679
+ $productPrice = $product->getPriceModel();
680
+ if (version_compare(Mage::getVersion(), '1.4.2.0', '>=') === true) {
681
+ list($_minimalPriceTax, $_maximalPriceTax) = $productPrice->getTotalPrices($product, null, null, false);
682
+ }else{
683
+ list($_minimalPriceTax, $_maximalPriceTax) = $productPrice->getPrices($product, null, null, false);
684
+ }
685
+
686
+ if ($product->getPriceType() == 1) {
687
+ $_weeeTaxAmount = Mage::helper('weee')->getAmount($product);
688
+ $_weeeTaxAmountInclTaxes = $_weeeTaxAmount;
689
+ if (Mage::helper('weee')->isTaxable()) {
690
+ $_attributes = Mage::helper('weee')->getProductWeeeAttributesForRenderer($product, null, null, null, true);
691
+ $_weeeTaxAmountInclTaxes = Mage::helper('weee')->getAmountInclTaxes($_attributes);
692
+ }
693
+ if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($product, array(0, 1, 4))) {
694
+ $_minimalPriceTax += $_weeeTaxAmount;
695
+ $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes;
696
+ }
697
+ if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($product, 2)) {
698
+ $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes;
699
+ }
700
+
701
+ }
702
+ $prices = array(
703
+ 'min_price' => $_minimalPriceTax,
704
+ 'max_price' => $_maximalPriceTax,
705
+ );
706
+
707
+ // --- ENd Budle price
708
+ break;
709
+ case Mage_Catalog_Model_Product_Type::TYPE_GROUPED :
710
+ /*
711
+ ----- Grouped price
712
+ */
713
+ $prices = array();
714
+ $_taxHelper = Mage::helper('tax');
715
+ $_minimalPriceValue = $product->getMinimalPrice();
716
+ //$_exclTax = $_taxHelper->getPrice($product, $_minimalPriceValue);
717
+ //$_inclTax = $_taxHelper->getPrice($product, $_minimalPriceValue, true);
718
+ //print_r($product->getData());exit;
719
+
720
+ /* custom code added for getting minimum and maximum price for grouped product */
721
+ $groupedProduct = $product;
722
+ $aProductIds = $groupedProduct->getTypeInstance()->getChildrenIds($groupedProduct->getId());
723
+
724
+ $group_prices = array();
725
+ foreach ($aProductIds as $ids) {
726
+ foreach ($ids as $id) {
727
+ $aProduct = Mage::getModel('catalog/product')->load($id);
728
+ $group_prices[] = $aProduct->getPriceModel()->getPrice($aProduct);
729
+ }
730
+ }
731
+ if(!empty($group_prices))
732
+ {
733
+ $prices = array(
734
+ 'min_price' => min($group_prices),
735
+ 'max_price' => max($group_prices)
736
+ );
737
+ }
738
+
739
+ break;
740
+ // -----END -- Grouped Price
741
+ }
742
+ // ----- end Price
743
+ return $prices;
744
+ }
745
+
746
+ public function getAttributes($product)
747
+ {
748
+ $result = array();
749
+ $attributes = $product->getAttributes();
750
+ foreach ($attributes as $attribute) {
751
+ if ($attribute->getIsVisibleOnFront()) {
752
+ // Zend_debug::dump(get_class_methods($attribute));die();
753
+ $result[] = array(
754
+ 'title' => $attribute->getFrontendLabel(),
755
+ 'value' => $attribute->getFrontend()->getValue($product),
756
+ );
757
+ }
758
+ }
759
+ return $result;
760
+ }
761
+
762
+ public function getProductOptions($product)
763
+ {
764
+ $type = $product->getTypeId();
765
+ switch ($type) {
766
+ case Mage_Catalog_Model_Product_Type::TYPE_SIMPLE:
767
+ return $this->getSimpleProductOptions($product);
768
+ break;
769
+ case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE :
770
+ return $this->getBundleProductOptions($product);
771
+ break;
772
+ case Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE :
773
+ return $this->getConfigurableProductOptions($product);
774
+ break;
775
+ case Mage_Catalog_Model_Product_Type::TYPE_GROUPED :
776
+ return $this->getGroupedProductOptions($product);
777
+ break;
778
+ case Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL :
779
+ return $this->getVirtualProductOptions($product);
780
+ break;
781
+ }
782
+ }
783
+
784
+ public function _getAllProductOptions($product)
785
+ {
786
+ $type = $product->getTypeId();
787
+
788
+ $options = array(
789
+ 'product_options' => $this->getSimpleProductOptions($product),
790
+ 'product_super_attributes' => array(),
791
+ 'super_group' => array(),
792
+ 'link' => array(),
793
+ 'sample_links' => array(),
794
+ 'bundle' => array(),
795
+ 'virtual' => array(),
796
+ );
797
+
798
+ switch ($type) {
799
+ case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE :
800
+ $options['bundle'] = $this->getBundleProductOptions($product);
801
+ break;
802
+ case Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE :
803
+ $options['product_super_attributes'] = $this->getConfigurableProductOptions($product);
804
+ break;
805
+ case 'downloadable' :
806
+ $links = $this->getDownloadableLinks($product);
807
+ $options['link'] = $links['links'];
808
+ $options['sample_links'] = $links['samples'];
809
+ break;
810
+ case Mage_Catalog_Model_Product_Type::TYPE_GROUPED :
811
+ $options['super_group'] = $this->getGroupedProductOptions($product);
812
+ break;
813
+ case Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL :
814
+ $options['virtual'] = $this->getVirtualProductOptions($product);
815
+ break;
816
+ }
817
+
818
+ return $options;
819
+ }
820
+
821
+ public function getSimpleProductOptions($product)
822
+ {
823
+ $options=array();
824
+ foreach ($product->getOptions() as $o) {
825
+ $_tmpOptions = $o->getData();
826
+ if($o->getGroupByType() == Mage_Catalog_Model_Product_Option::OPTION_GROUP_TEXT)
827
+ {
828
+ $_tmpTextType= array(
829
+ 'price' => $o->getPrice(true),
830
+ 'price_type' => $o->getPriceType(),
831
+ 'sku' => $o->getSku(),
832
+ 'max_characters' => $o->getMaxCharacters(),
833
+ );
834
+ $_tmpOptions = array_merge($_tmpOptions, $_tmpTextType);
835
+ }
836
+ if($o->getGroupByType() == Mage_Catalog_Model_Product_Option::OPTION_GROUP_DATE)
837
+ {
838
+ $_tmpTextType= array(
839
+ 'price' => $o->getPrice(true),
840
+ 'price_type' => $o->getPriceType(),
841
+ 'sku' => $o->getSku(),
842
+ );
843
+ $_tmpOptions = array_merge($_tmpOptions, $_tmpTextType);
844
+ }
845
+ if($o->getGroupByType()== Mage_Catalog_Model_Product_Option::OPTION_GROUP_SELECT)
846
+ {
847
+ $values = $o->getValues();
848
+ $_tmp['options']= array();
849
+ foreach ($values as $v) {
850
+ $_tmp['options'][] = $v->getData();
851
+ }
852
+ $_tmpOptions = array_merge($_tmpOptions, $_tmp);
853
+ }
854
+
855
+ if($o->getGroupByType()== Mage_Catalog_Model_Product_Option::OPTION_GROUP_FILE)
856
+ {
857
+ $_tmpTextType= array(
858
+ 'file_extension' => $o->getFileExtension(),
859
+ 'image_size_x' => $o->getImageSizeX(),
860
+ 'image_size_y' => $o->getImageSizeY(),
861
+ );
862
+ $_tmpOptions = array_merge($_tmpOptions, $_tmpTextType);
863
+ }
864
+ $options[]=$_tmpOptions;
865
+ }
866
+ return $options;
867
+ }
868
+
869
+ public function getBundleProductOptions($product)
870
+ {
871
+ $typeInstance = $product->getTypeInstance(true);
872
+ $typeInstance->setStoreFilter($product->getStoreId(), $product);
873
+ $optionCollection = $typeInstance->getOptionsCollection($product);
874
+
875
+ $selectionCollection = $typeInstance->getSelectionsCollection(
876
+ $typeInstance->getOptionsIds($product), $product
877
+ );
878
+
879
+ $attributes = $optionCollection->appendSelections($selectionCollection, false, false);
880
+
881
+ $options = array();
882
+ //$coreHelper = Mage::helper('core');
883
+ foreach ($attributes as $_attribute) {
884
+ $_tmpOptions = array (
885
+ 'option_id' => $_attribute->getId(),
886
+ 'option_title' => $_attribute->getTitle(),
887
+ 'position' => $_attribute->getPosition(),
888
+ 'required' => $_attribute->getRequired(),
889
+ 'option_type' => $_attribute->getType(),
890
+ );
891
+ $_tmp['options'] = array();
892
+ foreach ($_attribute->getSelections() as $_selection) {
893
+ $_tmp['options'][] = array (
894
+ 'option_id' => $_selection->getSelectionId(),
895
+ 'option_value' => $_selection->getName(),
896
+ 'option_selection_qty' => $_selection->getSelectionQty(),
897
+ 'option_selection_can_change_qty' => $_selection->getSelectionCanChangeQty(),
898
+ 'option_position' => $_selection->getPosition(),
899
+ 'option_is_default' => $_selection->getIsDefault(),
900
+ 'option_price' => $product->getPriceModel()->getSelectionPreFinalPrice($product, $_selection, 1),
901
+ );
902
+ }
903
+ $_tmpOptions = array_merge($_tmpOptions, $_tmp);
904
+ $options[] = $_tmpOptions;
905
+ }
906
+ return $options;
907
+ }
908
+
909
+ public function getConfigurableProductOptions($product)
910
+ {
911
+ $options = array();
912
+ $currentProduct = $product;
913
+ $attributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
914
+
915
+ if (!$this->hasAllowProducts()) {
916
+ $products = array();
917
+ $skipSaleableCheck = true;
918
+ if (version_compare(Mage::getVersion(), '1.7.0.0', '>=') === true) {
919
+ $skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck();
920
+ }
921
+ $allProducts = $product->getTypeInstance(true)
922
+ ->getUsedProducts(null, $product);
923
+ foreach ($allProducts as $_product) {
924
+ if ($_product->isSaleable() || $skipSaleableCheck) {
925
+ $products[] = $_product;
926
+ }
927
+ }
928
+ $this->setAllowProducts($products);
929
+ }
930
+ $products = $this->getData('allow_products');
931
+ //return $products;
932
+
933
+ $list_value = array();
934
+ $information = array();
935
+ foreach ($products as $_product) {
936
+ $productId = $_product->getId();
937
+ foreach ($attributes as $attribute) {
938
+ $productAttribute = $attribute->getProductAttribute();
939
+ $productAttributeId = $productAttribute->getId();
940
+ $attributeValue = $_product->getData($productAttribute->getAttributeCode());
941
+ // if (!in_array($attributeValue, $list_value))
942
+ // $list_value[] = $attributeValue;
943
+ if (!isset($options[$productAttributeId])) {
944
+ $options[$productAttributeId] = array();
945
+ }
946
+
947
+ if (!isset($options[$productAttributeId][$attributeValue])) {
948
+ $options[$productAttributeId][$attributeValue] = array();
949
+ }
950
+ $options[$productAttributeId][$attributeValue][] = $productId;
951
+ }
952
+ }
953
+
954
+ foreach ($attributes as $attribute) {
955
+ $attInfo = $attribute->getData();
956
+ $attributeId = $attribute->getProductAttribute()->getId();
957
+ if(!empty($attInfo['prices']))
958
+ {
959
+ foreach($attInfo['prices'] as $p_key => $p)
960
+ {
961
+ $productsIndex = array();
962
+ if (isset($options[$attributeId][$p['value_index']])) {
963
+ $productsIndex = $options[$attributeId][$p['value_index']];
964
+ }
965
+ $attInfo['prices'][$p_key]['dependence_option_ids'] = $productsIndex;
966
+ }
967
+ }
968
+ $information[] = $attInfo;
969
+ }
970
+ return $information;
971
+ }
972
+
973
+ public function getDownloadableLinks($product)
974
+ {
975
+ $linkArr = array();
976
+ $links = $product->getTypeInstance(true)->getLinks($product);
977
+ foreach ($links as $item) {
978
+ $tmpLinkItem = array(
979
+ 'link_id' => $item->getId(),
980
+ 'title' => $item->getTitle(),
981
+ 'price' => $item->getPrice(),
982
+ 'number_of_downloads' => $item->getNumberOfDownloads(),
983
+ 'is_shareable' => $item->getIsShareable(),
984
+ 'link_url' => $item->getLinkUrl(),
985
+ 'link_type' => $item->getLinkType(),
986
+ 'sample_file' => $item->getSampleFile(),
987
+ 'sample_url' => $item->getSampleUrl(),
988
+ 'sample_type' => $item->getSampleType(),
989
+ 'sort_order' => $item->getSortOrder()
990
+ );
991
+ $file = Mage::helper('downloadable/file')->getFilePath(
992
+ Mage_Downloadable_Model_Link::getBasePath(), $item->getLinkFile()
993
+ );
994
+
995
+ if ($item->getLinkFile() && !is_file($file)) {
996
+ Mage::helper('core/file_storage_database')->saveFileToFilesystem($file);
997
+ }
998
+
999
+ if ($item->getLinkFile() && is_file($file)) {
1000
+ $name = Mage::helper('downloadable/file')->getFileFromPathFile($item->getLinkFile());
1001
+ $tmpLinkItem['file_save'] = array(
1002
+ array(
1003
+ 'file' => $item->getLinkFile(),
1004
+ 'name' => $name,
1005
+ 'size' => filesize($file),
1006
+ 'status' => 'old'
1007
+ ));
1008
+ }
1009
+ $sampleFile = Mage::helper('downloadable/file')->getFilePath(
1010
+ Mage_Downloadable_Model_Link::getBaseSamplePath(), $item->getSampleFile()
1011
+ );
1012
+ if ($item->getSampleFile() && is_file($sampleFile)) {
1013
+ $tmpLinkItem['sample_file_save'] = array(
1014
+ array(
1015
+ 'file' => $item->getSampleFile(),
1016
+ 'name' => Mage::helper('downloadable/file')->getFileFromPathFile($item->getSampleFile()),
1017
+ 'size' => filesize($sampleFile),
1018
+ 'status' => 'old'
1019
+ ));
1020
+ }
1021
+ if ($item->getNumberOfDownloads() == '0') {
1022
+ $tmpLinkItem['is_unlimited'] = 1;
1023
+ }
1024
+ if ($product->getStoreId() && $item->getStoreTitle()) {
1025
+ $tmpLinkItem['store_title'] = $item->getStoreTitle();
1026
+ }
1027
+ /*
1028
+ if ($product->getStoreId() && Mage::helper('downloadable')->getIsPriceWebsiteScope()) {
1029
+ $tmpLinkItem['website_price'] = $item->getWebsitePrice();
1030
+ }
1031
+ */
1032
+ $linkArr[] = $tmpLinkItem;
1033
+ }
1034
+ unset($item);
1035
+ unset($tmpLinkItem);
1036
+ unset($links);
1037
+
1038
+ $samples = $product->getTypeInstance(true)->getSamples($product)->getData();
1039
+ return array('links' => $linkArr, 'samples' => $samples);
1040
+ }
1041
+
1042
+ public function getGroupedProductOptions($product)
1043
+ {
1044
+ $options = array();
1045
+ $associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
1046
+ $_minprice = NULL;
1047
+ if (count($associatedProducts)) {
1048
+ foreach ($associatedProducts as $product) {
1049
+ if ($product->isSaleable()) {
1050
+ if ($_minprice == NULL) {
1051
+ $_minprice = $product->getFinalPrice();
1052
+ } else {
1053
+ if ($_minprice > $product->getFinalPrice())
1054
+ $_minprice = $product->getFinalPrice();
1055
+ }
1056
+ $options[] = array(
1057
+ 'option_id' => $product->getId(),
1058
+ 'option_value' => $product->getName(),
1059
+ 'option_title' => $product->getName(),
1060
+ 'option_type' => 'text',
1061
+ 'option_price' => $product->getFinalPrice(),
1062
+ );
1063
+ }
1064
+ }
1065
+ }
1066
+
1067
+ return $options;
1068
+ }
1069
+
1070
+ public function getVirtualProductOptions($product)
1071
+ {
1072
+ return array();
1073
+ }
1074
+
1075
+ public function getResizedImage($url, $width, $height = null, $quality = 100)
1076
+ {
1077
+ if (!$url)
1078
+ return false;
1079
+ $imageName = substr(strrchr($url,"/"),1);
1080
+ $imageUrl = Mage::getBaseDir('media').DS."catalog".DS."category".DS.$imageName;
1081
+ if (!is_file( $imageUrl ))
1082
+ return false;
1083
+
1084
+ $imageResized = Mage::getBaseDir('media').DS."catalog".DS."category".DS."cache".DS."cat_resized".DS.$imageName;
1085
+ if (!file_exists($imageResized) && file_exists($imageUrl) || file_exists($imageUrl) && filemtime($imageUrl) > filemtime($imageResized)):
1086
+ $imageObj = new Varien_Image($imageUrl);
1087
+ $imageObj->constrainOnly(true);
1088
+ $imageObj->keepAspectRatio(false);
1089
+ $imageObj->keepFrame(false);
1090
+ $imageObj->quality($quality);
1091
+ $imageObj->resize($width, $height);
1092
+ $imageObj->save($imageResized);
1093
+ endif;
1094
+
1095
+ if(file_exists($imageResized)){
1096
+ $img_url = Mage::getBaseUrl('media' )."catalog/category/cache/cat_resized/".$imageName;
1097
+ return $img_url;
1098
+ }
1099
+ else{
1100
+ return $url;
1101
+ }
1102
+ }
1103
+
1104
+ /**
1105
+ * Added by Yash to get recently viewed products
1106
+ * @param int $data['limit']
1107
+ * 14-10-2014
1108
+ */
1109
+ public function getRecentlyViewedProducts($data = null)
1110
+ {
1111
+ $limit = isset($data['limit'])?$data['limit']:10;
1112
+ $recentlyViewedProducts = Mage::getSingleton('Mage_Reports_Block_Product_Viewed')->setPageSize($limit)->getItemsCollection();
1113
+ $recentlyViewedProductsArray = array();
1114
+ if($recentlyViewedProducts){
1115
+ foreach($recentlyViewedProducts as $row){
1116
+ $productData = $row->getData();
1117
+ $recentlyViewedProductsArray[] = array(
1118
+ "entity_id" => $productData['entity_id'],
1119
+ "entity_type_id" => $productData['entity_type_id'],
1120
+ "attribute_set_id" => $productData['attribute_set_id'],
1121
+ "type_id" => $productData['type_id'],
1122
+ "sku" => $productData['sku'],
1123
+ "price" => $productData['price'],
1124
+ "final_price" => $productData['final_price'],
1125
+ "min_price" => $productData['min_price'],
1126
+ "max_price" => $productData['max_price'],
1127
+ "special_price" => $productData['special_price'],
1128
+ "name" => $productData['name'],
1129
+ "is_salable" => $productData['is_salable'],
1130
+ "status" => $productData['status'],
1131
+ "product_thumbnail_url" => Mage::helper('catalog/image')->init($row, 'thumbnail')->resize(200)->__toString(),
1132
+ );
1133
+ }
1134
+ }
1135
+ return $recentlyViewedProductsArray;
1136
+ }
1137
+
1138
+ public function getRelatedProducts($product)
1139
+ {
1140
+ $website_id = Mage::app()->getWebsite()->getId();
1141
+ $limit = isset($data['limit'])?$data['limit']:5;
1142
+ $relatedProductIds = $product->getRelatedProductIds();
1143
+ $relatedProductsArray = array();
1144
+ if($relatedProductIds)
1145
+ {
1146
+ foreach($relatedProductIds as $id)
1147
+ {
1148
+ $productData = Mage::getModel('catalog/product')->load($id);
1149
+ //if($productData['is_salable']){
1150
+ if($productData->getIsSalable() && $productData->isVisibleInSiteVisibility() && in_array($website_id, $productData->getWebsiteIds())){
1151
+ $row = array(
1152
+ "entity_id" => $productData['entity_id'],
1153
+ "entity_type_id" => $productData['entity_type_id'],
1154
+ "attribute_set_id" => $productData['attribute_set_id'],
1155
+ "type_id" => $productData['type_id'],
1156
+ "sku" => $productData['sku'],
1157
+ "price" => $productData->getPrice(),
1158
+ "final_price" => $productData->getFinalPrice(),
1159
+ "special_price" => $productData->getFinalPrice(),
1160
+ "name" => $productData['name'],
1161
+ "is_salable" => $productData['is_salable'],
1162
+ "status" => $productData['status'],
1163
+ "product_thumbnail_url" => Mage::helper('catalog/image')->init($productData, 'thumbnail')->resize(200)->__toString(),
1164
+ );
1165
+
1166
+ $prices = $this->_productPrices($productData);
1167
+ //---- add bundle and grouped price into product info array
1168
+ if ($prices) {
1169
+ $row = array_merge($row, $prices);
1170
+ }
1171
+
1172
+ $relatedProducts[] = $row;
1173
+ }
1174
+ }
1175
+ }
1176
+
1177
+ return $relatedProducts;
1178
+ }
1179
+
1180
+ public function getAllProducts()
1181
+ {
1182
+ $storeId = $this->_getStoreId();
1183
+ $products = Mage::getModel('catalog/product')->getCollection()
1184
+ ->addAttributeToSelect('*')
1185
+ ->addAttributeToFilter('status', '1')
1186
+ ->setStoreId($storeId);
1187
+
1188
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($products);
1189
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
1190
+ $allProducts = array();
1191
+ if(!empty($products)){
1192
+ foreach ($products as $key => $value) {
1193
+ $row = $value->getData();
1194
+ $row['name'] = $value->getName();
1195
+ $allProducts[] = $row;
1196
+ }
1197
+ }
1198
+ return $allProducts;
1199
+ //return $products->getData();
1200
+ }
1201
+
1202
+ protected function _attachCategoryIcon($categories, $appcode)
1203
+ {
1204
+ $iconCategories = array();
1205
+ $iconCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
1206
+ ->addFieldToFilter('app_code', $appcode)
1207
+ ->addFieldToFilter('setting_code', 'category_icons');
1208
+ if($iconCollection->getSize()){
1209
+ foreach($iconCollection as $iconrow){
1210
+ $row = $iconrow->getData();
1211
+ $row = Mage::helper('mobiadmin')->_jsonUnserialize($row['value']);
1212
+ if(!empty($row)){
1213
+ foreach($row as $cat){
1214
+ $iconCategories[$cat['category_id']] = $cat['mobiicon'];
1215
+ }
1216
+ }
1217
+ }
1218
+ }
1219
+
1220
+ if(!empty($categories)){
1221
+ $baseurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'mobi_category_icons/';
1222
+ foreach($categories as $key => $cat){
1223
+ if(array_key_exists($cat['category_id'], $iconCategories)){
1224
+ if(!empty($iconCategories[$cat['category_id']])){
1225
+ $categories[$key]['mobiicon'] = $iconCategories[$cat['category_id']];
1226
+ $categories[$key]['mobiiconurl'] = Mage::getStoreConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL) . 'MobiSettings/category_svg.php';
1227
+ }
1228
+ else{
1229
+ $categories[$key]['mobiicon'] = null;
1230
+ $categories[$key]['mobiiconurl'] = null;
1231
+ }
1232
+ }
1233
+ else{
1234
+ $categories[$key]['mobiicon'] = null;
1235
+ $categories[$key]['mobiiconurl'] = null;
1236
+ }
1237
+ }
1238
+ }
1239
+ return $categories;
1240
+ }
1241
+ }
1242
+ ?>
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Cms.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Cms extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function getCmsdata($data)
6
+ {
7
+ $information = $this->successStatus();
8
+ $information['data']['CMS'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getCmsdata($data);
9
+ return $information;
10
+ }
11
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Config.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Config extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ protected $store = FALSE;
6
+ protected function _setStoreId($data)
7
+ {
8
+ $storeCollection = Mage::getModel('mobiadmin/applications')->getCollection()
9
+ ->addFieldToFilter('app_code', $data['appcode'])
10
+ ->addFieldToFilter('app_key', $data['app_key']);
11
+ if($storeCollection->getSize()){
12
+ foreach($storeCollection as $store){
13
+ $store_id = $store['app_storeid'];
14
+ if(empty($store_id)){
15
+ $store_id = Mage::app()
16
+ ->getWebsite()
17
+ ->getDefaultGroup()
18
+ ->getDefaultStoreId();
19
+ }
20
+ $this->store = $store_id;
21
+ return $store_id;
22
+ }
23
+ }
24
+ else{
25
+ return FALSE;
26
+ }
27
+ }
28
+
29
+ public function getAllInitialData($data)
30
+ {
31
+ $information = array();
32
+ $store_id = $this->_setStoreId($data);
33
+ if($store_id === FALSE || $store_id === null)
34
+ return $this->errorStatus('Unauthorized Access');
35
+
36
+ $this->setAppStore($store_id);
37
+ $storeInfo = $this->_getStoreSettings();
38
+ $information = $this->successStatus();
39
+ $information['data'] = $storeInfo;
40
+ $information['data']['root_category_id'] = Mage::app()->getStore()->getRootCategoryId();
41
+ $information['data']['appinfo'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getAppinfo($data);
42
+ $information['data']['mobipaypal'] = Mage::helper('core')->isModuleEnabled('Mobicommerce_Mobipayments') ? Mage::getModel('mobipayments/standard')->getPaypalConfig() : null;
43
+ $information['data']['categories'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/catalog_catalog'))->_categoryTreeList($store_id, $data['appcode']);
44
+ $information['data']['homedata'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/home'))->_getHomeData($data);
45
+ $information['data']['CMS'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getCmsdata($data);
46
+ $information['data']['language'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/language'))->getLanguageData($storeInfo['store_info']['locale_identifier']);
47
+ $information['data']['push'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getPushdata($data);
48
+ $information['data']['popup'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getPopupdata($data);
49
+ $information['data']['countries'] = $this->_getCounties();
50
+ $information['data']['cart_details'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo($data);
51
+ //$information['data']['social'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/social'))->getSocialPlatforms();
52
+
53
+ $logged_user = null;
54
+ if(Mage::getSingleton('customer/session')->isLoggedIn()){
55
+ $_customer = Mage::getSingleton('customer/session')->getCustomer();
56
+ $model = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/user'));
57
+ $logged_user = $model->_getCustomerProfileData($_customer);
58
+ }
59
+ $information['data']['logged_user'] = $logged_user;
60
+ $information['data']['currentDate'] = date('Y-m-d H:i:s');
61
+ return $information;
62
+ }
63
+
64
+ public function _getStoreSettings()
65
+ {
66
+ $options = Mage::getResourceSingleton('customer/customer')->getAttribute('gender')->getSource()->getAllOptions();
67
+ $values = array();
68
+ foreach ($options as $option) {
69
+ if ($option['value']) {
70
+ $values[] = array(
71
+ 'label' => $option['label'],
72
+ 'value' => $option['value'],
73
+ );
74
+ }
75
+ }
76
+
77
+ $country_code = Mage::getStoreConfig('general/country/default');
78
+ $country = Mage::getModel('directory/country')->loadByCode($country_code);
79
+ $currencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
80
+ $info = array(
81
+ 'store_info' => array(
82
+ 'country_code' => $country->getId(),
83
+ 'country_name' => $country->getName(),
84
+ 'locale_identifier' => Mage::app()->getLocale()->getLocaleCode(),
85
+ 'currency_symbol' => Mage::app()->getLocale()->currency($currencyCode)->getSymbol(),
86
+ 'currency_code' => $currencyCode,
87
+ 'store_id' => $this->_getStoreId(),
88
+ 'store_name' => $this->_getStoreName(),
89
+ ),
90
+ 'checkout_config' => array(
91
+ 'enable_guest_checkout' => Mage::getStoreConfig('checkout/options/guest_checkout'),
92
+ 'enable_agreements' => is_null(Mage::getStoreConfig('checkout/options/enable_agreements')) ? 0 : Mage::getStoreConfig('checkout/options/enable_agreements'),
93
+ ),
94
+ );
95
+
96
+ return $info;
97
+ }
98
+
99
+ public function setAppStore($storeId)
100
+ {
101
+ if($storeId!=""){
102
+ Mage::app()->getCookie()->set(
103
+ Mage_Core_Model_Store::COOKIE_NAME, Mage::app()->getStore($storeId)->getCode(), TRUE
104
+ );
105
+ Mage::app()->setCurrentStore(
106
+ Mage::app()->getStore($storeId)->getCode()
107
+ );
108
+ Mage::getSingleton('core/locale')->emulate($storeId);
109
+ }
110
+ }
111
+
112
+ public function _getCounties()
113
+ {
114
+ $list = array();
115
+ $country_default = Mage::getStoreConfig('general/country/default');
116
+ $countries = Mage::getResourceModel('directory/country_collection')->loadByStore();
117
+ $cache = null;
118
+ foreach ($countries as $country) {
119
+ if ($country_default == $country->getId()) {
120
+ $cache = array(
121
+ 'iso2' => $country->getId(),
122
+ 'name' => $country->getName(),
123
+ 'states' => $this->_getStates(array('country_code'=>$country->getId())),
124
+ );
125
+ }
126
+ else{
127
+ $list[] = array(
128
+ 'iso2' => $country->getId(),
129
+ 'name' => $country->getName(),
130
+ 'states' => $this->_getStates(array('country_code'=>$country->getId())),
131
+ );
132
+ }
133
+ }
134
+ if(!empty($list)){
135
+ $iso2 = array();
136
+ $name = array();
137
+ foreach ($list as $key => $row) {
138
+ $iso2[$key] = $row['iso2'];
139
+ $name[$key] = $row['name'];
140
+ }
141
+ array_multisort($name, SORT_ASC, $iso2, SORT_DESC, $list);
142
+ }
143
+
144
+ if ($cache){
145
+ array_unshift($list, $cache);
146
+ }
147
+ return $list;
148
+ }
149
+
150
+ public function _getStates($data)
151
+ {
152
+ $code = $data['country_code'];
153
+ $list = array();
154
+ if ($code) {
155
+ $states = Mage::getModel('directory/country')->loadByCode($code)->getRegions();
156
+ foreach ($states as $state) {
157
+ $list[] = array(
158
+ 'region_id' => $state->getRegionId(),
159
+ 'name' => $state->getName(),
160
+ 'code' => $state->getCode(),
161
+ );
162
+ }
163
+ return $list;
164
+ } else {
165
+ return array();
166
+ }
167
+ }
168
+
169
+ public function _getAgreements()
170
+ {
171
+ if (!Mage::getStoreConfigFlag('checkout/options/enable_agreements')) {
172
+ $agreements = array();
173
+ return $agreements;
174
+ } else {
175
+ $agreements = Mage::getModel('checkout/agreement')->getCollection()
176
+ ->addStoreFilter(Mage::app()->getStore()->getId())
177
+ ->addFieldToFilter('is_active', 1);
178
+ return $agreements->getData();
179
+ }
180
+ }
181
+
182
+ public function getAgreements()
183
+ {
184
+ $info = $this->successStatus();
185
+ $info['data'] = $this->_getAgreements();
186
+ return $info;
187
+ }
188
+
189
+ public function deleteApplication($data)
190
+ {
191
+ if(!empty($data['appcode']) && !empty($data['app_key'])){
192
+ $applicationCollection = Mage::getModel('mobiadmin/applications')->getCollection()
193
+ ->addFieldToFilter('app_code', $data['appcode'])
194
+ ->addFieldToFilter('app_key', $data['app_key']);
195
+ if($applicationCollection->count() > 0){
196
+ //delete from mobicommerce_applications
197
+ foreach($applicationCollection as $application){
198
+ $application->delete();
199
+ }
200
+ //delete from mobicommerce_applications_settings
201
+ $applicationCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
202
+ ->addFieldToFilter('app_code', $data['appcode']);
203
+ if($applicationCollection->count() > 0){
204
+ foreach($applicationCollection as $application){
205
+ $application->delete();
206
+ }
207
+ }
208
+ //delete from mobicommerce_devicetokens
209
+ $applicationCollection = Mage::getModel('mobiadmin/devicetokens')->getCollection()
210
+ ->addFieldToFilter('md_appcode', $data['appcode']);
211
+ if($applicationCollection->count() > 0){
212
+ foreach($applicationCollection as $application){
213
+ $application->delete();
214
+ }
215
+ }
216
+ //delete from mobi_app_widgets
217
+ $applicationCollection = Mage::getModel('mobiadmin/appwidget')->getCollection()
218
+ ->addFieldToFilter('app_code', $data['appcode']);
219
+ if($applicationCollection->count() > 0){
220
+ foreach($applicationCollection as $application){
221
+ $application->delete();
222
+ }
223
+ }
224
+ $this->rrmdir(Mage::getBaseDir('media').DS.'mobi_commerce'.DS.$data['appcode']);
225
+ return $this->successStatus();
226
+ }
227
+ else{
228
+ return $this->errorStatus('Unauthorized Access');
229
+ }
230
+ }
231
+ else{
232
+ return $this->errorStatus('Unauthorized Access');
233
+ }
234
+ }
235
+
236
+ /* function to remove entire directory with all files in it */
237
+ protected function rrmdir($dir, $include_basedir = true)
238
+ {
239
+ if (is_dir($dir)) {
240
+ $objects = scandir($dir);
241
+ foreach ($objects as $object) {
242
+ if ($object != "." && $object != "..") {
243
+ if (filetype($dir."/".$object) == "dir") $this->rrmdir($dir."/".$object); else unlink($dir."/".$object);
244
+ }
245
+ }
246
+ reset($objects);
247
+ if($include_basedir)
248
+ rmdir($dir);
249
+ }
250
+ }
251
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Custom.php ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Custom extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ const REFRESH_CART_AFTER_ADD_PRODUCT = false;
6
+ const IS_SHIPPING_METHOD_CUSTOM_FIELDS = false;
7
+ const ROUNDUP_CART_VALUES = false;
8
+ const DNB_DESIGNTOOL_APPLIED = false;
9
+
10
+ public function getCustomCheckoutFields(){
11
+ $customFields = array();
12
+ $site = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
13
+
14
+ // P01
15
+ $customFields = array(
16
+ "register" => array(
17
+ array(
18
+ "code" => "taxvat",
19
+ "type" => "text",
20
+ "name" => "Codice Fiscale",
21
+ "required" => true,
22
+ "validation" => "",
23
+ "error_message" => "Questo è un campo obbligatorio.",
24
+ "registerDependent" => false
25
+ )
26
+ ),
27
+ "billing" => array(
28
+ array(
29
+ "code" => "taxvat",
30
+ "type" => "text",
31
+ "name" => "Codice Fiscale",
32
+ "required" => true,
33
+ "validation" => "",
34
+ "error_message" => "Questo è un campo obbligatorio.",
35
+ "registerDependent" => true
36
+ ),
37
+ ),
38
+ );
39
+ // F03
40
+ $customFields = array(
41
+ "shipping_method" => array(
42
+ array(
43
+ "code" => "adj[delivery_date]",
44
+ "type" => "date",
45
+ "name" => "Leveringsdatum",
46
+ "required" => true,
47
+ "validation" => "",
48
+ "error_message" => "Please enter delivery date",
49
+ "registerDependent" => false,
50
+ "params" => array(
51
+ "default_value" => "",
52
+ "description" => "",
53
+ "format" => "dd/mm/yyyy"
54
+ )
55
+ )
56
+ ),
57
+ );
58
+ $customFields = array();
59
+ return $customFields;
60
+ }
61
+
62
+ public function updateLanguageLength(){
63
+ $langCode = array('fr_FR');
64
+ $labelCode = array(
65
+ 'Home' => 8,
66
+ 'Add_To_Wishlist' => 18,
67
+ 'Logout' => 11,
68
+ );
69
+ $langCode = null;
70
+ if(!empty($langCode)){
71
+ $resource = Mage::getSingleton('core/resource');
72
+ $conn = $resource->getConnection('core_read');
73
+ $update_array = array();
74
+ foreach ($langCode as $lang) {
75
+ foreach($labelCode as $key => $value) {
76
+ $query = "UPDATE `mobicommerce_multilanguage` SET mm_maxlength = '$value' WHERE mm_language_code = '$lang' AND mm_label_code = '$key'";
77
+ $conn->query($query);
78
+ echo $query.'<br>';
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ public function updateLangLabelEnglish(){
85
+ $resource = Mage::getSingleton('core/resource');
86
+ $conn = $resource->getConnection('core_read');
87
+ $errors = array();
88
+ $en_US = $conn->query("SELECT * FROM `mobicommerce_multilanguage` WHERE mm_language_code = 'en_US'")->fetchAll();
89
+ //echo '<pre>';print_r($en_US);exit;
90
+ $en_US = null;
91
+ if(!empty($en_US)){
92
+ foreach($en_US as $en => $us){
93
+ try{
94
+ $us['mm_label'] = encodeLanguageLabels($us['mm_label']);
95
+ $conn->query("UPDATE `mobicommerce_multilanguage` SET mm_label = '".$us['mm_label']."' WHERE mm_label_code = '".$us['mm_label_code']."' AND mm_language_code != 'en_US'");
96
+ }
97
+ catch(Exception $e){
98
+ $errors[] = $e->getMessage();
99
+ }
100
+ }
101
+ }
102
+ print_r($errors);
103
+ }
104
+
105
+ public function getCustomProductDetailFields($_product, $productInfo){
106
+ $fields = array(
107
+ array(
108
+ "code" => "sku",
109
+ "type" => "text",
110
+ "relateTo" => "description",
111
+ "name" => "Codice",
112
+ "value" => "",
113
+ ),
114
+ array(
115
+ "code" => "manufacturer",
116
+ "type" => "dropdown",
117
+ "relateTo" => "description",
118
+ "name" => "Marchio",
119
+ "value" => "",
120
+ ),
121
+ array(
122
+ "code" => "consegna_time",
123
+ "type" => "text",
124
+ "relateTo" => "description",
125
+ "name" => "Tempo di Consegna",
126
+ "value" => "",
127
+ ),
128
+ array(
129
+ "code" => "generic_group",
130
+ "type" => "dropdown",
131
+ "relateTo" => "description",
132
+ "name" => "Reparto",
133
+ "value" => "",
134
+ ),
135
+ array(
136
+ "code" => "custom_stock_status",
137
+ "type" => "dropdown",
138
+ "relateTo" => "stock",
139
+ "name" => "Disponibilità",
140
+ "value" => "",
141
+ ),
142
+ );
143
+ $fields = array(
144
+ array(
145
+ "code" => "size_chart",
146
+ "type" => "text",
147
+ "relateTo" => "staticblock_identifier",
148
+ "name" => "SIZE CHART & GARMENT INFO",
149
+ "value" => "",
150
+ ),
151
+ );
152
+ // F17
153
+ $fields = array(
154
+ array(
155
+ "code" => "payuapi",
156
+ "type" => "payment_method_installments",
157
+ "relateTo" => "payment_method_installments",
158
+ "name" => "TAKSİT SEÇENEKLERİ",
159
+ "value" => null,
160
+ ),
161
+ array(
162
+ "code" => "Options",
163
+ "type" => "group_attribute",
164
+ "relateTo" => "group_attribute",
165
+ "name" => "ÖZELLİKLER",
166
+ "value" => "",
167
+ ),
168
+ array(
169
+ "code" => "returns_custom_tab_tr",
170
+ "type" => "staticblock_identifier",
171
+ "relateTo" => "staticblock_identifier",
172
+ "name" => "GARANTİ",
173
+ "value" => "",
174
+ ),
175
+ array(
176
+ "code" => "payment_custom_tab",
177
+ "type" => "staticblock_identifier",
178
+ "relateTo" => "staticblock_identifier",
179
+ "name" => "Ödeme",
180
+ "value" => "",
181
+ ),
182
+ array(
183
+ "code" => "shipping_custom_tab_tr",
184
+ "type" => "staticblock_identifier",
185
+ "relateTo" => "staticblock_identifier",
186
+ "name" => "KARGO",
187
+ "value" => "",
188
+ ),
189
+ );
190
+ // Dnb mobi
191
+ $fields = array(
192
+ array(
193
+ "code" => "is_customizable",
194
+ "type" => "dropdown",
195
+ "relateTo" => "DNBDESIGNTOOL_BUTTON",
196
+ "name" => "Personalize",
197
+ "value" => "",
198
+ ),
199
+ );
200
+ $fields = null;
201
+ $outputFields = array();
202
+ if(!empty($fields)){
203
+ foreach($fields as $field_key => $field){
204
+ try{
205
+ if(in_array($field['type'], array('text', 'dropdown'))){
206
+ if($_product->offsetExists($field['code'])){
207
+ switch ($field['type']) {
208
+ case 'text':
209
+ default:
210
+ $fields[$field_key]['value'] = $_product->getResource()->getAttribute($field['code'])->getFrontend()->getValue($_product);
211
+ break;
212
+ case 'dropdown':
213
+ if($field['code'] == 'is_customizable'){
214
+ $fields[$field_key]['value'] = strtolower($_product->getResource()->getAttribute($field['code'])->getFrontend()->getValue($_product)) == 'sí' ? 'Yes' : false;
215
+ }
216
+ else{
217
+ $fields[$field_key]['value'] = $_product->getAttributeText($field['code']);
218
+ }
219
+ break;
220
+ }
221
+ switch ($field['relateTo']) {
222
+ case 'stock':
223
+ $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
224
+ $fields[$field_key]['value'] = str_replace('{qty}', (int)$stock->getQty(), $fields[$field_key]['value']);
225
+ break;
226
+ case 'staticblock_identifier':
227
+ $fields[$field_key]['value'] = Mage::app()->getLayout()->createBlock('cms/block')->setBlockId($fields[$field_key]['value'])->toHtml();
228
+ break;
229
+ default:
230
+ break;
231
+ }
232
+ $outputFields[] = $fields[$field_key];
233
+ }
234
+ }
235
+ else if(in_array($field['type'], array('staticblock_identifier'))){
236
+ $fields[$field_key]['value'] = Mage::app()->getLayout()->createBlock('cms/block')->setBlockId($fields[$field_key]['code'])->toHtml();
237
+ $outputFields[] = $fields[$field_key];
238
+ }
239
+ else if(in_array($field['type'], array('group_attribute'))){
240
+ $groupId = Mage::getModel('eav/entity_attribute_group')->getCollection()
241
+ ->addFieldToFilter('attribute_set_id', array('eq' => $_product->getAttributeSetId()))
242
+ ->addFieldToFilter('attribute_group_name', array('eq' => $field['code']))
243
+ ->getFirstItem()->getId();
244
+
245
+ $product_attributes = array();
246
+ foreach($_product->getAttributes($groupId) as $attribute) {
247
+ $product_attributes[] = array(
248
+ 'frontend_label' => $attribute->getFrontend()->getLabel($_product),
249
+ 'store_label' => $attribute->getStoreLabel(),
250
+ 'value' => $attribute->getFrontend()->getValue($_product)
251
+ );
252
+ }
253
+ $fields[$field_key]['value'] = $product_attributes;
254
+ $outputFields[] = $fields[$field_key];
255
+ }
256
+ else if(in_array($field['type'], array('payment_method_installments'))){
257
+ $payments = Mage::getSingleton('payment/config')->getActiveMethods();
258
+ $product_price = $_product->getFinalPrice();
259
+ if($payments){
260
+ foreach ($payments as $method_code => $method) {
261
+ if($method_code == $field['code']){
262
+ switch($method_code){
263
+ case 'payuapi';
264
+ $installment_options = array();
265
+ $installment_key_pair = array(
266
+ array(
267
+ "name" => "Axess, Bonus, Maximum, Finans, World, Asya, Halkbank",
268
+ "keycode" => "V7H1993D1",
269
+ "valuecode" => "VGD8UEY31",
270
+ "is_active" => false,
271
+ "options" => array()
272
+ ),
273
+ /*
274
+ array(
275
+ "name" => "Installment - Bonus",
276
+ "keycode" => "V7H1993D2",
277
+ "valuecode" => "VGD8UEY32",
278
+ "is_active" => false,
279
+ "options" => array()
280
+ ),
281
+ array(
282
+ "name" => "Installment - Maximum",
283
+ "keycode" => "V7H1993D3",
284
+ "valuecode" => "VGD8UEY33",
285
+ "is_active" => false,
286
+ "options" => array()
287
+ ),
288
+ array(
289
+ "name" => "Installment - Finans",
290
+ "keycode" => "V7H1993D4",
291
+ "valuecode" => "VGD8UEY34",
292
+ "is_active" => false,
293
+ "options" => array()
294
+ ),
295
+ array(
296
+ "name" => "Installment - World",
297
+ "keycode" => "V7H1993D5",
298
+ "valuecode" => "VGD8UEY35",
299
+ "is_active" => false,
300
+ "options" => array()
301
+ ),
302
+ array(
303
+ "name" => "Installment - Asya",
304
+ "keycode" => "V7H1993D6",
305
+ "valuecode" => "VGD8UEY36",
306
+ "is_active" => false,
307
+ "options" => array()
308
+ ),
309
+ array(
310
+ "name" => "Installment - Halkbank",
311
+ "keycode" => "V7H1993D7",
312
+ "valuecode" => "VGD8UEY37",
313
+ "is_active" => false,
314
+ "options" => array()
315
+ )
316
+ */
317
+ );
318
+ foreach($installment_key_pair as $installment_key => $installment_pair){
319
+ if($method->getConfigData($installment_pair['keycode'])){
320
+ $installment_key_pair[$installment_key]['is_active'] = true;
321
+ $installment_key_pair[$installment_key]['options_str'] = $method->getConfigData($installment_pair['valuecode']);
322
+ $installment_key_pair[$installment_key]['options'] = $this->_processPayuapiInstallmentOptionsString($installment_key_pair[$installment_key]['options_str'], $product_price, $interest_type = 'simple', $force_yearly_interest = true);
323
+
324
+ $installment_options[] = $installment_key_pair[$installment_key];
325
+ }
326
+ }
327
+
328
+ $fields[$field_key]['value'] = $installment_options;
329
+ $outputFields[] = $fields[$field_key];
330
+ break;
331
+ default:
332
+ break;
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ catch(Exception $e){
340
+
341
+ }
342
+ }
343
+ }
344
+ if(empty($outputFields))
345
+ $outputFields = null;
346
+ //$outputFields = null;
347
+ $productInfo['customAttributes'] = $outputFields;
348
+ return $productInfo;
349
+ }
350
+
351
+ /**
352
+ * Coded by Yash
353
+ * Date: 18-12-2014
354
+ * For calculating simple and compund interest for installment options
355
+ */
356
+ public function _processPayuapiInstallmentOptionsString($str = null, $price = 0, $interest_type = 'simple', $force_yearly_interest = false){
357
+ $str = trim($str);
358
+ if(empty($str))
359
+ return null;
360
+
361
+ /**
362
+ * Formula for simple interest
363
+ * A = P(1 + rt)
364
+ * P = principal amount
365
+ * r = rate of interest
366
+ * t = time(in tems of years)
367
+ * calculating months to years
368
+ * 2 months = 2 / 12 = 0.17 years
369
+ */
370
+ $return_options = array();
371
+ $installment_options = explode(';', $str);
372
+ foreach($installment_options as $ioption){
373
+ $month_interest_pair = explode('=', $ioption);
374
+ if(count($month_interest_pair) == 2){
375
+ $month_count = $month_interest_pair[0];
376
+ $interest_rate = $month_interest_pair[1];
377
+ if($interest_type == 'simple'){
378
+ $t = 1;
379
+ if($force_yearly_interest)
380
+ $t = ceil($month_count / 12);
381
+ else
382
+ $t = round($month_count / 12, 2);
383
+
384
+ $r = $interest_rate / 100;
385
+ $total_amount = $price * (1 + ($r * $t));
386
+ $return_options[] = array(
387
+ 'month_count' => $month_count,
388
+ 'installment_amount' => round($total_amount / $month_count),
389
+ 'total_amount' => round($total_amount),
390
+ 'exact_total_amount' => round($total_amount, 2)
391
+ );
392
+ }
393
+ else if($interest_type == 'compound'){
394
+
395
+ }
396
+ }
397
+ }
398
+ return $return_options;
399
+ }
400
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/External.php ADDED
@@ -0,0 +1,2300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_External extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function setApplicationSettings($data = null)
6
+ {
7
+ $this->__install102ScriptAction();
8
+ $app_code = isset($data['app_code'])?$data['app_code']:null;
9
+ $app_theme_folder_name = isset($data['app_theme_folder_name'])?$data['app_theme_folder_name']:'';
10
+ if(empty($app_code))
11
+ return false;
12
+
13
+ $this->_create_mobi_media_dir($app_code, $app_theme_folder_name);
14
+ Mage::getModel('mobiadmin/applications')->saveApplicationData($data);
15
+ }
16
+
17
+ protected function _create_mobi_media_dir($app_code = null, $app_theme_folder_name = null){
18
+ $base_dir = Mage::getBaseDir('media');
19
+ if(!(is_dir($base_dir.'/mobi_commerce') && file_exists($base_dir.'/mobi_commerce')))
20
+ mkdir($base_dir.'/mobi_commerce', 0777, true);
21
+
22
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code) && file_exists($base_dir.'/mobi_commerce/'.$app_code)))
23
+ mkdir($base_dir.'/mobi_commerce/'.$app_code, 0777, true);
24
+
25
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/home_banners') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/home_banners')))
26
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/home_banners', 0777, true);
27
+
28
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/appinfo') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/appinfo')))
29
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/appinfo', 0777, true);
30
+
31
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/certificates') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/certificates')))
32
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/certificates', 0777, true);
33
+
34
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/personalizer') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/personalizer'))){
35
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/personalizer', 0777, true);
36
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/personalizer/svg', 0777, true);
37
+
38
+ if(!empty($app_theme_folder_name)){
39
+ copy($base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/personalizer.xml', $base_dir . '/mobi_commerce/' . $app_code . '/personalizer/personalizer.xml');
40
+ copy($base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/personalizer.css', $base_dir . '/mobi_commerce/' . $app_code . '/personalizer/personalizer.css');
41
+ }
42
+ }
43
+
44
+ if(!empty($app_theme_folder_name)){
45
+ $dir = $base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/svg';
46
+ if(file_exists($dir)){
47
+ $scandir = scandir($dir);
48
+ foreach ($scandir as $key => $value)
49
+ {
50
+ if (!in_array($value,array(".","..")))
51
+ {
52
+ $currfile = $dir . DIRECTORY_SEPARATOR . $value;
53
+ if (!is_dir($currfile))
54
+ {
55
+ $filename = PATHINFO($value, PATHINFO_BASENAME);
56
+ if(!file_exists($base_dir . '/mobi_commerce/' . $app_code . '/personalizer/svg/' . $filename)){
57
+ copy($base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/svg/' . $filename, $base_dir . '/mobi_commerce/' . $app_code . '/personalizer/svg/' . $filename);
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ $sourcePersonalizerFolder = $base_dir.DS.'mobi_assets'.DS.'theme_files'.DS.$app_theme_folder_name.DS.'personalizer';
65
+ $destinationPersonalizerFolder = $base_dir.DS.'mobi_commerce'.DS.$app_code.DS.'personalizer';
66
+
67
+ $sourcePersonalizerXml = $sourcePersonalizerFolder.DS.'personalizer.xml';
68
+ $destinationPersonalizerXml = $destinationPersonalizerFolder.DS.'personalizer.xml';
69
+
70
+ if(file_exists ($destinationPersonalizerXml)){
71
+ $sourcePersonalizerXml = (array) simplexml_load_file($sourcePersonalizerXml);
72
+ $destinationPersonalizerXml = (array) simplexml_load_file($destinationPersonalizerXml);
73
+ $destinationPersonalizerCss = $destinationPersonalizerFolder.DS.'personalizer.css';
74
+ $cssArray = array();
75
+
76
+ $doc = new DOMDocument('1.0');
77
+ $doc->formatOutput = true;
78
+ $root = $doc->createElement('mobicommerce_personalizer');
79
+ $root = $doc->appendChild($root);
80
+
81
+ foreach($sourcePersonalizerXml as $key => $element){
82
+ $css = $element->css;
83
+ $svgFilenames = (string) $element->svg_filenames;
84
+ $defaultValue = (string) $element->default_value;
85
+ $currentValue = (string) $element->default_value;
86
+ if(isset($destinationPersonalizerXml[$key])){
87
+ $currentValue = (string) $destinationPersonalizerXml[$key]->current_value;
88
+ }
89
+ $css = implode("\r\n", explode('|', $css));
90
+ $cssArray[] = str_replace("--COLOR--", $currentValue, $css);
91
+
92
+ if(!empty($svgFilenames)){
93
+ //echo ($element->svg_filenames);exit;
94
+ $svgFilenames = explode('|', $svgFilenames);
95
+ if(!empty($svgFilenames)){
96
+ foreach($svgFilenames as $svg_filename){
97
+ if(file_exists($sourcePersonalizerFolder . DS . 'svg' . DS . $svg_filename)){
98
+ $svg_image = file_get_contents($sourcePersonalizerFolder . DS . 'svg' . DS . $svg_filename);
99
+ preg_match_all('/<style>(.*?)<\/style>/s', $svg_image, $style_tag);
100
+ $old_style_tag = $style_tag[1][0];
101
+ $property = explode('{', $style_tag[1][0]);
102
+ $property = $property[0];
103
+ preg_match_all('/{(.*?)}/s', $style_tag[1][0], $style_tag);
104
+ $param = explode(':', $style_tag[1][0]);
105
+ $param = $param[0];
106
+ $new_style_tag = $property.'{'.$param.':'.$currentValue.'!important;}';
107
+ $svg_image = str_replace($old_style_tag, $new_style_tag, $svg_image);
108
+ file_put_contents($destinationPersonalizerFolder . DS . 'svg' . DS . $svg_filename, $svg_image);
109
+ }
110
+ }
111
+ }
112
+ }
113
+
114
+ $newdoc = $root->appendChild($doc->createElement($key));
115
+ foreach($element as $optioncode => $value){
116
+ $em = $doc->createElement($optioncode);
117
+ if($optioncode == 'current_value'){
118
+ $value = $currentValue;
119
+ }
120
+ else if($optioncode == 'default_value'){
121
+ $value = $defaultValue;
122
+ }
123
+ $text = $doc->createTextNode($value);
124
+ $em->appendChild($text);
125
+ $newdoc->appendChild($em);
126
+ }
127
+ }
128
+ file_put_contents($destinationPersonalizerCss, implode($cssArray, "\r\n"));
129
+ $doc->save($destinationPersonalizerFolder.DS.'personalizer.xml');
130
+ }
131
+ }
132
+ }
133
+
134
+ protected function file_get_contents_curl($url) {
135
+ if(function_exists('file_get_contents'))
136
+ return file_get_contents($url);
137
+ else
138
+ {
139
+ $ch = curl_init();
140
+
141
+ curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
142
+ curl_setopt($ch, CURLOPT_HEADER, 0);
143
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
144
+ curl_setopt($ch, CURLOPT_URL, $url);
145
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
146
+
147
+ $data = curl_exec($ch);
148
+ curl_close($ch);
149
+
150
+ return $data;
151
+ }
152
+ }
153
+
154
+ public function __install102ScriptAction(){
155
+ try{
156
+
157
+ $resource = Mage::getSingleton('core/resource');
158
+ $conn = $resource->getConnection('core_read');
159
+
160
+ $results = $conn->query("SHOW TABLES LIKE '".Mage::getSingleton('core/resource')->getTableName('mobicommerce_category_icons')."'")->fetchAll();
161
+ if(!$results){
162
+ $conn->query("
163
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_applications')."`;
164
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_applications_settings')."`;
165
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_category_icons')."`;
166
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_devicetokens')."`;
167
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_multilanguage')."`;
168
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobi_app_widgets')."`;
169
+
170
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_applications')."` (
171
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
172
+ `app_name` varchar(255) NOT NULL DEFAULT '',
173
+ `app_code` varchar(255) DEFAULT NULL,
174
+ `app_key` varchar(255) NOT NULL DEFAULT '',
175
+ `app_logo` varchar(255) NOT NULL DEFAULT '',
176
+ `app_license_key` varchar(255) NOT NULL DEFAULT '',
177
+ `app_storeid` smallint(6) NOT NULL DEFAULT '0',
178
+ `created_time` datetime DEFAULT NULL,
179
+ `update_time` datetime DEFAULT NULL,
180
+ PRIMARY KEY (`id`)
181
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
182
+
183
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_applications_settings')."` (
184
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
185
+ `app_code` varchar(255) DEFAULT NULL,
186
+ `setting_code` varchar(255) NOT NULL DEFAULT '',
187
+ `value` longtext,
188
+ PRIMARY KEY (`id`)
189
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
190
+
191
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_category_icons')."` (
192
+ `mci_id` int(11) NOT NULL AUTO_INCREMENT,
193
+ `mci_name` varchar(100) DEFAULT NULL,
194
+ `mci_display_name` varchar(100) DEFAULT NULL,
195
+ `mci_icon_group` varchar(100) DEFAULT NULL,
196
+ `mci_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
197
+ PRIMARY KEY (`mci_id`)
198
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
199
+
200
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_devicetokens')."` (
201
+ `md_id` bigint(20) NOT NULL AUTO_INCREMENT,
202
+ `md_appcode` varchar(45) NOT NULL,
203
+ `md_devicetype` enum('android','ios') DEFAULT NULL,
204
+ `md_devicetoken` varchar(255) NOT NULL,
205
+ `md_created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
206
+ PRIMARY KEY (`md_id`)
207
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
208
+
209
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobi_app_widgets')."` (
210
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
211
+ `app_code` varchar(255) DEFAULT NULL,
212
+ `app_type` varchar(255) NOT NULL DEFAULT '',
213
+ `slider_code` varchar(255) NOT NULL DEFAULT '',
214
+ `slider_label` varchar(255) NOT NULL DEFAULT '',
215
+ `slider_status` smallint(6) DEFAULT NULL,
216
+ `slider_position` smallint(6) NOT NULL DEFAULT '0',
217
+ `slider_settings` varchar(255) NOT NULL DEFAULT '',
218
+ `slider_productIds` varchar(255) NOT NULL DEFAULT '',
219
+ `created_time` datetime DEFAULT NULL,
220
+ `update_time` datetime DEFAULT NULL,
221
+ PRIMARY KEY (`id`)
222
+ ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
223
+
224
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_multilanguage')."` (
225
+ `mm_id` bigint(20) NOT NULL AUTO_INCREMENT,
226
+ `mm_language_code` varchar(20) DEFAULT NULL,
227
+ `mm_type` enum('label','message') DEFAULT NULL,
228
+ `mm_label_code` varchar(255) DEFAULT NULL,
229
+ `mm_label` varchar(255) DEFAULT NULL,
230
+ `mm_maxlength` int(11) DEFAULT NULL,
231
+ `mm_text` varchar(255) DEFAULT NULL,
232
+ `mm_help` varchar(255) DEFAULT NULL,
233
+ PRIMARY KEY (`mm_id`)
234
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
235
+
236
+ INSERT INTO `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_category_icons')."` (`mci_name`, `mci_display_name`, `mci_icon_group`) VALUES
237
+ ('baby1.svg', 'baby1', 'babies'),
238
+ ('baby105.svg', 'baby105', 'babies'),
239
+ ('baby137.svg', 'baby137', 'babies'),
240
+ ('baby23.svg', 'baby23', 'babies'),
241
+ ('baby63.svg', 'baby63', 'babies'),
242
+ ('baby67.svg', 'baby67', 'babies'),
243
+ ('baby73.svg', 'baby73', 'babies'),
244
+ ('baby77.svg', 'baby77', 'babies'),
245
+ ('bear10.svg', 'bear10', 'babies'),
246
+ ('crawling.svg', 'crawling', 'babies'),
247
+ ('feeding.svg', 'feeding', 'babies'),
248
+ ('female109.svg', 'female109', 'babies'),
249
+ ('flying1.svg', 'flying1', 'babies'),
250
+ ('medical68.svg', 'medical68', 'babies'),
251
+ ('moon19.svg', 'moon19', 'babies'),
252
+ ('mother19.svg', 'mother19', 'babies'),
253
+ ('mother20.svg', 'mother20', 'babies'),
254
+ ('pregnant.svg', 'pregnant', 'babies'),
255
+ ('security18.svg', 'security18', 'babies'),
256
+ ('sparrow.svg', 'sparrow', 'babies'),
257
+ ('book104.svg', 'book104', 'book'),
258
+ ('book122.svg', 'book122', 'book'),
259
+ ('book135.svg', 'book135', 'book'),
260
+ ('book157.svg', 'book157', 'book'),
261
+ ('book7.svg', 'book7', 'book'),
262
+ ('books30.svg', 'books30', 'book'),
263
+ ('living1.svg', 'living1', 'book'),
264
+ ('man216.svg', 'man216', 'book'),
265
+ ('online26.svg', 'online26', 'book'),
266
+ ('open161.svg', 'open161', 'book'),
267
+ ('open182.svg', 'open182', 'book'),
268
+ ('open3.svg', 'open3', 'book'),
269
+ ('talking.svg', 'talking', 'book'),
270
+ ('text87.svg', 'text87', 'book'),
271
+ ('boy17.svg', 'boy17', 'boys'),
272
+ ('boy18.svg', 'boy18', 'boys'),
273
+ ('boy31.svg', 'boy31', 'boys'),
274
+ ('boy40.svg', 'boy40', 'boys'),
275
+ ('boy43.svg', 'boy43', 'boys'),
276
+ ('boy46.svg', 'boy46', 'boys'),
277
+ ('boy52.svg', 'boy52', 'boys'),
278
+ ('child12.svg', 'child12', 'boys'),
279
+ ('male98.svg', 'male98', 'boys'),
280
+ ('man483.svg', 'man483', 'boys'),
281
+ ('audio39.svg', 'audio39', 'electronics'),
282
+ ('calculator13.svg', 'calculator13', 'electronics'),
283
+ ('camera19.svg', 'camera19', 'electronics'),
284
+ ('computer94.svg', 'computer94', 'electronics'),
285
+ ('dvd5.svg', 'dvd5', 'electronics'),
286
+ ('electric43.svg', 'electric43', 'electronics'),
287
+ ('electronic55.svg', 'electronic55', 'electronics'),
288
+ ('encyclopedia.svg', 'encyclopedia', 'electronics'),
289
+ ('games3.svg', 'games3', 'electronics'),
290
+ ('games37.svg', 'games37', 'electronics'),
291
+ ('games4.svg', 'games4', 'electronics'),
292
+ ('games6.svg', 'games6', 'electronics'),
293
+ ('headphones.svg', 'headphones', 'electronics'),
294
+ ('home115.svg', 'home115', 'electronics'),
295
+ ('keyboard10.svg', 'keyboard10', 'electronics'),
296
+ ('kitchen48.svg', 'kitchen48', 'electronics'),
297
+ ('kitchen51.svg', 'kitchen51', 'electronics'),
298
+ ('lamp15.svg', 'lamp15', 'electronics'),
299
+ ('laptop1.svg', 'laptop1', 'electronics'),
300
+ ('laptop12.svg', 'laptop12', 'electronics'),
301
+ ('memory.svg', 'memory', 'electronics'),
302
+ ('microwave3.svg', 'microwave3', 'electronics'),
303
+ ('midi.svg', 'midi', 'electronics'),
304
+ ('mixer8.svg', 'mixer8', 'electronics'),
305
+ ('mobile14.svg', 'mobile14', 'electronics'),
306
+ ('mobile15.svg', 'mobile15', 'electronics'),
307
+ ('mobile20.svg', 'mobile20', 'electronics'),
308
+ ('mobile26.svg', 'mobile26', 'electronics'),
309
+ ('mouse10.svg', 'mouse10', 'electronics'),
310
+ ('on.svg', 'on', 'electronics'),
311
+ ('pc.svg', 'pc', 'electronics'),
312
+ ('pc6.svg', 'pc6', 'electronics'),
313
+ ('photo33.svg', 'photo33', 'electronics'),
314
+ ('print5.svg', 'print5', 'electronics'),
315
+ ('printer70.svg', 'printer70', 'electronics'),
316
+ ('shopping30.svg', 'shopping30', 'electronics'),
317
+ ('smartphone13.svg', 'smartphone13', 'electronics'),
318
+ ('telephone79.svg', 'telephone79', 'electronics'),
319
+ ('tool6.svg', 'tool6', 'electronics'),
320
+ ('usb24.svg', 'usb24', 'electronics'),
321
+ ('vacuum6.svg', 'vacuum6', 'electronics'),
322
+ ('washing11.svg', 'washing11', 'electronics'),
323
+ ('wireless30.svg', 'wireless30', 'electronics'),
324
+ ('workplace.svg', 'workplace', 'electronics'),
325
+ ('ankle3.svg', 'ankle3', 'fashion'),
326
+ ('apron.svg', 'apron', 'fashion'),
327
+ ('baseball1.svg', 'baseball1', 'fashion'),
328
+ ('baseball24.svg', 'baseball24', 'fashion'),
329
+ ('beret.svg', 'beret', 'fashion'),
330
+ ('bikini4.svg', 'bikini4', 'fashion'),
331
+ ('black170.svg', 'black170', 'fashion'),
332
+ ('black276.svg', 'black276', 'fashion'),
333
+ ('black280.svg', 'black280', 'fashion'),
334
+ ('boot2.svg', 'boot2', 'fashion'),
335
+ ('bow2.svg', 'bow2', 'fashion'),
336
+ ('bow3.svg', 'bow3', 'fashion'),
337
+ ('cat10.svg', 'cat10', 'fashion'),
338
+ ('childish.svg', 'childish', 'fashion'),
339
+ ('christmas266.svg', 'christmas266', 'fashion'),
340
+ ('coin9.svg', 'coin9', 'fashion'),
341
+ ('diamond10.svg', 'diamond10', 'fashion'),
342
+ ('diamond12.svg', 'diamond12', 'fashion'),
343
+ ('diamond13.svg', 'diamond13', 'fashion'),
344
+ ('diamond22.svg', 'diamond22', 'fashion'),
345
+ ('diamond27.svg', 'diamond27', 'fashion'),
346
+ ('diamond3.svg', 'diamond3', 'fashion'),
347
+ ('dress2.svg', 'dress2', 'fashion'),
348
+ ('dress6.svg', 'dress6', 'fashion'),
349
+ ('dress9.svg', 'dress9', 'fashion'),
350
+ ('excentric.svg', 'excentric', 'fashion'),
351
+ ('fairy1.svg', 'fairy1', 'fashion'),
352
+ ('female145.svg', 'female145', 'fashion'),
353
+ ('female209.svg', 'female209', 'fashion'),
354
+ ('female90.svg', 'female90', 'fashion'),
355
+ ('female94.svg', 'female94', 'fashion'),
356
+ ('flip.svg', 'flip', 'fashion'),
357
+ ('flip5.svg', 'flip5', 'fashion'),
358
+ ('glove8.svg', 'glove8', 'fashion'),
359
+ ('handbag7.svg', 'handbag7', 'fashion'),
360
+ ('hanger22.svg', 'hanger22', 'fashion'),
361
+ ('hat19.svg', 'hat19', 'fashion'),
362
+ ('high12.svg', 'high12', 'fashion'),
363
+ ('jacket2.svg', 'jacket2', 'fashion'),
364
+ ('lipstick1.svg', 'lipstick1', 'fashion'),
365
+ ('make.svg', 'make', 'fashion'),
366
+ ('mannequin.svg', 'mannequin', 'fashion'),
367
+ ('mascara.svg', 'mascara', 'fashion'),
368
+ ('mascara1.svg', 'mascara1', 'fashion'),
369
+ ('necktie1.svg', 'necktie1', 'fashion'),
370
+ ('perfume1.svg', 'perfume1', 'fashion'),
371
+ ('portfolio3.svg', 'portfolio3', 'fashion'),
372
+ ('rectangular27.svg', 'rectangular27', 'fashion'),
373
+ ('ribbon10.svg', 'ribbon10', 'fashion'),
374
+ ('ring5.svg', 'ring5', 'fashion'),
375
+ ('rounded62.svg', 'rounded62', 'fashion'),
376
+ ('rubber4.svg', 'rubber4', 'fashion'),
377
+ ('rubber5.svg', 'rubber5', 'fashion'),
378
+ ('safety8.svg', 'safety8', 'fashion'),
379
+ ('sandals2.svg', 'sandals2', 'fashion'),
380
+ ('sewing1.svg', 'sewing1', 'fashion'),
381
+ ('shoulder1.svg', 'shoulder1', 'fashion'),
382
+ ('simple29.svg', 'simple29', 'fashion'),
383
+ ('skirt.svg', 'skirt', 'fashion'),
384
+ ('skirt1.svg', 'skirt1', 'fashion'),
385
+ ('slip.svg', 'slip', 'fashion'),
386
+ ('sneaker.svg', 'sneaker', 'fashion'),
387
+ ('strap.svg', 'strap', 'fashion'),
388
+ ('strapless.svg', 'strapless', 'fashion'),
389
+ ('strapped1.svg', 'strapped1', 'fashion'),
390
+ ('stylish12.svg', 'stylish12', 'fashion'),
391
+ ('stylish2.svg', 'stylish2', 'fashion'),
392
+ ('stylish5.svg', 'stylish5', 'fashion'),
393
+ ('sun.svg', 'sun', 'fashion'),
394
+ ('t-shirt1.svg', 't-shirt1', 'fashion'),
395
+ ('tie.svg', 'tie', 'fashion'),
396
+ ('tie2.svg', 'tie2', 'fashion'),
397
+ ('tie5.svg', 'tie5', 'fashion'),
398
+ ('tshirt18.svg', 'tshirt18', 'fashion'),
399
+ ('girl19.svg', 'girl19', 'girls'),
400
+ ('girl37.svg', 'girl37', 'girls'),
401
+ ('girl39.svg', 'girl39', 'girls'),
402
+ ('girl40.svg', 'girl40', 'girls'),
403
+ ('girl42.svg', 'girl42', 'girls'),
404
+ ('princess.svg', 'princess', 'girls'),
405
+ ('woman132.svg', 'woman132', 'girls'),
406
+ ('woman133.svg', 'woman133', 'girls'),
407
+ ('woman136.svg', 'woman136', 'girls'),
408
+ ('woman3.svg', 'woman3', 'girls'),
409
+ ('chef15.svg', 'chef15', 'kitchen'),
410
+ ('chef18.svg', 'chef18', 'kitchen'),
411
+ ('chef21.svg', 'chef21', 'kitchen'),
412
+ ('coffee10.svg', 'coffee10', 'kitchen'),
413
+ ('cooking15.svg', 'cooking15', 'kitchen'),
414
+ ('covered16.svg', 'covered16', 'kitchen'),
415
+ ('cutlery6.svg', 'cutlery6', 'kitchen'),
416
+ ('fork.svg', 'fork', 'kitchen'),
417
+ ('fork27.svg', 'fork27', 'kitchen'),
418
+ ('fork28.svg', 'fork28', 'kitchen'),
419
+ ('glass35.svg', 'glass35', 'kitchen'),
420
+ ('glass40.svg', 'glass40', 'kitchen'),
421
+ ('hot55.svg', 'hot55', 'kitchen'),
422
+ ('hot56.svg', 'hot56', 'kitchen'),
423
+ ('ice52.svg', 'ice52', 'kitchen'),
424
+ ('kitchen26.svg', 'kitchen26', 'kitchen'),
425
+ ('restaurant26.svg', 'restaurant26', 'kitchen'),
426
+ ('restaurant29.svg', 'restaurant29', 'kitchen'),
427
+ ('serving.svg', 'serving', 'kitchen'),
428
+ ('thigh.svg', 'thigh', 'kitchen'),
429
+ ('magento_icon.svg', 'magento_icon', 'magento'),
430
+ ('acoustic2.svg', 'acoustic2', 'music'),
431
+ ('acoustic3.svg', 'acoustic3', 'music'),
432
+ ('acoustic4.svg', 'acoustic4', 'music'),
433
+ ('alto.svg', 'alto', 'music'),
434
+ ('audio49.svg', 'audio49', 'music'),
435
+ ('circular263.svg', 'circular263', 'music'),
436
+ ('dancer5.svg', 'dancer5', 'music'),
437
+ ('drummer.svg', 'drummer', 'music'),
438
+ ('eighth4.svg', 'eighth4', 'music'),
439
+ ('man282.svg', 'man282', 'music'),
440
+ ('microphone52.svg', 'microphone52', 'music'),
441
+ ('music170.svg', 'music170', 'music'),
442
+ ('music200.svg', 'music200', 'music'),
443
+ ('musical.svg', 'musical', 'music'),
444
+ ('musical7.svg', 'musical7', 'music'),
445
+ ('notifications.svg', 'notifications', 'music'),
446
+ ('play43.svg', 'play43', 'music'),
447
+ ('radio42.svg', 'radio42', 'music'),
448
+ ('treble1.svg', 'treble1', 'music'),
449
+ ('turn20.svg', 'turn20', 'music'),
450
+ ('americanfootball1.svg', 'americanfootball1', 'sports'),
451
+ ('barbell.svg', 'barbell', 'sports'),
452
+ ('biceps.svg', 'biceps', 'sports'),
453
+ ('first33.svg', 'first33', 'sports'),
454
+ ('fishing11.svg', 'fishing11', 'sports'),
455
+ ('man271.svg', 'man271', 'sports'),
456
+ ('man459.svg', 'man459', 'sports'),
457
+ ('objective.svg', 'objective', 'sports'),
458
+ ('ping3.svg', 'ping3', 'sports'),
459
+ ('recognition6.svg', 'recognition6', 'sports'),
460
+ ('regular2.svg', 'regular2', 'sports'),
461
+ ('runer.svg', 'runer', 'sports'),
462
+ ('runner5.svg', 'runner5', 'sports'),
463
+ ('silhouette66.svg', 'silhouette66', 'sports'),
464
+ ('soccer38.svg', 'soccer38', 'sports'),
465
+ ('soccer43.svg', 'soccer43', 'sports'),
466
+ ('soccer44.svg', 'soccer44', 'sports'),
467
+ ('tennis18.svg', 'tennis18', 'sports'),
468
+ ('trophy71.svg', 'trophy71', 'sports'),
469
+ ('volleyball4.svg', 'volleyball4', 'sports'),
470
+ ('air6.svg', 'air6', 'travel'),
471
+ ('airplane67.svg', 'airplane67', 'travel'),
472
+ ('airplane68.svg', 'airplane68', 'travel'),
473
+ ('black186.svg', 'black186', 'travel'),
474
+ ('black187.svg', 'black187', 'travel'),
475
+ ('black401.svg', 'black401', 'travel'),
476
+ ('car80.svg', 'car80', 'travel'),
477
+ ('car95.svg', 'car95', 'travel'),
478
+ ('location38.svg', 'location38', 'travel'),
479
+ ('luggage5.svg', 'luggage5', 'travel'),
480
+ ('map30.svg', 'map30', 'travel'),
481
+ ('ocean3.svg', 'ocean3', 'travel'),
482
+ ('person209.svg', 'person209', 'travel'),
483
+ ('photo147.svg', 'photo147', 'travel'),
484
+ ('scooter7.svg', 'scooter7', 'travel'),
485
+ ('sea8.svg', 'sea8', 'travel'),
486
+ ('sedan3.svg', 'sedan3', 'travel'),
487
+ ('suv.svg', 'suv', 'travel'),
488
+ ('taxi1.svg', 'taxi1', 'travel'),
489
+ ('train20.svg', 'train20', 'travel');
490
+
491
+ INSERT INTO `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_multilanguage')."` (`mm_language_code`, `mm_type`, `mm_label_code`, `mm_label`, `mm_maxlength`, `mm_text`, `mm_help`) VALUES
492
+ ('en_US', 'message', 'Please_wait', 'Please wait', '100', 'Please wait', 'Error: When user trigger new action while previous one is still processsing.'),
493
+ ('en_US', 'label', 'or', 'or', '25', 'or', 'Label: Display to show 2 action options.'),
494
+ ('en_US', 'label', 'Home', 'Home', '8', 'Home', 'Label: Home page title and button title.'),
495
+ ('en_US', 'message', 'No_internet_connection', 'No internet connection', '100', 'No internet connection', 'Message:No internet connection'),
496
+ ('en_US', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Shopping Category', 'Label: Shopping Category'),
497
+ ('en_US', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', 'Oops! There are no categories to display.', 'Text: When no category found.'),
498
+ ('en_US', 'label', 'Shop_by_category', 'Shop by category', '25', 'Shop by category', 'Label: Title to show above category names.'),
499
+ ('en_US', 'label', 'Categories', 'Categories', '20', 'Categories', 'Label: Title to show on homepage, above the category.'),
500
+ ('en_US', 'label', 'All_Products', 'All Products', '20', 'All Products', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
501
+ ('en_US', 'label', 'Profile', 'Profile', '10', 'Profile', 'Label: Profile page title and button title.'),
502
+ ('en_US', 'label', 'List_Page', 'List Page', '15', 'List Page', 'Label: Page title'),
503
+ ('en_US', 'label', 'Product_List', 'Product List', '15', 'Product List', 'Label: Product List page title '),
504
+ ('en_US', 'label', 'products_found', 'products found', '20', 'products found', 'Label: Label displayed on product listing page to show No. of products found. '),
505
+ ('en_US', 'label', 'Product_Detail', 'Product Detail', '15', 'Product Detail', 'Label: Product Detail page title'),
506
+ ('en_US', 'label', 'Details', 'Details', '10', 'Details', 'Label: Label displayed above the product detail on product detail page.'),
507
+ ('en_US', 'label', 'Buy_Now', 'Buy Now', '10', 'Buy Now', 'Label: Buy Now button title.'),
508
+ ('en_US', 'label', 'Choose_an_option', 'Choose an option', '20', 'Choose an option', 'Label: First option for product options.'),
509
+ ('en_US', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'Item added successfully', 'Message: When the Item added successfully into the cart. '),
510
+ ('en_US', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'No products found.', 'Text: When no products found for selected search criteria or category.'),
511
+ ('en_US', 'label', 'Load_More', 'Load More', '10', 'Load More', 'Label: Load More button title, displayed on product listing pages.'),
512
+ ('en_US', 'label', 'Viewers', 'Viewers', '10', 'Viewers', 'Label: Viewers Label.'),
513
+ ('en_US', 'label', 'Add_to_cart', 'Add to cart', '15', 'Add to cart', 'Label: Add to cart button title.'),
514
+ ('en_US', 'label', 'Downloadable_link', 'Downloadable link', '20', 'Downloadable link', 'Label: Downloadable link title. '),
515
+ ('en_US', 'label', 'Review', 'Review', '10', 'Review', 'Label: Review text and button title.'),
516
+ ('en_US', 'message', 'No_reviews_found', 'No reviews found', '100', 'No reviews found', 'Text: When no reviews found for selected product.'),
517
+ ('en_US', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'Shopping Cart', 'Label: Shopping Cart button title.'),
518
+ ('en_US', 'label', 'QTY', 'QTY', '5', 'QTY', 'Label: Label for product Quantity.'),
519
+ ('en_US', 'label', 'TOTAL', 'TOTAL', '15', 'TOTAL', 'Label: Label for cart &amp; order total. '),
520
+ ('en_US', 'label', 'Subtotal', 'Subtotal', '15', 'Subtotal', 'Label: Label for cart &amp; order subtotal.'),
521
+ ('en_US', 'label', 'Tax', 'Tax', '5', 'Tax', 'Label: Label for cart &amp; order Tax.'),
522
+ ('en_US', 'label', 'Discount', 'Discount', '15', 'Discount', 'Label: Label for cart &amp; order discount. '),
523
+ ('en_US', 'label', 'Grand_Total', 'Grand Total', '15', 'Grand Total', 'Label: Label for cart &amp; order grand total.'),
524
+ ('en_US', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'The shopping cart is empty.', 'Error: When the shopping cart is empty.'),
525
+ ('en_US', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Cart updated successfully', 'Message: When the cart updated successfully.'),
526
+ ('en_US', 'label', 'Update_Cart', 'Update Cart', '15', 'Update Cart', 'Label: Update Cart button title. '),
527
+ ('en_US', 'label', 'Checkout', 'Checkout', '10', 'Checkout', 'Label: Checkout button title.'),
528
+ ('en_US', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'Cart is empty', 'Text: When the cart is empty. '),
529
+ ('en_US', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'One of your cart item is having problem', 'Text: When one of the cart item is having error such as not available or so.'),
530
+ ('en_US', 'label', 'Login', 'Login', '7', 'Login', 'Label: Login button title.'),
531
+ ('en_US', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'Enter your username password to get access.', 'Error: When requested action required login.'),
532
+ ('en_US', 'label', 'Username', 'Username', '20', 'Username', 'Label: Label for Username field.'),
533
+ ('en_US', 'label', 'Password', 'Password', '20', 'Password', 'Label: Label for password field.'),
534
+ ('en_US', 'label', 'Sign_Up', 'Sign Up', '10', 'Sign Up', 'Label: Sign Up button title.'),
535
+ ('en_US', 'message', 'Enter_username', 'Enter username', '100', 'Enter username', 'Error: When username is empty.'),
536
+ ('en_US', 'message', 'Enter_password', 'Enter password', '100', 'Enter password', 'Error: When password is empty. '),
537
+ ('en_US', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Invalid username or password', 'Error: When Invalid username or password entered.'),
538
+ ('en_US', 'label', 'First_name', 'First name', '20', 'First name', 'Label: Label for firstname field.'),
539
+ ('en_US', 'label', 'Last_name', 'Last name', '20', 'Last name', 'Label: Label for lastname field.'),
540
+ ('en_US', 'label', 'Your_Email', 'Your Email', '20', 'Your Email', 'Label: Label for email address field.'),
541
+ ('en_US', 'label', 'Submit', 'Submit', '10', 'Submit', 'Label: Submit button title.'),
542
+ ('en_US', 'label', 'Signup_Form', 'Signup Form', '15', 'Signup Form', 'Label: Signup Form page title.'),
543
+ ('en_US', 'label', 'Signup', 'Signup', '10', 'Signup', 'Label: Signup button title.'),
544
+ ('en_US', 'message', 'Enter_firstname', 'Enter firstname', '100', 'Enter firstname', 'Error: When firstname is empty. '),
545
+ ('en_US', 'message', 'Enter_lastname', 'Enter lastname', '100', 'Enter lastname', 'Error: When lastname is empty.'),
546
+ ('en_US', 'message', 'Enter_email', 'Enter email', '100', 'Enter email address', 'Error: When email address is empty.'),
547
+ ('en_US', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Please enter valid email address', 'Error: When email address is invalid.'),
548
+ ('en_US', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', 'Congratulation! You are successfully registered ', 'Message: When successfully registration has been done. '),
549
+ ('en_US', 'message', 'Please_check_your_email', 'Please check your email', '100', 'Please check your email', 'Message: When user reset their password. '),
550
+ ('en_US', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Forgot Password', 'Label: Forgot Password button title.'),
551
+ ('en_US', 'label', 'Shipping', 'Shipping', '20', 'Shipping', 'Label: Label for Shipping. '),
552
+ ('en_US', 'label', 'Billing', 'Billing', '20', 'Billing', 'Label: Label for Billing'),
553
+ ('en_US', 'label', 'Address', 'Address', '20', 'Address', 'Label: Label for address field, available on payment page. '),
554
+ ('en_US', 'label', 'Payment', 'Payment', '20', 'Payment', 'Label: Label for payment field, available on payment page.'),
555
+ ('en_US', 'label', 'Continue', 'Continue', '20', 'Continue', 'Label: Continue button title. '),
556
+ ('en_US', 'label', 'Billing_Address', 'Billing Address', '20', 'Billing Address', 'Label: Label for Billing Address.'),
557
+ ('en_US', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Select a billing address from your address book or enter a new address.', 'Label: Title available on billing addresses drop down.'),
558
+ ('en_US', 'label', 'New_Address', 'New Address', '20', 'New Address', 'Label: Title for New Billing Address form.'),
559
+ ('en_US', 'label', 'Company', 'Company', '20', 'Company', 'Label: Label for company field, available on address page. '),
560
+ ('en_US', 'label', 'City', 'City', '20', 'City', 'Label: Label for city field, available on address page. '),
561
+ ('en_US', 'label', 'State', 'State', '20', 'State', 'Label: Label for state field, available on address page. '),
562
+ ('en_US', 'label', 'Country', 'Country', '20', 'Country', 'Label: Label for country field, available on address page. '),
563
+ ('en_US', 'label', 'select', 'select', '20', 'select', 'Label: Label for drop downs. '),
564
+ ('en_US', 'label', 'Billing_street', 'Billing street', '20', 'Billing street', 'Label: Label for billing street field, available on address page. '),
565
+ ('en_US', 'label', 'Postcode', 'Postcode', '20', 'Postcode', 'Label: Label for postcode field, available on address page. '),
566
+ ('en_US', 'label', 'Telephone', 'Telephone', '20', 'Telephone', 'Label: Label for telephone field, available on address page. '),
567
+ ('en_US', 'label', 'Same_as_billing', 'Same as billing', '25', 'Same as billing', 'Label: Label for Same as billing option. '),
568
+ ('en_US', 'label', 'Shipping_Address', 'Shipping Address', '25', 'Shipping Address', 'Label: Title for Shipping Address form.'),
569
+ ('en_US', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Select a shipping address from your address book or enter a new address.', 'Label: Title available on shipping addresses drop down.'),
570
+ ('en_US', 'label', 'Shipping_street', 'Shipping street', '25', 'Shipping street', 'Label: Label for shipping street field, available on address page. '),
571
+ ('en_US', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Enter billing firstname', 'Error: When billing firstname is empty.'),
572
+ ('en_US', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Enter billing lastname', 'Error: When billing lastname is empty.'),
573
+ ('en_US', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Enter billing city', 'Error: When billing city is empty.'),
574
+ ('en_US', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Enter billing state', 'Error: When billing state is empty.'),
575
+ ('en_US', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Enter billing country', 'Error: When billing country is empty.'),
576
+ ('en_US', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Enter billing street', 'Error: When billing street is empty.'),
577
+ ('en_US', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Enter billing postcode', 'Error: When billing postcode is empty.'),
578
+ ('en_US', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Enter billing telephone', 'Error: When billing telephone is empty.'),
579
+ ('en_US', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'Enter shipping firstname', 'Error: When shipping firstname is empty.'),
580
+ ('en_US', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Enter shipping lastname', 'Error: When shipping lastname is empty.'),
581
+ ('en_US', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Enter shipping city', 'Error: When shipping city is empty.'),
582
+ ('en_US', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Enter shipping state', 'Error: When shipping state is empty.'),
583
+ ('en_US', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Enter shipping country', 'Error: When shipping country is empty.'),
584
+ ('en_US', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Enter shipping street', 'Error: When shipping street is empty.'),
585
+ ('en_US', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Enter shipping postcode', 'Error: When shipping postcode is empty.'),
586
+ ('en_US', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Enter shipping telephone', 'Error: When shipping telephone is empty.'),
587
+ ('en_US', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Shipping Method', 'Label: Shipping Method page title. '),
588
+ ('en_US', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Select shipping method', 'Label: Label for Select shipping method options.'),
589
+ ('en_US', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Select shipment method', 'Error: When shipment method is not selected.'),
590
+ ('en_US', 'label', 'Payment_Method', 'Payment Method', '25', 'Payment Method', 'Label: Payment Method page title. '),
591
+ ('en_US', 'label', 'Select_payment_method', 'Select payment method', '25', 'Select payment method', 'Label: Label for Select payment method options.'),
592
+ ('en_US', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Select payment method', 'Error: When payment method is not selected.'),
593
+ ('en_US', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Oops, something wrong happened', 'Error: When magento return unexpected error.'),
594
+ ('en_US', 'label', 'Credit_Card', 'Credit Card', '25', 'Credit Card', 'Label: Label for credit card field, available on payment page. '),
595
+ ('en_US', 'label', 'Name_on_card', 'Name on card', '25', 'Name on card', 'Label: Label for name of card field, available on payment page. '),
596
+ ('en_US', 'label', 'Credit_card_type', 'Credit card type', '25', 'Credit card type', 'Label: Label for CC type field, available on payment page. '),
597
+ ('en_US', 'label', 'Credit_card_number', 'Credit card number', '25', 'Credit card number', 'Label: Label for CC number field, available on payment page. '),
598
+ ('en_US', 'label', 'Expiration_Date', 'Expiration Date', '25', 'Expiration Date', 'Label: Label for CC expiry date field, available on payment page. '),
599
+ ('en_US', 'label', 'Month', 'Month', '25', 'Month', 'Label: Label for CC expiry month field, available on payment page. '),
600
+ ('en_US', 'label', 'Year', 'Year', '25', 'Year', 'Label: Label for CC expiry year field, available on payment page. '),
601
+ ('en_US', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Card Verification Number', 'Label: Label for CC verification number field, available on payment page. '),
602
+ ('en_US', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Enter name on card', 'Error: When name on card is empty.'),
603
+ ('en_US', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Select credit card type', 'Error: When credit card type is not selected.'),
604
+ ('en_US', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Enter credit card number', 'Error: When credit card number is empty.'),
605
+ ('en_US', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Set expiry month', 'Error: When expiry month is empty.'),
606
+ ('en_US', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Set expiry year', 'Error: When expiry year is empty.'),
607
+ ('en_US', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Set card verification number', 'Error: When card verification number is empty.'),
608
+ ('en_US', 'label', 'Order_Review', 'Order Review', '15', 'Order Review', 'Label: Order Review page title. '),
609
+ ('en_US', 'label', 'Agreements', 'Agreements', '25', 'Agreements', 'Label: Label for Agreements, available on oprder review screen.'),
610
+ ('en_US', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Accept terms and condition', 'Error: When user did not agreed on sign up terms.'),
611
+ ('en_US', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Shipping &amp; Handling', 'Label: Label for Shipping &amp; Handling.'),
612
+ ('en_US', 'label', 'Place_Order', 'Place Order', '25', 'Place Order', 'Label: Place Order button title.'),
613
+ ('en_US', 'label', 'Order_Success', 'Order Success', '15', 'Order Success', 'Label: Order Success page title. '),
614
+ ('en_US', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Thank you for your purchase!', 'Message: When order successfully placed. '),
615
+ ('en_US', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'You will receive an order confirmation email with details of your order and a link to track its progress.', 'Text: When order successfully placed '),
616
+ ('en_US', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'Continue Shopping', 'LabeL: Continue Shopping button title. '),
617
+ ('en_US', 'label', 'Error', 'Error', '15', 'Error', 'Label: Error '),
618
+ ('en_US', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'Item successfully added into wishlist', 'Message: When item added into Wishlist.'),
619
+ ('en_US', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Item removed from wishlist', 'Message: When Item removed from wishlist.'),
620
+ ('en_US', 'label', 'Wishlist', 'Wishlist', '15', 'Wishlist', 'Label: Wishlist page title. '),
621
+ ('en_US', 'label', 'Remove', 'Remove', '10', 'Remove', 'Label: Remove button title.'),
622
+ ('en_US', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'No wishlist items found', 'Text: When No wishlist items found.'),
623
+ ('en_US', 'label', 'Orders', 'Orders', '15', 'Orders', 'Label: Orders history page title.'),
624
+ ('en_US', 'label', 'Order_History', 'Order History', '20', 'Order History', 'Label: Order History button title. '),
625
+ ('en_US', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'No orders found', 'Text: When no order history found. '),
626
+ ('en_US', 'label', 'Order_Detail', 'Order Detail', '15', 'Order Detail', 'Label: Order Detail page title. '),
627
+ ('en_US', 'label', 'Ordered_Items', 'Ordered Items', '25', 'Ordered Items', 'Label: Ordered Items block heading or title. '),
628
+ ('en_US', 'label', 'Order_Number', 'Order Number', '20', 'Order Number', 'Label: Label for Order Number.'),
629
+ ('en_US', 'label', 'Order_Date', 'Order Date', '20', 'Order Date', 'Label: Label for Order Date.'),
630
+ ('en_US', 'label', 'User', 'User', '10', 'User', 'Label: Label for User.'),
631
+ ('en_US', 'label', 'Info', 'Info', '15', 'About', 'Label: About page title (CMS/about module)'),
632
+ ('en_US', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'Add To Wishlist', 'Label: Add To Wishlist button title.'),
633
+ ('en_US', 'label', 'Logout', 'Logout', '10', 'Logout', 'Label: Logout button title.'),
634
+ ('en_US', 'label', 'Search_Product', 'Search Product', '50', 'Search Product', 'Label: Search Product.'),
635
+ ('en_US', 'label', 'Apply', 'Apply', '8', 'Apply', 'Label: Apply button title (to apply discount)'),
636
+ ('en_US', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Coupon code applied Successfully', 'Message: When coupon code is applied.'),
637
+ ('en_US', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Coupon code removed Successfully', 'Message: When coupon code is removed. '),
638
+ ('en_US', 'label', 'Discount_Code', 'Discount Code', '25', 'Discount Code', 'Label: Label for Discount Code.'),
639
+ ('en_US', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'Update Wishlist', 'Label: Update Wishlist button title.'),
640
+ ('en_US', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'Item updated successfully', 'Message: When wishlist updated successfully.'),
641
+ ('en_US', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Cant Load Wishlist Item', 'Error: When requested wishlist item Can not Load. '),
642
+ ('en_US', 'message', 'Please_Select', 'Please select ', '25', 'Please select', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
643
+ ('en_US', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'Product Downloadable Links', 'Label: Label for Product Downloadable Links.'),
644
+ ('en_US', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Invalid coupon code', 'Error: When coupon code is invalid.'),
645
+ ('en_US', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Please login to continue', 'Error: When action required login '),
646
+ ('en_US', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'Enter firstname', 'Error: When firstname is empty in signup form. '),
647
+ ('en_US', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'Enter lastname', 'Error: When lastname is empty in signup form. '),
648
+ ('en_US', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'Enter email address', 'Error: When email address is empty in signup form. '),
649
+ ('en_US', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'Enter password', 'Error: When password is empty in signup form. '),
650
+ ('en_US', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Account already exists', 'Error: When email address already exists.'),
651
+ ('en_US', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'Can\'t save customer address', 'Error: When error occure while saving customer Address.'),
652
+ ('en_US', 'message', 'No_Data_Found', 'No Data Found', '100', 'No data found', 'Error: When no data found for requested page.'),
653
+ ('en_US', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Product no longer available', 'Error: When requested product is no londer available.'),
654
+ ('en_US', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'Requested item not found', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
655
+ ('en_US', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'Requested item not found', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
656
+ ('en_US', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Opps! Item can\'t load', 'Error: When wishlist can\'t load because of unexpected error.'),
657
+ ('en_US', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'Requested item not found', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
658
+ ('en_US', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'Requested item not found', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
659
+ ('en_US', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'Requested item not found', 'Error: When system can not load wishlist Item.'),
660
+ ('en_US', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Requested item no longer available', 'Error: When requested product is no longer available.'),
661
+ ('en_US', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'Item has been deleted from cart', 'Error: When Item has been deleted from cart.'),
662
+ ('en_US', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'Not all products are available in the requested auantity', 'Error: When any of the product from cart is no longer available.'),
663
+ ('en_US', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'Accept all terms and conditions before placing the order', 'Error: When user did not agree on all required addreement while placing order.'),
664
+ ('en_US', 'label', 'Filter', 'Filter', '10', 'Filter', 'Label: Label for Filters.'),
665
+ ('en_US', 'label', 'Reset_Filter', 'Reset Filter', '15', 'Reset Filter', 'Label: Reset Filter link title.'),
666
+ ('en_US', 'label', 'Reset', 'Reset', '10', 'Reset', 'Label: Reset button title.'),
667
+ ('en_US', 'label', 'Popularity', 'Popularity', '25', 'Popularity', 'Label: Label for filter: Popularity option. '),
668
+ ('en_US', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', 'Price: High To Low', 'Label: Label for filter: Price-High To Low option. '),
669
+ ('en_US', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', 'Price: Low To High', 'Label: Label for filter: Price-Low To High option.'),
670
+ ('en_US', 'label', 'Rating', 'Rating', '25', 'Rating', 'Label: Label for filter: Rating option '),
671
+ ('en_US', 'label', 'Name-A_To_Z', 'Name-A To Z', '25', 'Name: A To Z', 'Label: Label for filter: Name-A To Z option.'),
672
+ ('en_US', 'label', 'Name-Z_To_A', 'Name-Z To A', '25', 'Name: Z To A', 'Label: Label for filter: Name-Z To A option.'),
673
+ ('en_US', 'label', 'Newest', 'Newest', '25', 'Newest', 'Label: Label for filter: Newest option.'),
674
+ ('en_US', 'label', 'Submit_Review', 'Submit Review', '25', 'Submit Review', 'Label: Submit Review button title.'),
675
+ ('en_US', 'label', 'User_Reviews', 'User Reviews', '25', 'User Reviews', 'Label: User Reviews page title. '),
676
+ ('en_US', 'label', 'No_Reviews_Found', 'No Reviews Found', '25', 'No Reviews Found', 'Label: Text as No Reviews Found'),
677
+ ('en_US', 'label', 'Average_User_Rating', 'Average User Rating', '25', 'Average User Rating', 'Label: Label for Average User Rating.'),
678
+ ('en_US', 'label', 'Reviews', 'Reviews', '25', 'Reviews', 'Label: Label for Reviews.'),
679
+ ('en_US', 'label', 'Nickename', 'Nickename', '25', 'Nickename', 'Label: Label for Nickename field, available on submit review form.'),
680
+ ('en_US', 'label', 'Summary_Of_Your_Review', 'Summary Of Your Review', '25', 'Summary Of Your Review', 'Label: Label for review summary field, available on submit review form.'),
681
+ ('en_US', 'label', 'Comments', 'Comments', '25', 'Comments', 'Label: Label for comments field, available on submit review form.'),
682
+ ('en_US', 'label', 'You_May_Also_Like', 'You May Also Like', '25', 'You May Also Like', 'Label: Label for related product slider on product detail page.'),
683
+ ('en_US', 'message', 'Please_Select_One_Of_Each_Of_The_Ratings', 'Please Select One Of Each Of The Ratings', '100', 'Select one of each of the ratings', 'Error: When feedback ratings is not selected for the product.'),
684
+ ('en_US', 'message', 'Please_Enter_Nickename', 'Please Enter Nickename', '100', 'Enter your nickename', 'Error: When feedback nickename is empty.'),
685
+ ('en_US', 'message', 'Please_Enter_Summary', 'Please Enter Summary', '100', 'Enter overall feedback', 'Error: When feedback summary is empty.'),
686
+ ('en_US', 'message', 'Please_Enter_Comments', 'Please Enter Comments', '100', 'Enter your comments', 'Error: When feedback comments is empty.'),
687
+ ('en_US', 'label', 'Recently_Viewed', 'Recently Viewed', '25', 'Recently Viewed', 'Label: Recently Viewed'),
688
+ ('en_US', 'message', 'Plugin_Not_Supported', 'Plugin Not Supported', '100', 'This action can\'t be performed on this device. Required support is not available on this device.', 'Error: When the device is not supported for requested action such as share functionality.'),
689
+ ('en_US', 'label', 'Share', 'Share', '7', 'Share', 'Label:Share button title.'),
690
+ ('en_US', 'label', 'Shopping_Products', 'Shopping Products', '20', 'Products', 'Label:Label for Shopping Products, available on left panel on product detail page.'),
691
+ ('en_US', 'label', 'Edit', 'Edit', '6', 'Edit', 'Label:Edit button title, available on wishlist page. '),
692
+ ('en_US', 'label', 'More_Information', 'More Information', '25', 'More Information', 'Label:More information about product'),
693
+ ('en_US', 'label', 'Share_App', 'Share App', '12', 'Share App', 'Label:Share app on CMS page'),
694
+ ('en_US', 'label', 'Sample_Links', 'Sample Links', '20', 'Sample Links', 'Label:Sample Links on product detail page'),
695
+ ('en_US', 'label', 'Maximum_Number_Of_Characters', 'Maximum number of characters', '50', 'Maximum number of characters', 'Label:Maximum number of characters for configurable product'),
696
+ ('en_US', 'message', 'Payment_Cancelled', 'Payment Cancelled', '50', 'Payment Cancelled', 'Message:Payment cancelled when user cancel payment'),
697
+ ('en_US', 'label', 'Tracking_Numbers', 'Tracking Numbers', '50', 'Tracking Numbers', 'Label:Tracking Numbers on order detail page'),
698
+ ('en_US', 'label', 'Track', 'Track', '15', 'Track', 'Label:Button on order detail page'),
699
+ ('en_US', 'label', 'Installment', 'Installment', '15', 'Installment', 'Label:On product detail page'),
700
+ ('en_US', 'label', 'Installment_Amount', 'Installment Amount', '20', 'Installment Amount', 'Label:On product detail page'),
701
+ ('en_US', 'label', 'Total_Amount', 'Total Amount', '15', 'Total Amount', 'Label:On product detail page'),
702
+ ('en_US', 'label', 'Single_Shot', 'Single Shot', '15', 'Single Shot', 'Label:For payuapi gateway on credit card page'),
703
+ ('en_US', 'message', 'Please_select_installment_option', 'Please Select Installment Option', '100', 'Please Select Installment Option', 'Message:On credit card page where installment option is required'),
704
+ ('en_US', 'label', 'January', 'January', '50', 'January', 'Label:Month name on credit card page'),
705
+ ('en_US', 'label', 'February', 'February', '50', 'February', 'Label:Month name on credit card page'),
706
+ ('en_US', 'label', 'March', 'March', '50', 'March', 'Label:Month name on credit card page'),
707
+ ('en_US', 'label', 'April', 'April', '50', 'April', 'Label:Month name on credit card page'),
708
+ ('en_US', 'label', 'May', 'May', '50', 'May', 'Label:Month name on credit card page'),
709
+ ('en_US', 'label', 'June', 'June', '50', 'June', 'Label:Month name on credit card page'),
710
+ ('en_US', 'label', 'July', 'July', '50', 'July', 'Label:Month name on credit card page'),
711
+ ('en_US', 'label', 'August', 'August', '50', 'August', 'Label:Month name on credit card page'),
712
+ ('en_US', 'label', 'September', 'September', '50', 'September', 'Label:Month name on credit card page'),
713
+ ('en_US', 'label', 'October', 'October', '50', 'October', 'Label:Month name on credit card page'),
714
+ ('en_US', 'label', 'November', 'November', '50', 'November', 'Label:Month name on credit card page'),
715
+ ('en_US', 'label', 'December', 'December', '50', 'December', 'Label:Month name on credit card page'),
716
+ ('es_ES', 'message', 'Please_wait', 'Please wait', '100', 'por favor espera', 'Error: When user trigger new action while previous one is still processsing.'),
717
+ ('es_ES', 'label', 'or', 'or', '25', 'o', 'Label: Display to show 2 action options.'),
718
+ ('es_ES', 'label', 'Home', 'Home', '8', 'casa', 'Label: Home page title and button title.'),
719
+ ('es_ES', 'message', 'No_internet_connection', 'No internet connection', '100', 'No hay conexión a internet', 'Message:No internet connection'),
720
+ ('es_ES', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Compras Categoría', 'Label: Shopping Category'),
721
+ ('es_ES', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', '¡Huy! No hay categorías para mostrar.', 'Text: When no category found.'),
722
+ ('es_ES', 'label', 'Shop_by_category', 'Shop by category', '25', 'Comprar por categoría', 'Label: Title to show above category names.'),
723
+ ('es_ES', 'label', 'Categories', 'Categories', '20', 'Categorías', 'Label: Title to show on homepage, above the category.'),
724
+ ('es_ES', 'label', 'All_Products', 'All Products', '20', 'todos los productos', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
725
+ ('es_ES', 'label', 'Profile', 'Profile', '10', 'perfil', 'Label: Profile page title and button title.'),
726
+ ('es_ES', 'label', 'List_Page', 'List Page', '15', 'Lista de páginas', 'Label: Page title'),
727
+ ('es_ES', 'label', 'Product_List', 'Product List', '15', 'Lista de Productos', 'Label: Product List page title '),
728
+ ('es_ES', 'label', 'products_found', 'products found', '20', 'Se han encontrado productos', 'Label: Label displayed on product listing page to show No. of products found. '),
729
+ ('es_ES', 'label', 'Product_Detail', 'Product Detail', '15', 'Detalles del producto', 'Label: Product Detail page title'),
730
+ ('es_ES', 'label', 'Details', 'Details', '10', 'Detalles', 'Label: Label displayed above the product detail on product detail page.'),
731
+ ('es_ES', 'label', 'Buy_Now', 'Buy Now', '10', 'comprar ahora', 'Label: Buy Now button title.'),
732
+ ('es_ES', 'label', 'Choose_an_option', 'Choose an option', '20', 'Elija una opción', 'Label: First option for product options.'),
733
+ ('es_ES', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'Artículo agregado con éxito', 'Message: When the Item added successfully into the cart. '),
734
+ ('es_ES', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'No hay productos encontrados.', 'Text: When no products found for selected search criteria or category.'),
735
+ ('es_ES', 'label', 'Load_More', 'Load More', '10', 'cargar más', 'Label: Load More button title, displayed on product listing pages.'),
736
+ ('es_ES', 'label', 'Viewers', 'Viewers', '10', 'Los espectadores', 'Label: Viewers Label.'),
737
+ ('es_ES', 'label', 'Add_to_cart', 'Add to cart', '15', 'Añadir a la cesta', 'Label: Add to cart button title.'),
738
+ ('es_ES', 'label', 'Downloadable_link', 'Downloadable link', '20', 'enlace offline', 'Label: Downloadable link title. '),
739
+ ('es_ES', 'label', 'Review', 'Review', '10', 'revisión', 'Label: Review text and button title.'),
740
+ ('es_ES', 'message', 'No_reviews_found', 'No reviews found', '100', 'No hay comentarios encontrados', 'Text: When no reviews found for selected product.'),
741
+ ('es_ES', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'carro de la compra', 'Label: Shopping Cart button title.'),
742
+ ('es_ES', 'label', 'QTY', 'QTY', '5', 'CANT', 'Label: Label for product Quantity.'),
743
+ ('es_ES', 'label', 'TOTAL', 'TOTAL', '15', 'Total', 'Label: Label for cart &amp; order total. '),
744
+ ('es_ES', 'label', 'Subtotal', 'Subtotal', '15', 'total parcial', 'Label: Label for cart &amp; order subtotal.'),
745
+ ('es_ES', 'label', 'Tax', 'Tax', '5', 'impuesto', 'Label: Label for cart &amp; order Tax.'),
746
+ ('es_ES', 'label', 'Discount', 'Discount', '15', 'descuento', 'Label: Label for cart &amp; order discount. '),
747
+ ('es_ES', 'label', 'Grand_Total', 'Grand Total', '15', 'gran total', 'Label: Label for cart &amp; order grand total.'),
748
+ ('es_ES', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'La cesta de la compra está vacía.', 'Error: When the shopping cart is empty.'),
749
+ ('es_ES', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Carrito actualizado correctamente', 'Message: When the cart updated successfully.'),
750
+ ('es_ES', 'label', 'Update_Cart', 'Update Cart', '15', 'Actualizar Cesta', 'Label: Update Cart button title. '),
751
+ ('es_ES', 'label', 'Checkout', 'Checkout', '10', 'caja', 'Label: Checkout button title.'),
752
+ ('es_ES', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'El carrito esta vacío', 'Text: When the cart is empty. '),
753
+ ('es_ES', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'Uno de sus artículos de la compra está teniendo problema', 'Text: When one of the cart item is having error such as not available or so.'),
754
+ ('es_ES', 'label', 'Login', 'Login', '7', 'login', 'Label: Login button title.'),
755
+ ('es_ES', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'Ingrese su contraseña nombre de usuario para obtener acceso.', 'Error: When requested action required login.'),
756
+ ('es_ES', 'label', 'Username', 'Username', '20', 'Nombre de usuario', 'Label: Label for Username field.'),
757
+ ('es_ES', 'label', 'Password', 'Password', '20', 'contraseña', 'Label: Label for password field.'),
758
+ ('es_ES', 'label', 'Sign_Up', 'Sign Up', '10', 'contratar', 'Label: Sign Up button title.'),
759
+ ('es_ES', 'message', 'Enter_username', 'Enter username', '100', 'Introduzca nombre de usuario', 'Error: When username is empty.'),
760
+ ('es_ES', 'message', 'Enter_password', 'Enter password', '100', 'Introduzca la contraseña', 'Error: When password is empty. '),
761
+ ('es_ES', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Nombre de usuario o contraseña no válidos', 'Error: When Invalid username or password entered.'),
762
+ ('es_ES', 'label', 'First_name', 'First name', '20', 'nombre de pila', 'Label: Label for firstname field.'),
763
+ ('es_ES', 'label', 'Last_name', 'Last name', '20', 'apellido', 'Label: Label for lastname field.'),
764
+ ('es_ES', 'label', 'Your_Email', 'Your Email', '20', 'Su correo electrónico', 'Label: Label for email address field.'),
765
+ ('es_ES', 'label', 'Submit', 'Submit', '10', 'presentar', 'Label: Submit button title.'),
766
+ ('es_ES', 'label', 'Signup_Form', 'Signup Form', '15', 'Formulario de Inscripción', 'Label: Signup Form page title.'),
767
+ ('es_ES', 'label', 'Signup', 'Signup', '10', 'Inscripción', 'Label: Signup button title.'),
768
+ ('es_ES', 'message', 'Enter_firstname', 'Enter firstname', '100', 'Introduzca apellido', 'Error: When firstname is empty. '),
769
+ ('es_ES', 'message', 'Enter_lastname', 'Enter lastname', '100', 'Introduzca apellido', 'Error: When lastname is empty.'),
770
+ ('es_ES', 'message', 'Enter_email', 'Enter email', '100', 'Introduzca el correo electrónico', 'Error: When email address is empty.'),
771
+ ('es_ES', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Por favor, introduzca la dirección de correo electrónico válida', 'Error: When email address is invalid.'),
772
+ ('es_ES', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', '¡Enhorabuena! Usted está registrado con éxito', 'Message: When successfully registration has been done. '),
773
+ ('es_ES', 'message', 'Please_check_your_email', 'Please check your email', '100', 'Por favor revise su correo electrónico', 'Message: When user reset their password. '),
774
+ ('es_ES', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Olvidé mi contraseña', 'Label: Forgot Password button title.'),
775
+ ('es_ES', 'label', 'Shipping', 'Shipping', '20', 'envío', 'Label: Label for Shipping. '),
776
+ ('es_ES', 'label', 'Billing', 'Billing', '20', 'facturación', 'Label: Label for Billing'),
777
+ ('es_ES', 'label', 'Address', 'Address', '20', 'dirección', 'Label: Label for address field, available on payment page. '),
778
+ ('es_ES', 'label', 'Payment', 'Payment', '20', 'pago', 'Label: Label for payment field, available on payment page.'),
779
+ ('es_ES', 'label', 'Continue', 'Continue', '20', 'continuar', 'Label: Continue button title. '),
780
+ ('es_ES', 'label', 'Billing_Address', 'Billing Address', '20', 'Dirección de Envio', 'Label: Label for Billing Address.'),
781
+ ('es_ES', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Seleccione una dirección de facturación de su libreta de direcciones o introduzca una nueva dirección.', 'Label: Title available on billing addresses drop down.'),
782
+ ('es_ES', 'label', 'New_Address', 'New Address', '20', 'nueva dirección', 'Label: Title for New Billing Address form.'),
783
+ ('es_ES', 'label', 'Company', 'Company', '20', 'empresa', 'Label: Label for company field, available on address page. '),
784
+ ('es_ES', 'label', 'City', 'City', '20', 'ciudad', 'Label: Label for city field, available on address page. '),
785
+ ('es_ES', 'label', 'State', 'State', '20', 'estado', 'Label: Label for state field, available on address page. '),
786
+ ('es_ES', 'label', 'Country', 'Country', '20', 'país', 'Label: Label for country field, available on address page. '),
787
+ ('es_ES', 'label', 'select', 'select', '20', 'seleccionar', 'Label: Label for drop downs. '),
788
+ ('es_ES', 'label', 'Billing_street', 'Billing street', '20', 'calle de facturación', 'Label: Label for billing street field, available on address page. '),
789
+ ('es_ES', 'label', 'Postcode', 'Postcode', '20', 'código postal', 'Label: Label for postcode field, available on address page. '),
790
+ ('es_ES', 'label', 'Telephone', 'Telephone', '20', 'teléfono', 'Label: Label for telephone field, available on address page. '),
791
+ ('es_ES', 'label', 'Same_as_billing', 'Same as billing', '25', 'Igual que la facturación', 'Label: Label for Same as billing option. '),
792
+ ('es_ES', 'label', 'Shipping_Address', 'Shipping Address', '25', 'Dirección de envío', 'Label: Title for Shipping Address form.'),
793
+ ('es_ES', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Seleccione una dirección de envío de su libreta de direcciones o introduzca una nueva dirección.', 'Label: Title available on shipping addresses drop down.'),
794
+ ('es_ES', 'label', 'Shipping_street', 'Shipping street', '25', 'calle del envío', 'Label: Label for shipping street field, available on address page. '),
795
+ ('es_ES', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Introduzca apellido de facturación', 'Error: When billing firstname is empty.'),
796
+ ('es_ES', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Introduzca apellido de facturación', 'Error: When billing lastname is empty.'),
797
+ ('es_ES', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Introduzca ciudad facturación', 'Error: When billing city is empty.'),
798
+ ('es_ES', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Introduzca estado de facturación', 'Error: When billing state is empty.'),
799
+ ('es_ES', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Introduzca el país de facturación', 'Error: When billing country is empty.'),
800
+ ('es_ES', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Introduzca facturación calle', 'Error: When billing street is empty.'),
801
+ ('es_ES', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Ingrese el código postal de facturación', 'Error: When billing postcode is empty.'),
802
+ ('es_ES', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Introduzca telefónico de facturación', 'Error: When billing telephone is empty.'),
803
+ ('es_ES', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'Introduzca apellido envío', 'Error: When shipping firstname is empty.'),
804
+ ('es_ES', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Introduzca apellido envío', 'Error: When shipping lastname is empty.'),
805
+ ('es_ES', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Introduzca ciudad envío', 'Error: When shipping city is empty.'),
806
+ ('es_ES', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Introduzca estado del envío', 'Error: When shipping state is empty.'),
807
+ ('es_ES', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Introduzca el país de envío', 'Error: When shipping country is empty.'),
808
+ ('es_ES', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Introduzca calle envío', 'Error: When shipping street is empty.'),
809
+ ('es_ES', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Ingrese el código postal de envío', 'Error: When shipping postcode is empty.'),
810
+ ('es_ES', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Introduzca teléfono envío', 'Error: When shipping telephone is empty.'),
811
+ ('es_ES', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Método de envío', 'Label: Shipping Method page title. '),
812
+ ('es_ES', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Seleccione el método de envío', 'Label: Label for Select shipping method options.'),
813
+ ('es_ES', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Elija un método para el envío', 'Error: When shipment method is not selected.'),
814
+ ('es_ES', 'label', 'Payment_Method', 'Payment Method', '25', 'método de pago', 'Label: Payment Method page title. '),
815
+ ('es_ES', 'label', 'Select_payment_method', 'Select payment method', '25', 'Seleccione forma de pago', 'Label: Label for Select payment method options.'),
816
+ ('es_ES', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Seleccione forma de pago', 'Error: When payment method is not selected.'),
817
+ ('es_ES', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Vaya, algo malo sucedió', 'Error: When magento return unexpected error.'),
818
+ ('es_ES', 'label', 'Credit_Card', 'Credit Card', '25', 'tarjeta de crédito', 'Label: Label for credit card field, available on payment page. '),
819
+ ('es_ES', 'label', 'Name_on_card', 'Name on card', '25', 'Nombre en la tarjeta', 'Label: Label for name of card field, available on payment page. '),
820
+ ('es_ES', 'label', 'Credit_card_type', 'Credit card type', '25', 'Tipo de la tarjeta de crédito', 'Label: Label for CC type field, available on payment page. '),
821
+ ('es_ES', 'label', 'Credit_card_number', 'Credit card number', '25', 'Número de Tarjeta de Crédito', 'Label: Label for CC number field, available on payment page. '),
822
+ ('es_ES', 'label', 'Expiration_Date', 'Expiration Date', '25', 'fecha de expiración', 'Label: Label for CC expiry date field, available on payment page. '),
823
+ ('es_ES', 'label', 'Month', 'Month', '25', 'mes', 'Label: Label for CC expiry month field, available on payment page. '),
824
+ ('es_ES', 'label', 'Year', 'Year', '25', 'año', 'Label: Label for CC expiry year field, available on payment page. '),
825
+ ('es_ES', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Tarjeta del número de Verificación', 'Label: Label for CC verification number field, available on payment page. '),
826
+ ('es_ES', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Ingrese nombre en la tarjeta', 'Error: When name on card is empty.'),
827
+ ('es_ES', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Seleccione el tipo de tarjeta de crédito', 'Error: When credit card type is not selected.'),
828
+ ('es_ES', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Introduzca el número de tarjeta de crédito', 'Error: When credit card number is empty.'),
829
+ ('es_ES', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Establecer meses de caducidad', 'Error: When expiry month is empty.'),
830
+ ('es_ES', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Establecer años de caducidad', 'Error: When expiry year is empty.'),
831
+ ('es_ES', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Número de verificación de tarjeta de Ajuste', 'Error: When card verification number is empty.'),
832
+ ('es_ES', 'label', 'Order_Review', 'Order Review', '15', 'Revisión del pedido', 'Label: Order Review page title. '),
833
+ ('es_ES', 'label', 'Agreements', 'Agreements', '25', 'Acuerdos', 'Label: Label for Agreements, available on oprder review screen.'),
834
+ ('es_ES', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Acepta términos y condiciones', 'Error: When user did not agreed on sign up terms.'),
835
+ ('es_ES', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Envío y dirección', 'Label: Label for Shipping &amp; Handling.'),
836
+ ('es_ES', 'label', 'Place_Order', 'Place Order', '25', 'Ponga la orden', 'Label: Place Order button title.'),
837
+ ('es_ES', 'label', 'Order_Success', 'Order Success', '15', 'Solicitar éxito', 'Label: Order Success page title. '),
838
+ ('es_ES', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Gracias por su compra!', 'Message: When order successfully placed. '),
839
+ ('es_ES', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'Usted recibirá un correo electrónico de confirmación de pedido con los detalles de su pedido y un enlace para el seguimiento de su progreso.', 'Text: When order successfully placed '),
840
+ ('es_ES', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'continuar Compras', 'LabeL: Continue Shopping button title. '),
841
+ ('es_ES', 'label', 'Error', 'Error', '15', 'error', 'Label: Error '),
842
+ ('es_ES', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'Artículo agregado con éxito en la lista de deseos', 'Message: When item added into Wishlist.'),
843
+ ('es_ES', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Artículo removido de la lista de deseos', 'Message: When Item removed from wishlist.'),
844
+ ('es_ES', 'label', 'Wishlist', 'Wishlist', '15', 'lista', 'Label: Wishlist page title. '),
845
+ ('es_ES', 'label', 'Remove', 'Remove', '10', 'quitar', 'Label: Remove button title.'),
846
+ ('es_ES', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'No hay artículos en su lista encontrados', 'Text: When No wishlist items found.'),
847
+ ('es_ES', 'label', 'Orders', 'Orders', '15', 'órdenes', 'Label: Orders history page title.'),
848
+ ('es_ES', 'label', 'Order_History', 'Order History', '20', 'Historial de pedidos', 'Label: Order History button title. '),
849
+ ('es_ES', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'No hay pedidos encontrados', 'Text: When no order history found. '),
850
+ ('es_ES', 'label', 'Order_Detail', 'Order Detail', '15', 'Detalle de la orden', 'Label: Order Detail page title. '),
851
+ ('es_ES', 'label', 'Ordered_Items', 'Ordered Items', '25', 'Los artículos pedidos', 'Label: Ordered Items block heading or title. '),
852
+ ('es_ES', 'label', 'Order_Number', 'Order Number', '20', 'número de orden', 'Label: Label for Order Number.'),
853
+ ('es_ES', 'label', 'Order_Date', 'Order Date', '20', 'Fecha del pedido', 'Label: Label for Order Date.'),
854
+ ('es_ES', 'label', 'User', 'User', '10', 'usuario', 'Label: Label for User.'),
855
+ ('es_ES', 'label', 'Info', 'Info', '15', 'acerca de', 'Label: About page title (CMS/about module)'),
856
+ ('es_ES', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'Agregar a la lista', 'Label: Add To Wishlist button title.'),
857
+ ('es_ES', 'label', 'Logout', 'Logout', '10', 'Cerrar sesión', 'Label: Logout button title.'),
858
+ ('es_ES', 'label', 'Search_Product', 'Search Product', '50', 'Buscar Producto', 'Label: Search Product.'),
859
+ ('es_ES', 'label', 'Apply', 'Apply', '8', 'aplicar', 'Label: Apply button title (to apply discount)'),
860
+ ('es_ES', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Código de descuento aplicado con éxito', 'Message: When coupon code is applied.'),
861
+ ('es_ES', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Código de descuento Suprimido correctamente', 'Message: When coupon code is removed. '),
862
+ ('es_ES', 'label', 'Discount_Code', 'Discount Code', '25', 'Código de Descuento', 'Label: Label for Discount Code.'),
863
+ ('es_ES', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'actualización lista de Deseos', 'Label: Update Wishlist button title.'),
864
+ ('es_ES', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'Artículo actualizado correctamente', 'Message: When wishlist updated successfully.'),
865
+ ('es_ES', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Cargar Cant Lista de artículos', 'Error: When requested wishlist item Can not Load. '),
866
+ ('es_ES', 'message', 'Please_Select', 'Please select ', '25', 'Por favor, seleccione', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
867
+ ('es_ES', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'Productos Enlaces descargables', 'Label: Label for Product Downloadable Links.'),
868
+ ('es_ES', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Código promocional no válido', 'Error: When coupon code is invalid.'),
869
+ ('es_ES', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Inicia sesión para continuar', 'Error: When action required login '),
870
+ ('es_ES', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'Introduzca apellido', 'Error: When firstname is empty in signup form. '),
871
+ ('es_ES', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'Introduzca apellido', 'Error: When lastname is empty in signup form. '),
872
+ ('es_ES', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'Introduzca el correo electrónico', 'Error: When email address is empty in signup form. '),
873
+ ('es_ES', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'Introduzca la contraseña', 'Error: When password is empty in signup form. '),
874
+ ('es_ES', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Ya existe Cuenta', 'Error: When email address already exists.'),
875
+ ('es_ES', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'No se puede guardar la dirección del cliente', 'Error: When error occure while saving customer Address.'),
876
+ ('es_ES', 'message', 'No_Data_Found', 'No Data Found', '100', 'No se encontraron datos', 'Error: When no data found for requested page.'),
877
+ ('es_ES', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Ya no está disponible Producto', 'Error: When requested product is no londer available.'),
878
+ ('es_ES', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'Artículo solicitado no encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
879
+ ('es_ES', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'Artículo solicitado no encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
880
+ ('es_ES', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Opps! El artículo no se puede cargar', 'Error: When wishlist can\'t load because of unexpected error.'),
881
+ ('es_ES', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'Artículo solicitado no encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
882
+ ('es_ES', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'Artículo solicitado no encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
883
+ ('es_ES', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'Artículo solicitado no encontrado', 'Error: When system can not load wishlist Item.'),
884
+ ('es_ES', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Artículo solicitado ya no está disponible', 'Error: When requested product is no longer available.'),
885
+ ('es_ES', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'Artículo ha sido borrado de la compra', 'Error: When Item has been deleted from cart.'),
886
+ ('es_ES', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'No todos los productos están disponibles en el auantity solicitado', 'Error: When any of the product from cart is no longer available.'),
887
+ ('es_ES', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'Acepte todos los términos y condiciones antes de realizar el pedido', 'Error: When user did not agree on all required addreement while placing order.'),
888
+ ('es_ES', 'label', 'Filter', 'Filter', '10', 'filtro', 'Label: Label for Filters.'),
889
+ ('es_ES', 'label', 'Reset_Filter', 'Reset Filter', '15', 'Reajuste del filtro', 'Label: Reset Filter link title.'),
890
+ ('es_ES', 'label', 'Reset', 'Reset', '10', 'reajustar', 'Label: Reset button title.'),
891
+ ('es_ES', 'label', 'Popularity', 'Popularity', '25', 'popularidad', 'Label: Label for filter: Popularity option. '),
892
+ ('es_ES', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', 'Precio De Mayor a Menor', 'Label: Label for filter: Price-High To Low option. '),
893
+ ('es_ES', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', 'Precio menor a mayor', 'Label: Label for filter: Price-Low To High option.'),
894
+ ('es_ES', 'label', 'Rating', 'Rating', '25', 'clasificación', 'Label: Label for filter: Rating option '),
895
+ ('es_ES', 'label', 'Name-A_To_Z', 'Name-A To Z', '25', 'Nombre-A a la Z', 'Label: Label for filter: Name-A To Z option.'),
896
+ ('es_ES', 'label', 'Name-Z_To_A', 'Name-Z To A', '25', 'Nombre-Z a A', 'Label: Label for filter: Name-Z To A option.'),
897
+ ('es_ES', 'label', 'Newest', 'Newest', '25', 'el más nuevo', 'Label: Label for filter: Newest option.'),
898
+ ('es_ES', 'label', 'Submit_Review', 'Submit Review', '25', 'Enviar opinión', 'Label: Submit Review button title.'),
899
+ ('es_ES', 'label', 'User_Reviews', 'User Reviews', '25', 'Opiniones de los usuarios', 'Label: User Reviews page title. '),
900
+ ('es_ES', 'label', 'No_Reviews_Found', 'No Reviews Found', '25', 'No hay comentarios encontrados', 'Label: Text as No Reviews Found'),
901
+ ('es_ES', 'label', 'Average_User_Rating', 'Average User Rating', '25', 'Clasificación del usuario promedio', 'Label: Label for Average User Rating.'),
902
+ ('es_ES', 'label', 'Reviews', 'Reviews', '25', 'Comentarios', 'Label: Label for Reviews.'),
903
+ ('es_ES', 'label', 'Nickename', 'Nickename', '25', 'Nickename', 'Label: Label for Nickename field, available on submit review form.'),
904
+ ('es_ES', 'label', 'Summary_Of_Your_Review', 'Summary Of Your Review', '25', 'Resumen de su opinión', 'Label: Label for review summary field, available on submit review form.'),
905
+ ('es_ES', 'label', 'Comments', 'Comments', '25', 'Comentarios', 'Label: Label for comments field, available on submit review form.'),
906
+ ('es_ES', 'label', 'You_May_Also_Like', 'You May Also Like', '25', 'También le gustará', 'Label: Label for related product slider on product detail page.'),
907
+ ('es_ES', 'message', 'Please_Select_One_Of_Each_Of_The_Ratings', 'Please Select One Of Each Of The Ratings', '100', 'Seleccione uno de cada una de las votaciones', 'Error: When feedback ratings is not selected for the product.'),
908
+ ('es_ES', 'message', 'Please_Enter_Nickename', 'Please Enter Nickename', '100', 'Escriba su nickename', 'Error: When feedback nickename is empty.'),
909
+ ('es_ES', 'message', 'Please_Enter_Summary', 'Please Enter Summary', '100', 'Introduzca los comentarios en general', 'Error: When feedback summary is empty.'),
910
+ ('es_ES', 'message', 'Please_Enter_Comments', 'Please Enter Comments', '100', 'Escribe tus comentarios', 'Error: When feedback comments is empty.'),
911
+ ('es_ES', 'message', 'Plugin_Not_Supported', 'Plugin Not Supported', '100', 'Esta acción no se puede realizar en este dispositivo. Apoyo requerido no está disponible en este dispositivo.', 'Error: When the device is not supported for requested action such as share functionality.'),
912
+ ('es_ES', 'label', 'Recently_Viewed', 'Recently Viewed', '25', 'vistos recientemente', 'Label: Recently Viewed'),
913
+ ('es_ES', 'label', 'Share', 'Share', '7', 'cuota', 'Label:Share button title.'),
914
+ ('es_ES', 'label', 'Shopping_Products', 'Shopping Products', '20', 'productos de las compras', 'Label:Label for Shopping Products, available on left panel on product detail page.'),
915
+ ('es_ES', 'label', 'Edit', 'Edit', '6', 'editar', 'Label:Edit button title, available on wishlist page. '),
916
+ ('es_ES', 'label', 'More_Information', 'More Information', '25', 'más información', 'Label:More information about product'),
917
+ ('es_ES', 'label', 'Share_App', 'Share App', '12', 'Compartir App', 'Label:Share app on CMS page'),
918
+ ('es_ES', 'label', 'Sample_Links', 'Sample Links', '20', 'Enlaces de ejemplo', 'Label:Sample Links on product detail page'),
919
+ ('es_ES', 'label', 'Maximum_Number_Of_Characters', 'Maximum number of characters', '50', 'Número máximo de caracteres', 'Label:Maximum number of characters for configurable product'),
920
+ ('es_ES', 'message', 'Payment_Cancelled', 'Payment Cancelled', '50', 'Pago Cancelado', 'Message:Payment cancelled when user cancel payment'),
921
+ ('es_ES', 'label', 'Tracking_Numbers', 'Tracking Numbers', '50', 'números de seguimiento', 'Label:Tracking Numbers on order detail page'),
922
+ ('es_ES', 'label', 'Track', 'Track', '15', 'pista', 'Label:Button on order detail page'),
923
+ ('es_ES', 'label', 'Installment', 'Installment', '15', 'entrega', 'Label:On product detail page'),
924
+ ('es_ES', 'label', 'Installment_Amount', 'Installment Amount', '20', 'Monto de la Cuota', 'Label:On product detail page'),
925
+ ('es_ES', 'label', 'Total_Amount', 'Total Amount', '15', 'cantidad total', 'Label:On product detail page'),
926
+ ('es_ES', 'label', 'Single_Shot', 'Single Shot', '15', 'Single Shot', 'Label:For payuapi gateway on credit card page'),
927
+ ('es_ES', 'message', 'Please_select_installment_option', 'Please Select Installment Option', '100', 'Seleccione Opción Anual', 'Message:On credit card page where installment option is required'),
928
+ ('es_ES', 'label', 'January', 'January', '50', 'enero', 'Label:Month name on credit card page'),
929
+ ('es_ES', 'label', 'February', 'February', '50', 'febrero', 'Label:Month name on credit card page'),
930
+ ('es_ES', 'label', 'March', 'March', '50', 'marzo', 'Label:Month name on credit card page'),
931
+ ('es_ES', 'label', 'April', 'April', '50', 'abril', 'Label:Month name on credit card page'),
932
+ ('es_ES', 'label', 'May', 'May', '50', 'mayo', 'Label:Month name on credit card page'),
933
+ ('es_ES', 'label', 'June', 'June', '50', 'junio', 'Label:Month name on credit card page'),
934
+ ('es_ES', 'label', 'July', 'July', '50', 'julio', 'Label:Month name on credit card page'),
935
+ ('es_ES', 'label', 'August', 'August', '50', 'agosto', 'Label:Month name on credit card page'),
936
+ ('es_ES', 'label', 'September', 'September', '50', 'septiembre', 'Label:Month name on credit card page'),
937
+ ('es_ES', 'label', 'October', 'October', '50', 'octubre', 'Label:Month name on credit card page'),
938
+ ('es_ES', 'label', 'November', 'November', '50', 'noviembre', 'Label:Month name on credit card page'),
939
+ ('es_ES', 'label', 'December', 'December', '50', 'diciembre', 'Label:Month name on credit card page'),
940
+ ('pt_PT', 'message', 'Please_wait', 'Please wait', '100', 'por favor, aguarde', 'Error: When user trigger new action while previous one is still processsing.'),
941
+ ('pt_PT', 'label', 'or', 'or', '25', 'ou', 'Label: Display to show 2 action options.'),
942
+ ('pt_PT', 'label', 'Home', 'Home', '8', 'casa', 'Label: Home page title and button title.'),
943
+ ('pt_PT', 'message', 'No_internet_connection', 'No internet connection', '100', 'Sem conexão com a internet', 'Message:No internet connection'),
944
+ ('pt_PT', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Compras Categoria', 'Label: Shopping Category'),
945
+ ('pt_PT', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', 'Ops! Não existem categorias para mostrar.', 'Text: When no category found.'),
946
+ ('pt_PT', 'label', 'Shop_by_category', 'Shop by category', '25', 'Comprar por categoria', 'Label: Title to show above category names.'),
947
+ ('pt_PT', 'label', 'Categories', 'Categories', '20', 'Categorias', 'Label: Title to show on homepage, above the category.'),
948
+ ('pt_PT', 'label', 'All_Products', 'All Products', '20', 'Todos os produtos', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
949
+ ('pt_PT', 'label', 'Profile', 'Profile', '10', 'perfil', 'Label: Profile page title and button title.'),
950
+ ('pt_PT', 'label', 'List_Page', 'List Page', '15', 'lista de Páginas', 'Label: Page title'),
951
+ ('pt_PT', 'label', 'Product_List', 'Product List', '15', 'Lista de Produtos', 'Label: Product List page title '),
952
+ ('pt_PT', 'label', 'products_found', 'products found', '20', 'produtos encontrados', 'Label: Label displayed on product listing page to show No. of products found. '),
953
+ ('pt_PT', 'label', 'Product_Detail', 'Product Detail', '15', 'Detalhes do produto', 'Label: Product Detail page title'),
954
+ ('pt_PT', 'label', 'Details', 'Details', '10', 'Detalhes', 'Label: Label displayed above the product detail on product detail page.'),
955
+ ('pt_PT', 'label', 'Buy_Now', 'Buy Now', '10', 'comprar agora', 'Label: Buy Now button title.'),
956
+ ('pt_PT', 'label', 'Choose_an_option', 'Choose an option', '20', 'Escolha uma opção', 'Label: First option for product options.'),
957
+ ('pt_PT', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'Item adicionado com êxito', 'Message: When the Item added successfully into the cart. '),
958
+ ('pt_PT', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'Nenhum produto foi encontrado.', 'Text: When no products found for selected search criteria or category.'),
959
+ ('pt_PT', 'label', 'Load_More', 'Load More', '10', 'carregar Mais', 'Label: Load More button title, displayed on product listing pages.'),
960
+ ('pt_PT', 'label', 'Viewers', 'Viewers', '10', 'Espectadores', 'Label: Viewers Label.'),
961
+ ('pt_PT', 'label', 'Add_to_cart', 'Add to cart', '15', 'Adicionar ao carrinho', 'Label: Add to cart button title.'),
962
+ ('pt_PT', 'label', 'Downloadable_link', 'Downloadable link', '20', 'link para download', 'Label: Downloadable link title. '),
963
+ ('pt_PT', 'label', 'Review', 'Review', '10', 'revisão', 'Label: Review text and button title.'),
964
+ ('pt_PT', 'message', 'No_reviews_found', 'No reviews found', '100', 'Nenhum comentário encontrado', 'Text: When no reviews found for selected product.'),
965
+ ('pt_PT', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'carrinho de compras', 'Label: Shopping Cart button title.'),
966
+ ('pt_PT', 'label', 'QTY', 'QTY', '5', 'QTY', 'Label: Label for product Quantity.'),
967
+ ('pt_PT', 'label', 'TOTAL', 'TOTAL', '15', 'TOTAL', 'Label: Label for cart &amp; order total. '),
968
+ ('pt_PT', 'label', 'Subtotal', 'Subtotal', '15', 'subtotal', 'Label: Label for cart &amp; order subtotal.'),
969
+ ('pt_PT', 'label', 'Tax', 'Tax', '5', 'imposto', 'Label: Label for cart &amp; order Tax.'),
970
+ ('pt_PT', 'label', 'Discount', 'Discount', '15', 'desconto', 'Label: Label for cart &amp; order discount. '),
971
+ ('pt_PT', 'label', 'Grand_Total', 'Grand Total', '15', 'total geral', 'Label: Label for cart &amp; order grand total.'),
972
+ ('pt_PT', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'O carrinho de compras está vazio.', 'Error: When the shopping cart is empty.'),
973
+ ('pt_PT', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Carrinho atualizado com sucesso', 'Message: When the cart updated successfully.'),
974
+ ('pt_PT', 'label', 'Update_Cart', 'Update Cart', '15', 'atualização Cart', 'Label: Update Cart button title. '),
975
+ ('pt_PT', 'label', 'Checkout', 'Checkout', '10', 'checkout', 'Label: Checkout button title.'),
976
+ ('pt_PT', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'O carrinho está vazio', 'Text: When the cart is empty. '),
977
+ ('pt_PT', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'Um dos seu carrinho item está tendo problema', 'Text: When one of the cart item is having error such as not available or so.'),
978
+ ('pt_PT', 'label', 'Login', 'Login', '7', 'login', 'Label: Login button title.'),
979
+ ('pt_PT', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'Digite seu nome de usuário senha para ter acesso.', 'Error: When requested action required login.'),
980
+ ('pt_PT', 'label', 'Username', 'Username', '20', 'Nome de Usuário', 'Label: Label for Username field.'),
981
+ ('pt_PT', 'label', 'Password', 'Password', '20', 'senha', 'Label: Label for password field.'),
982
+ ('pt_PT', 'label', 'Sign_Up', 'Sign Up', '10', 'inscrever-se', 'Label: Sign Up button title.'),
983
+ ('pt_PT', 'message', 'Enter_username', 'Enter username', '100', 'Digite o nome de usuário', 'Error: When username is empty.'),
984
+ ('pt_PT', 'message', 'Enter_password', 'Enter password', '100', 'Digite a senha', 'Error: When password is empty. '),
985
+ ('pt_PT', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Nome de usuário ou senha inválida', 'Error: When Invalid username or password entered.'),
986
+ ('pt_PT', 'label', 'First_name', 'First name', '20', 'primeiro nome', 'Label: Label for firstname field.'),
987
+ ('pt_PT', 'label', 'Last_name', 'Last name', '20', 'sobrenome', 'Label: Label for lastname field.'),
988
+ ('pt_PT', 'label', 'Your_Email', 'Your Email', '20', 'seu e-mail', 'Label: Label for email address field.'),
989
+ ('pt_PT', 'label', 'Submit', 'Submit', '10', 'submeter', 'Label: Submit button title.'),
990
+ ('pt_PT', 'label', 'Signup_Form', 'Signup Form', '15', 'Cadastre-Form', 'Label: Signup Form page title.'),
991
+ ('pt_PT', 'label', 'Signup', 'Signup', '10', 'Cadastre-se', 'Label: Signup button title.'),
992
+ ('pt_PT', 'message', 'Enter_firstname', 'Enter firstname', '100', 'Digite o primeiro nome', 'Error: When firstname is empty. '),
993
+ ('pt_PT', 'message', 'Enter_lastname', 'Enter lastname', '100', 'Digite o sobrenome', 'Error: When lastname is empty.'),
994
+ ('pt_PT', 'message', 'Enter_email', 'Enter email', '100', 'Digite o endereço de email', 'Error: When email address is empty.'),
995
+ ('pt_PT', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Por favor insira o endereço de e-mail válido', 'Error: When email address is invalid.'),
996
+ ('pt_PT', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', 'Felicitações! Você está registrado com sucesso', 'Message: When successfully registration has been done. '),
997
+ ('pt_PT', 'message', 'Please_check_your_email', 'Please check your email', '100', 'Por favor, verifique seu e-mail', 'Message: When user reset their password. '),
998
+ ('pt_PT', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Esqueceu sua senha', 'Label: Forgot Password button title.'),
999
+ ('pt_PT', 'label', 'Shipping', 'Shipping', '20', 'remessa', 'Label: Label for Shipping. '),
1000
+ ('pt_PT', 'label', 'Billing', 'Billing', '20', 'faturamento', 'Label: Label for Billing'),
1001
+ ('pt_PT', 'label', 'Address', 'Address', '20', 'endereço', 'Label: Label for address field, available on payment page. '),
1002
+ ('pt_PT', 'label', 'Payment', 'Payment', '20', 'pagamento', 'Label: Label for payment field, available on payment page.'),
1003
+ ('pt_PT', 'label', 'Continue', 'Continue', '20', 'continuar', 'Label: Continue button title. '),
1004
+ ('pt_PT', 'label', 'Billing_Address', 'Billing Address', '20', 'Endereço de Cobrança', 'Label: Label for Billing Address.'),
1005
+ ('pt_PT', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Selecione um endereço de cobrança do seu livro de endereços ou introduzir um novo endereço.', 'Label: Title available on billing addresses drop down.'),
1006
+ ('pt_PT', 'label', 'New_Address', 'New Address', '20', 'novo endereço', 'Label: Title for New Billing Address form.'),
1007
+ ('pt_PT', 'label', 'Company', 'Company', '20', 'companhia', 'Label: Label for company field, available on address page. '),
1008
+ ('pt_PT', 'label', 'City', 'City', '20', 'cidade', 'Label: Label for city field, available on address page. '),
1009
+ ('pt_PT', 'label', 'State', 'State', '20', 'estado', 'Label: Label for state field, available on address page. '),
1010
+ ('pt_PT', 'label', 'Country', 'Country', '20', 'país', 'Label: Label for country field, available on address page. '),
1011
+ ('pt_PT', 'label', 'select', 'select', '20', 'selecionar', 'Label: Label for drop downs. '),
1012
+ ('pt_PT', 'label', 'Billing_street', 'Billing street', '20', 'rua Billing', 'Label: Label for billing street field, available on address page. '),
1013
+ ('pt_PT', 'label', 'Postcode', 'Postcode', '20', 'Código Postal', 'Label: Label for postcode field, available on address page. '),
1014
+ ('pt_PT', 'label', 'Telephone', 'Telephone', '20', 'telefone', 'Label: Label for telephone field, available on address page. '),
1015
+ ('pt_PT', 'label', 'Same_as_billing', 'Same as billing', '25', 'O mesmo que o faturamento', 'Label: Label for Same as billing option. '),
1016
+ ('pt_PT', 'label', 'Shipping_Address', 'Shipping Address', '25', 'Endereço para envio', 'Label: Title for Shipping Address form.'),
1017
+ ('pt_PT', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Selecione um endereço para envio do seu livro de endereços ou introduzir um novo endereço.', 'Label: Title available on shipping addresses drop down.'),
1018
+ ('pt_PT', 'label', 'Shipping_street', 'Shipping street', '25', 'rua envio', 'Label: Label for shipping street field, available on address page. '),
1019
+ ('pt_PT', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Digite o faturamento firstname', 'Error: When billing firstname is empty.'),
1020
+ ('pt_PT', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Digite o faturamento sobrenome', 'Error: When billing lastname is empty.'),
1021
+ ('pt_PT', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Digite cidade de faturamento', 'Error: When billing city is empty.'),
1022
+ ('pt_PT', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Digite o estado de faturamento', 'Error: When billing state is empty.'),
1023
+ ('pt_PT', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Digite o país de faturamento', 'Error: When billing country is empty.'),
1024
+ ('pt_PT', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Digite o faturamento rua', 'Error: When billing street is empty.'),
1025
+ ('pt_PT', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Digite o código postal de faturamento', 'Error: When billing postcode is empty.'),
1026
+ ('pt_PT', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Digite o telefone de faturamento', 'Error: When billing telephone is empty.'),
1027
+ ('pt_PT', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'Digite o transporte firstname', 'Error: When shipping firstname is empty.'),
1028
+ ('pt_PT', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Digite o transporte sobrenome', 'Error: When shipping lastname is empty.'),
1029
+ ('pt_PT', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Digite cidade transporte', 'Error: When shipping city is empty.'),
1030
+ ('pt_PT', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Digite o transporte estado', 'Error: When shipping state is empty.'),
1031
+ ('pt_PT', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Digite o país de envio', 'Error: When shipping country is empty.'),
1032
+ ('pt_PT', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Digite o transporte rua', 'Error: When shipping street is empty.'),
1033
+ ('pt_PT', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Digite o código postal de envio', 'Error: When shipping postcode is empty.'),
1034
+ ('pt_PT', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Digite o transporte telefone', 'Error: When shipping telephone is empty.'),
1035
+ ('pt_PT', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Método de Envio', 'Label: Shipping Method page title. '),
1036
+ ('pt_PT', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Escolha um método de envio', 'Label: Label for Select shipping method options.'),
1037
+ ('pt_PT', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Escolha um método de envio', 'Error: When shipment method is not selected.'),
1038
+ ('pt_PT', 'label', 'Payment_Method', 'Payment Method', '25', 'método de pagamento', 'Label: Payment Method page title. '),
1039
+ ('pt_PT', 'label', 'Select_payment_method', 'Select payment method', '25', 'Escolha um método de pagamento', 'Label: Label for Select payment method options.'),
1040
+ ('pt_PT', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Escolha um método de pagamento', 'Error: When payment method is not selected.'),
1041
+ ('pt_PT', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Ops, algo aconteceu de errado', 'Error: When magento return unexpected error.'),
1042
+ ('pt_PT', 'label', 'Credit_Card', 'Credit Card', '25', 'Cartão de crédito', 'Label: Label for credit card field, available on payment page. '),
1043
+ ('pt_PT', 'label', 'Name_on_card', 'Name on card', '25', 'Nome no cartão', 'Label: Label for name of card field, available on payment page. '),
1044
+ ('pt_PT', 'label', 'Credit_card_type', 'Credit card type', '25', 'Tipo de cartão de crédito', 'Label: Label for CC type field, available on payment page. '),
1045
+ ('pt_PT', 'label', 'Credit_card_number', 'Credit card number', '25', 'Número do cartão de crédito', 'Label: Label for CC number field, available on payment page. '),
1046
+ ('pt_PT', 'label', 'Expiration_Date', 'Expiration Date', '25', 'data de validade', 'Label: Label for CC expiry date field, available on payment page. '),
1047
+ ('pt_PT', 'label', 'Month', 'Month', '25', 'mês', 'Label: Label for CC expiry month field, available on payment page. '),
1048
+ ('pt_PT', 'label', 'Year', 'Year', '25', 'ano', 'Label: Label for CC expiry year field, available on payment page. '),
1049
+ ('pt_PT', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Cartão do número de Verificação', 'Label: Label for CC verification number field, available on payment page. '),
1050
+ ('pt_PT', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Digite o nome no cartão', 'Error: When name on card is empty.'),
1051
+ ('pt_PT', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Selecione o tipo de cartão de crédito', 'Error: When credit card type is not selected.'),
1052
+ ('pt_PT', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Digite o número do cartão de crédito', 'Error: When credit card number is empty.'),
1053
+ ('pt_PT', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Definir mês de vencimento', 'Error: When expiry month is empty.'),
1054
+ ('pt_PT', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Definir ano de expiração', 'Error: When expiry year is empty.'),
1055
+ ('pt_PT', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Defina o número de verificação do cartão', 'Error: When card verification number is empty.'),
1056
+ ('pt_PT', 'label', 'Order_Review', 'Order Review', '15', 'ordem comentário', 'Label: Order Review page title. '),
1057
+ ('pt_PT', 'label', 'Agreements', 'Agreements', '25', 'acordos', 'Label: Label for Agreements, available on oprder review screen.'),
1058
+ ('pt_PT', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Aceite os termos e condições', 'Error: When user did not agreed on sign up terms.'),
1059
+ ('pt_PT', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Shipping &amp; Handling', 'Label: Label for Shipping &amp; Handling.'),
1060
+ ('pt_PT', 'label', 'Place_Order', 'Place Order', '25', 'Faça a sua encomenda', 'Label: Place Order button title.'),
1061
+ ('pt_PT', 'label', 'Order_Success', 'Order Success', '15', 'ordem Sucesso', 'Label: Order Success page title. '),
1062
+ ('pt_PT', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Obrigado por sua compra!', 'Message: When order successfully placed. '),
1063
+ ('pt_PT', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'Você receberá um e-mail de confirmação do pedido, com detalhes do seu pedido e um link para acompanhar seu progresso.', 'Text: When order successfully placed '),
1064
+ ('pt_PT', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'continuar comprando', 'LabeL: Continue Shopping button title. '),
1065
+ ('pt_PT', 'label', 'Error', 'Error', '15', 'erro', 'Label: Error '),
1066
+ ('pt_PT', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'Item adicionado com êxito na lista de desejos', 'Message: When item added into Wishlist.'),
1067
+ ('pt_PT', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Item removido da lista de desejos', 'Message: When Item removed from wishlist.'),
1068
+ ('pt_PT', 'label', 'Wishlist', 'Wishlist', '15', 'Lista de Desejos', 'Label: Wishlist page title. '),
1069
+ ('pt_PT', 'label', 'Remove', 'Remove', '10', 'remover', 'Label: Remove button title.'),
1070
+ ('pt_PT', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'Nenhum item na lista de desejos encontrados', 'Text: When No wishlist items found.'),
1071
+ ('pt_PT', 'label', 'Orders', 'Orders', '15', 'encomendas', 'Label: Orders history page title.'),
1072
+ ('pt_PT', 'label', 'Order_History', 'Order History', '20', 'Histórico de pedidos', 'Label: Order History button title. '),
1073
+ ('pt_PT', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'Sem pedidos encontrado', 'Text: When no order history found. '),
1074
+ ('pt_PT', 'label', 'Order_Detail', 'Order Detail', '15', 'Encomenda', 'Label: Order Detail page title. '),
1075
+ ('pt_PT', 'label', 'Ordered_Items', 'Ordered Items', '25', 'artigos encomendados', 'Label: Ordered Items block heading or title. '),
1076
+ ('pt_PT', 'label', 'Order_Number', 'Order Number', '20', 'número do pedido', 'Label: Label for Order Number.'),
1077
+ ('pt_PT', 'label', 'Order_Date', 'Order Date', '20', 'Data do pedido', 'Label: Label for Order Date.'),
1078
+ ('pt_PT', 'label', 'User', 'User', '10', 'usuário', 'Label: Label for User.'),
1079
+ ('pt_PT', 'label', 'Info', 'Info', '15', 'sobre', 'Label: About page title (CMS/about module)'),
1080
+ ('pt_PT', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'Adicionar à lista de desejos', 'Label: Add To Wishlist button title.'),
1081
+ ('pt_PT', 'label', 'Logout', 'Logout', '10', 'Sair', 'Label: Logout button title.'),
1082
+ ('pt_PT', 'label', 'Search_Product', 'Search Product', '50', 'Pesquisa de produto', 'Label: Search Product.'),
1083
+ ('pt_PT', 'label', 'Apply', 'Apply', '8', 'aplicar', 'Label: Apply button title (to apply discount)'),
1084
+ ('pt_PT', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Código de cupom aplicado com sucesso', 'Message: When coupon code is applied.'),
1085
+ ('pt_PT', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Código de cupom removido com sucesso', 'Message: When coupon code is removed. '),
1086
+ ('pt_PT', 'label', 'Discount_Code', 'Discount Code', '25', 'Código de desconto', 'Label: Label for Discount Code.'),
1087
+ ('pt_PT', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'atualização Lista de Desejos', 'Label: Update Wishlist button title.'),
1088
+ ('pt_PT', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'Item atualizado com sucesso', 'Message: When wishlist updated successfully.'),
1089
+ ('pt_PT', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Carga Cant Desejos item', 'Error: When requested wishlist item Can not Load. '),
1090
+ ('pt_PT', 'message', 'Please_Select', 'Please select ', '25', 'Por favor, selecione', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
1091
+ ('pt_PT', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'Produto links para download', 'Label: Label for Product Downloadable Links.'),
1092
+ ('pt_PT', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Código de cupom inválido', 'Error: When coupon code is invalid.'),
1093
+ ('pt_PT', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Por favor, faça o login para continuar', 'Error: When action required login '),
1094
+ ('pt_PT', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'Digite o primeiro nome', 'Error: When firstname is empty in signup form. '),
1095
+ ('pt_PT', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'Digite o sobrenome', 'Error: When lastname is empty in signup form. '),
1096
+ ('pt_PT', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'Digite o endereço de email', 'Error: When email address is empty in signup form. '),
1097
+ ('pt_PT', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'Digite a senha', 'Error: When password is empty in signup form. '),
1098
+ ('pt_PT', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Conta já existe', 'Error: When email address already exists.'),
1099
+ ('pt_PT', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'Não é possível salvar o endereço do cliente', 'Error: When error occure while saving customer Address.'),
1100
+ ('pt_PT', 'message', 'No_Data_Found', 'No Data Found', '100', 'Não foram encontrados dados', 'Error: When no data found for requested page.'),
1101
+ ('pt_PT', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Produto não está mais disponível', 'Error: When requested product is no londer available.'),
1102
+ ('pt_PT', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'Item solicitado não foi encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1103
+ ('pt_PT', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'Item solicitado não foi encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1104
+ ('pt_PT', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Opps! Item não pode carregar', 'Error: When wishlist can\'t load because of unexpected error.'),
1105
+ ('pt_PT', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'Item solicitado não foi encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1106
+ ('pt_PT', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'Item solicitado não foi encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1107
+ ('pt_PT', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'Item solicitado não foi encontrado', 'Error: When system can not load wishlist Item.'),
1108
+ ('pt_PT', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Já não está disponível item solicitado', 'Error: When requested product is no longer available.'),
1109
+ ('pt_PT', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'O item foi excluído do carrinho', 'Error: When Item has been deleted from cart.'),
1110
+ ('pt_PT', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'Nem todos os produtos estão disponíveis no auantity solicitado', 'Error: When any of the product from cart is no longer available.'),
1111
+ ('pt_PT', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'Aceitar todos os termos e condições antes de colocar a ordem', 'Error: When user did not agree on all required addreement while placing order.'),
1112
+ ('pt_PT', 'label', 'Filter', 'Filter', '10', 'filtro', 'Label: Label for Filters.'),
1113
+ ('pt_PT', 'label', 'Reset_Filter', 'Reset Filter', '15', 'Filter Reset', 'Label: Reset Filter link title.'),
1114
+ ('pt_PT', 'label', 'Reset', 'Reset', '10', 'restabelecer', 'Label: Reset button title.'),
1115
+ ('pt_PT', 'label', 'Popularity', 'Popularity', '25', 'popularidade', 'Label: Label for filter: Popularity option. '),
1116
+ ('pt_PT', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', '-Preço alto para baixo', 'Label: Label for filter: Price-High To Low option. '),
1117
+ ('pt_PT', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', '-Preço Baixo para Alto', 'Label: Label for filter: Price-Low To High option.'),
1118
+ ('pt_PT', 'label', 'Rating', 'Rating', '25', 'classificação', 'Label: Label for filter: Rating option '),
1119
+ ('pt_PT', 'label', 'Name-A_To_Z', 'Name-A To Z', '25', 'Nome-A a Z', 'Label: Label for filter: Name-A To Z option.'),
1120
+ ('pt_PT', 'label', 'Name-Z_To_A', 'Name-Z To A', '25', 'Nome-Z a A', 'Label: Label for filter: Name-Z To A option.'),
1121
+ ('pt_PT', 'label', 'Newest', 'Newest', '25', 'o mais novo', 'Label: Label for filter: Newest option.'),
1122
+ ('pt_PT', 'label', 'Submit_Review', 'Submit Review', '25', 'Enviar comentário', 'Label: Submit Review button title.'),
1123
+ ('pt_PT', 'label', 'User_Reviews', 'User Reviews', '25', 'Comentários dos usuários', 'Label: User Reviews page title. '),
1124
+ ('pt_PT', 'label', 'No_Reviews_Found', 'No Reviews Found', '25', 'Nenhum comentário encontrado', 'Label: Text as No Reviews Found'),
1125
+ ('pt_PT', 'label', 'Average_User_Rating', 'Average User Rating', '25', 'Média por Usuário', 'Label: Label for Average User Rating.'),
1126
+ ('pt_PT', 'label', 'Reviews', 'Reviews', '25', 'avaliações', 'Label: Label for Reviews.'),
1127
+ ('pt_PT', 'label', 'Nickename', 'Nickename', '25', 'Nickename', 'Label: Label for Nickename field, available on submit review form.'),
1128
+ ('pt_PT', 'label', 'Summary_Of_Your_Review', 'Summary Of Your Review', '25', 'Sumário das suas opiniões', 'Label: Label for review summary field, available on submit review form.'),
1129
+ ('pt_PT', 'label', 'Comments', 'Comments', '25', 'comentários', 'Label: Label for comments field, available on submit review form.'),
1130
+ ('pt_PT', 'label', 'You_May_Also_Like', 'You May Also Like', '25', 'Você pode gostar também', 'Label: Label for related product slider on product detail page.'),
1131
+ ('pt_PT', 'message', 'Please_Select_One_Of_Each_Of_The_Ratings', 'Please Select One Of Each Of The Ratings', '100', 'Escolha um de cada uma das classificações', 'Error: When feedback ratings is not selected for the product.'),
1132
+ ('pt_PT', 'message', 'Please_Enter_Nickename', 'Please Enter Nickename', '100', 'Digite seu nickename', 'Error: When feedback nickename is empty.'),
1133
+ ('pt_PT', 'message', 'Please_Enter_Summary', 'Please Enter Summary', '100', 'Insira a resposta global', 'Error: When feedback summary is empty.'),
1134
+ ('pt_PT', 'message', 'Please_Enter_Comments', 'Please Enter Comments', '100', 'Digite os seus comentários', 'Error: When feedback comments is empty.'),
1135
+ ('pt_PT', 'message', 'Plugin_Not_Supported', 'Plugin Not Supported', '100', 'Esta acção não pode ser realizada neste dispositivo. Apoio necessário não está disponível neste dispositivo.', 'Error: When the device is not supported for requested action such as share functionality.'),
1136
+ ('pt_PT', 'label', 'Recently_Viewed', 'Recently Viewed', '25', 'recentemente Visto', 'Label: Recently Viewed'),
1137
+ ('pt_PT', 'label', 'Share', 'Share', '7', 'ação', 'Label:Share button title.'),
1138
+ ('pt_PT', 'label', 'Shopping_Products', 'Shopping Products', '20', 'produtos comerciais', 'Label:Label for Shopping Products, available on left panel on product detail page.'),
1139
+ ('pt_PT', 'label', 'Edit', 'Edit', '6', 'editar', 'Label:Edit button title, available on wishlist page. '),
1140
+ ('pt_PT', 'label', 'More_Information', 'More Information', '25', 'Mais informações', 'Label:More information about product'),
1141
+ ('pt_PT', 'label', 'Share_App', 'Share App', '12', 'Compartilhar App', 'Label:Share app on CMS page'),
1142
+ ('pt_PT', 'label', 'Sample_Links', 'Sample Links', '20', 'Amostra Ligações', 'Label:Sample Links on product detail page'),
1143
+ ('pt_PT', 'label', 'Maximum_Number_Of_Characters', 'Maximum number of characters', '50', 'O número máximo de caracteres', 'Label:Maximum number of characters for configurable product'),
1144
+ ('pt_PT', 'message', 'Payment_Cancelled', 'Payment Cancelled', '50', 'Pagamento Cancelado', 'Message:Payment cancelled when user cancel payment'),
1145
+ ('pt_PT', 'label', 'Tracking_Numbers', 'Tracking Numbers', '50', 'Números de Rastreamento', 'Label:Tracking Numbers on order detail page'),
1146
+ ('pt_PT', 'label', 'Track', 'Track', '15', 'pista', 'Label:Button on order detail page'),
1147
+ ('pt_PT', 'label', 'Installment', 'Installment', '15', 'prestação', 'Label:On product detail page'),
1148
+ ('pt_PT', 'label', 'Installment_Amount', 'Installment Amount', '20', 'valor da prestação', 'Label:On product detail page'),
1149
+ ('pt_PT', 'label', 'Total_Amount', 'Total Amount', '15', 'montante total', 'Label:On product detail page'),
1150
+ ('pt_PT', 'label', 'Single_Shot', 'Single Shot', '15', 'Single Shot', 'Label:For payuapi gateway on credit card page'),
1151
+ ('pt_PT', 'message', 'Please_select_installment_option', 'Please Select Installment Option', '100', 'Por favor, Selecione a opção de parcelamento', 'Message:On credit card page where installment option is required'),
1152
+ ('pt_PT', 'label', 'January', 'January', '50', 'janeiro', 'Label:Month name on credit card page'),
1153
+ ('pt_PT', 'label', 'February', 'February', '50', 'fevereiro', 'Label:Month name on credit card page'),
1154
+ ('pt_PT', 'label', 'March', 'March', '50', 'março', 'Label:Month name on credit card page'),
1155
+ ('pt_PT', 'label', 'April', 'April', '50', 'abril', 'Label:Month name on credit card page'),
1156
+ ('pt_PT', 'label', 'May', 'May', '50', 'maio', 'Label:Month name on credit card page'),
1157
+ ('pt_PT', 'label', 'June', 'June', '50', 'Junho', 'Label:Month name on credit card page'),
1158
+ ('pt_PT', 'label', 'July', 'July', '50', 'Julho', 'Label:Month name on credit card page'),
1159
+ ('pt_PT', 'label', 'August', 'August', '50', 'Agosto', 'Label:Month name on credit card page'),
1160
+ ('pt_PT', 'label', 'September', 'September', '50', 'setembro', 'Label:Month name on credit card page'),
1161
+ ('pt_PT', 'label', 'October', 'October', '50', 'outubro', 'Label:Month name on credit card page'),
1162
+ ('pt_PT', 'label', 'November', 'November', '50', 'novembro', 'Label:Month name on credit card page'),
1163
+ ('pt_PT', 'label', 'December', 'December', '50', 'dezembro', 'Label:Month name on credit card page'),
1164
+ ('de_DE', 'message', 'Please_wait', 'Please wait', '100', 'warten Sie mal', 'Error: When user trigger new action while previous one is still processsing.'),
1165
+ ('de_DE', 'label', 'or', 'or', '25', 'oder', 'Label: Display to show 2 action options.'),
1166
+ ('de_DE', 'label', 'Home', 'Home', '8', 'Zuhause', 'Label: Home page title and button title.'),
1167
+ ('de_DE', 'message', 'No_internet_connection', 'No internet connection', '100', 'Keine Internetverbindung', 'Message:No internet connection'),
1168
+ ('de_DE', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Einkaufs Kategorie', 'Label: Shopping Category'),
1169
+ ('de_DE', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', 'Oops! Es gibt keine Kategorien angezeigt.', 'Text: When no category found.'),
1170
+ ('de_DE', 'label', 'Shop_by_category', 'Shop by category', '25', 'Einkaufen nach Kategorie', 'Label: Title to show above category names.'),
1171
+ ('de_DE', 'label', 'Categories', 'Categories', '20', 'Kategorien', 'Label: Title to show on homepage, above the category.'),
1172
+ ('de_DE', 'label', 'All_Products', 'All Products', '20', 'Alle Artikel', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
1173
+ ('de_DE', 'label', 'Profile', 'Profile', '10', 'Profil', 'Label: Profile page title and button title.'),
1174
+ ('de_DE', 'label', 'List_Page', 'List Page', '15', 'Liste Seite', 'Label: Page title'),
1175
+ ('de_DE', 'label', 'Product_List', 'Product List', '15', 'Artikelliste', 'Label: Product List page title '),
1176
+ ('de_DE', 'label', 'products_found', 'products found', '20', 'Produkte gefunden', 'Label: Label displayed on product listing page to show No. of products found. '),
1177
+ ('de_DE', 'label', 'Product_Detail', 'Product Detail', '15', 'Produktbeschreibung', 'Label: Product Detail page title'),
1178
+ ('de_DE', 'label', 'Details', 'Details', '10', 'Einzelheiten', 'Label: Label displayed above the product detail on product detail page.'),
1179
+ ('de_DE', 'label', 'Buy_Now', 'Buy Now', '10', 'jetzt kaufen', 'Label: Buy Now button title.'),
1180
+ ('de_DE', 'label', 'Choose_an_option', 'Choose an option', '20', 'Wählen Sie eine Option', 'Label: First option for product options.'),
1181
+ ('de_DE', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'Artikel erfolgreich hinzugefügt', 'Message: When the Item added successfully into the cart. '),
1182
+ ('de_DE', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'Keine Produkte gefunden.', 'Text: When no products found for selected search criteria or category.'),
1183
+ ('de_DE', 'label', 'Load_More', 'Load More', '10', 'Mehr laden', 'Label: Load More button title, displayed on product listing pages.'),
1184
+ ('de_DE', 'label', 'Viewers', 'Viewers', '10', 'Zuschauer', 'Label: Viewers Label.'),
1185
+ ('de_DE', 'label', 'Add_to_cart', 'Add to cart', '15', 'In den Warenkorb legen', 'Label: Add to cart button title.'),
1186
+ ('de_DE', 'label', 'Downloadable_link', 'Downloadable link', '20', 'Downloadlink', 'Label: Downloadable link title. '),
1187
+ ('de_DE', 'label', 'Review', 'Review', '10', 'Rezension', 'Label: Review text and button title.'),
1188
+ ('de_DE', 'message', 'No_reviews_found', 'No reviews found', '100', 'Keine Bewertungen gefunden', 'Text: When no reviews found for selected product.'),
1189
+ ('de_DE', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'Einkaufswagen', 'Label: Shopping Cart button title.'),
1190
+ ('de_DE', 'label', 'QTY', 'QTY', '5', 'QTY', 'Label: Label for product Quantity.'),
1191
+ ('de_DE', 'label', 'TOTAL', 'TOTAL', '15', 'TOTAL', 'Label: Label for cart &amp; order total. '),
1192
+ ('de_DE', 'label', 'Subtotal', 'Subtotal', '15', 'Zwischensumme', 'Label: Label for cart &amp; order subtotal.'),
1193
+ ('de_DE', 'label', 'Tax', 'Tax', '5', 'Steuer', 'Label: Label for cart &amp; order Tax.'),
1194
+ ('de_DE', 'label', 'Discount', 'Discount', '15', 'Rabatt', 'Label: Label for cart &amp; order discount. '),
1195
+ ('de_DE', 'label', 'Grand_Total', 'Grand Total', '15', 'Gesamtsumme', 'Label: Label for cart &amp; order grand total.'),
1196
+ ('de_DE', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'Der Warenkorb ist noch leer.', 'Error: When the shopping cart is empty.'),
1197
+ ('de_DE', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Warenkorb erfolgreich aktualisiert', 'Message: When the cart updated successfully.'),
1198
+ ('de_DE', 'label', 'Update_Cart', 'Update Cart', '15', 'Warenkorb aktualisieren', 'Label: Update Cart button title. '),
1199
+ ('de_DE', 'label', 'Checkout', 'Checkout', '10', 'Kasse', 'Label: Checkout button title.'),
1200
+ ('de_DE', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'Warenkorb ist leer', 'Text: When the cart is empty. '),
1201
+ ('de_DE', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'Einer Warenkorb Artikel ist mit Problem', 'Text: When one of the cart item is having error such as not available or so.'),
1202
+ ('de_DE', 'label', 'Login', 'Login', '7', 'Login', 'Label: Login button title.'),
1203
+ ('de_DE', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'Geben Sie Ihren Benutzernamen Passwort ein, um Zugang zu erhalten.', 'Error: When requested action required login.'),
1204
+ ('de_DE', 'label', 'Username', 'Username', '20', 'Benutzername', 'Label: Label for Username field.'),
1205
+ ('de_DE', 'label', 'Password', 'Password', '20', 'Passwort', 'Label: Label for password field.'),
1206
+ ('de_DE', 'label', 'Sign_Up', 'Sign Up', '10', 'Anmeldung', 'Label: Sign Up button title.'),
1207
+ ('de_DE', 'message', 'Enter_username', 'Enter username', '100', 'Geben Sie Benutzernamen', 'Error: When username is empty.'),
1208
+ ('de_DE', 'message', 'Enter_password', 'Enter password', '100', 'Geben Sie das Passwort', 'Error: When password is empty. '),
1209
+ ('de_DE', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Benutzername oder Passwort ungültig', 'Error: When Invalid username or password entered.'),
1210
+ ('de_DE', 'label', 'First_name', 'First name', '20', 'Vorname', 'Label: Label for firstname field.'),
1211
+ ('de_DE', 'label', 'Last_name', 'Last name', '20', 'nachname', 'Label: Label for lastname field.'),
1212
+ ('de_DE', 'label', 'Your_Email', 'Your Email', '20', 'Ihre E-Mail', 'Label: Label for email address field.'),
1213
+ ('de_DE', 'label', 'Submit', 'Submit', '10', 'einreichen', 'Label: Submit button title.'),
1214
+ ('de_DE', 'label', 'Signup_Form', 'Signup Form', '15', 'Anmeldeformular', 'Label: Signup Form page title.'),
1215
+ ('de_DE', 'label', 'Signup', 'Signup', '10', 'Anmelden', 'Label: Signup button title.'),
1216
+ ('de_DE', 'message', 'Enter_firstname', 'Enter firstname', '100', 'Geben Sie Vorname', 'Error: When firstname is empty. '),
1217
+ ('de_DE', 'message', 'Enter_lastname', 'Enter lastname', '100', 'Geben Sie Nachname', 'Error: When lastname is empty.'),
1218
+ ('de_DE', 'message', 'Enter_email', 'Enter email', '100', 'Email Adresse angeben', 'Error: When email address is empty.'),
1219
+ ('de_DE', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Bitte geben Sie eine gültige E-Mail Adresse', 'Error: When email address is invalid.'),
1220
+ ('de_DE', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', 'Herzlichen Glückwunsch! Sie sind erfolgreich registriert', 'Message: When successfully registration has been done. '),
1221
+ ('de_DE', 'message', 'Please_check_your_email', 'Please check your email', '100', 'Bitte überprüfen Sie Ihre E-Mail-', 'Message: When user reset their password. '),
1222
+ ('de_DE', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Passwort vergessen', 'Label: Forgot Password button title.'),
1223
+ ('de_DE', 'label', 'Shipping', 'Shipping', '20', 'Versand', 'Label: Label for Shipping. '),
1224
+ ('de_DE', 'label', 'Billing', 'Billing', '20', 'Billing', 'Label: Label for Billing'),
1225
+ ('de_DE', 'label', 'Address', 'Address', '20', 'Anschrift', 'Label: Label for address field, available on payment page. '),
1226
+ ('de_DE', 'label', 'Payment', 'Payment', '20', 'Bezahlung', 'Label: Label for payment field, available on payment page.'),
1227
+ ('de_DE', 'label', 'Continue', 'Continue', '20', 'fortsetzen', 'Label: Continue button title. '),
1228
+ ('de_DE', 'label', 'Billing_Address', 'Billing Address', '20', 'Rechnungsadresse', 'Label: Label for Billing Address.'),
1229
+ ('de_DE', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Wählen Sie eine Rechnungsadresse aus dem Adressbuch oder geben Sie eine neue Adresse.', 'Label: Title available on billing addresses drop down.'),
1230
+ ('de_DE', 'label', 'New_Address', 'New Address', '20', 'neue Adresse', 'Label: Title for New Billing Address form.'),
1231
+ ('de_DE', 'label', 'Company', 'Company', '20', 'Unternehmen', 'Label: Label for company field, available on address page. '),
1232
+ ('de_DE', 'label', 'City', 'City', '20', 'City', 'Label: Label for city field, available on address page. '),
1233
+ ('de_DE', 'label', 'State', 'State', '20', 'Zustand', 'Label: Label for state field, available on address page. '),
1234
+ ('de_DE', 'label', 'Country', 'Country', '20', 'Land', 'Label: Label for country field, available on address page. '),
1235
+ ('de_DE', 'label', 'select', 'select', '20', 'wählen', 'Label: Label for drop downs. '),
1236
+ ('de_DE', 'label', 'Billing_street', 'Billing street', '20', 'Billing Straße', 'Label: Label for billing street field, available on address page. '),
1237
+ ('de_DE', 'label', 'Postcode', 'Postcode', '20', 'PLZ', 'Label: Label for postcode field, available on address page. '),
1238
+ ('de_DE', 'label', 'Telephone', 'Telephone', '20', 'Telefon', 'Label: Label for telephone field, available on address page. '),
1239
+ ('de_DE', 'label', 'Same_as_billing', 'Same as billing', '25', 'Gleich wie Rechnungs', 'Label: Label for Same as billing option. '),
1240
+ ('de_DE', 'label', 'Shipping_Address', 'Shipping Address', '25', 'Versandadresse', 'Label: Title for Shipping Address form.'),
1241
+ ('de_DE', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Wählen Sie eine Lieferadresse aus dem Adressbuch oder geben Sie eine neue Adresse.', 'Label: Title available on shipping addresses drop down.'),
1242
+ ('de_DE', 'label', 'Shipping_street', 'Shipping street', '25', 'Liefer- Straße', 'Label: Label for shipping street field, available on address page. '),
1243
+ ('de_DE', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Geben Abrechnung Vorname', 'Error: When billing firstname is empty.'),
1244
+ ('de_DE', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Geben Abrechnung Nachname', 'Error: When billing lastname is empty.'),
1245
+ ('de_DE', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Geben Sie die Abrechnung Stadt', 'Error: When billing city is empty.'),
1246
+ ('de_DE', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Geben Abrechnung Zustand', 'Error: When billing state is empty.'),
1247
+ ('de_DE', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Geben Sie die Abrechnung Land', 'Error: When billing country is empty.'),
1248
+ ('de_DE', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Geben Sie die Abrechnung Straße', 'Error: When billing street is empty.'),
1249
+ ('de_DE', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Geben Sie die Abrechnung Postleitzahl', 'Error: When billing postcode is empty.'),
1250
+ ('de_DE', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Geben Abrechnung Telefon', 'Error: When billing telephone is empty.'),
1251
+ ('de_DE', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'Geben Versand Vorname', 'Error: When shipping firstname is empty.'),
1252
+ ('de_DE', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Geben Versand Nachname', 'Error: When shipping lastname is empty.'),
1253
+ ('de_DE', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Geben Versand Stadt', 'Error: When shipping city is empty.'),
1254
+ ('de_DE', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Geben Sie Verschiffen-Zustand', 'Error: When shipping state is empty.'),
1255
+ ('de_DE', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Geben Lieferland', 'Error: When shipping country is empty.'),
1256
+ ('de_DE', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Geben Versand Straße', 'Error: When shipping street is empty.'),
1257
+ ('de_DE', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Geben Versand Postleitzahl', 'Error: When shipping postcode is empty.'),
1258
+ ('de_DE', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Geben Versand Telefon', 'Error: When shipping telephone is empty.'),
1259
+ ('de_DE', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Versandart', 'Label: Shipping Method page title. '),
1260
+ ('de_DE', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Wählen Sie Versandart', 'Label: Label for Select shipping method options.'),
1261
+ ('de_DE', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Wählen Sie Versandart', 'Error: When shipment method is not selected.'),
1262
+ ('de_DE', 'label', 'Payment_Method', 'Payment Method', '25', 'Zahlungsmethode', 'Label: Payment Method page title. '),
1263
+ ('de_DE', 'label', 'Select_payment_method', 'Select payment method', '25', 'Wählen Sie die Zahlungsmethode', 'Label: Label for Select payment method options.'),
1264
+ ('de_DE', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Wählen Sie die Zahlungsmethode', 'Error: When payment method is not selected.'),
1265
+ ('de_DE', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Hoppla, etwas nicht passiert', 'Error: When magento return unexpected error.'),
1266
+ ('de_DE', 'label', 'Credit_Card', 'Credit Card', '25', 'Kreditkarte', 'Label: Label for credit card field, available on payment page. '),
1267
+ ('de_DE', 'label', 'Name_on_card', 'Name on card', '25', 'Name auf der Karte', 'Label: Label for name of card field, available on payment page. '),
1268
+ ('de_DE', 'label', 'Credit_card_type', 'Credit card type', '25', 'Kreditkartentyp', 'Label: Label for CC type field, available on payment page. '),
1269
+ ('de_DE', 'label', 'Credit_card_number', 'Credit card number', '25', 'Kreditkartennummer', 'Label: Label for CC number field, available on payment page. '),
1270
+ ('de_DE', 'label', 'Expiration_Date', 'Expiration Date', '25', 'Verfallsdatum', 'Label: Label for CC expiry date field, available on payment page. '),
1271
+ ('de_DE', 'label', 'Month', 'Month', '25', 'Monat', 'Label: Label for CC expiry month field, available on payment page. '),
1272
+ ('de_DE', 'label', 'Year', 'Year', '25', 'Jahr', 'Label: Label for CC expiry year field, available on payment page. '),
1273
+ ('de_DE', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Kartenprüfnummer', 'Label: Label for CC verification number field, available on payment page. '),
1274
+ ('de_DE', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Geben Sie den Namen auf der Karte', 'Error: When name on card is empty.'),
1275
+ ('de_DE', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Wählen Sie Kreditkartentyp', 'Error: When credit card type is not selected.'),
1276
+ ('de_DE', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Geben Sie Ihre Kreditkartennummer', 'Error: When credit card number is empty.'),
1277
+ ('de_DE', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Stellen Verfallmonat', 'Error: When expiry month is empty.'),
1278
+ ('de_DE', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Stellen Ablauf Jahr', 'Error: When expiry year is empty.'),
1279
+ ('de_DE', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Stellen Kartenprüfnummer', 'Error: When card verification number is empty.'),
1280
+ ('de_DE', 'label', 'Order_Review', 'Order Review', '15', 'Bestellen schreiben', 'Label: Order Review page title. '),
1281
+ ('de_DE', 'label', 'Agreements', 'Agreements', '25', 'Vereinbarungen', 'Label: Label for Agreements, available on oprder review screen.'),
1282
+ ('de_DE', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Bedingungen bestätigen und Zustand', 'Error: When user did not agreed on sign up terms.'),
1283
+ ('de_DE', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Shipping &amp; Handling', 'Label: Label for Shipping &amp; Handling.'),
1284
+ ('de_DE', 'label', 'Place_Order', 'Place Order', '25', 'Bestellung aufgeben', 'Label: Place Order button title.'),
1285
+ ('de_DE', 'label', 'Order_Success', 'Order Success', '15', 'Bestellen Success', 'Label: Order Success page title. '),
1286
+ ('de_DE', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Vielen Dank für Ihren Einkauf!', 'Message: When order successfully placed. '),
1287
+ ('de_DE', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'Sie erhalten eine Auftragsbestätigung per E-Mail mit Einzelheiten zur Bestellung und einen Link zu seinem Fortschritt zu verfolgen empfangen.', 'Text: When order successfully placed '),
1288
+ ('de_DE', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'Weiter Warenkorb', 'LabeL: Continue Shopping button title. '),
1289
+ ('de_DE', 'label', 'Error', 'Error', '15', 'Fehler', 'Label: Error '),
1290
+ ('de_DE', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'Artikel erfolgreich in Wunschliste hinzugefügt', 'Message: When item added into Wishlist.'),
1291
+ ('de_DE', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Artikel von der Wunschliste entfernen', 'Message: When Item removed from wishlist.'),
1292
+ ('de_DE', 'label', 'Wishlist', 'Wishlist', '15', 'Wunschzettel', 'Label: Wishlist page title. '),
1293
+ ('de_DE', 'label', 'Remove', 'Remove', '10', 'entfernen', 'Label: Remove button title.'),
1294
+ ('de_DE', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'Keine Artikel in der Wunschliste finden', 'Text: When No wishlist items found.'),
1295
+ ('de_DE', 'label', 'Orders', 'Orders', '15', 'Bestellungen', 'Label: Orders history page title.'),
1296
+ ('de_DE', 'label', 'Order_History', 'Order History', '20', 'Bestellhistorie', 'Label: Order History button title. '),
1297
+ ('de_DE', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'Keine Aufträge gefunden', 'Text: When no order history found. '),
1298
+ ('de_DE', 'label', 'Order_Detail', 'Order Detail', '15', 'bestellen Detail', 'Label: Order Detail page title. '),
1299
+ ('de_DE', 'label', 'Ordered_Items', 'Ordered Items', '25', 'bestellte Artikel', 'Label: Ordered Items block heading or title. '),
1300
+ ('de_DE', 'label', 'Order_Number', 'Order Number', '20', 'Bestellnummer', 'Label: Label for Order Number.'),
1301
+ ('de_DE', 'label', 'Order_Date', 'Order Date', '20', 'Bestelldatum', 'Label: Label for Order Date.'),
1302
+ ('de_DE', 'label', 'User', 'User', '10', 'Benutzer', 'Label: Label for User.'),
1303
+ ('de_DE', 'label', 'Info', 'Info', '15', 'über', 'Label: About page title (CMS/about module)'),
1304
+ ('de_DE', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'Zur Wunschliste hinzufügen', 'Label: Add To Wishlist button title.'),
1305
+ ('de_DE', 'label', 'Logout', 'Logout', '10', 'Logout', 'Label: Logout button title.'),
1306
+ ('de_DE', 'label', 'Search_Product', 'Search Product', '50', 'Suche Produkt', 'Label: Search Product.'),
1307
+ ('de_DE', 'label', 'Apply', 'Apply', '8', 'anwenden', 'Label: Apply button title (to apply discount)'),
1308
+ ('de_DE', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Gutscheincodes erfolgreich angewendet', 'Message: When coupon code is applied.'),
1309
+ ('de_DE', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Gutscheincodes Erfolgreich entfernt', 'Message: When coupon code is removed. '),
1310
+ ('de_DE', 'label', 'Discount_Code', 'Discount Code', '25', 'Rabatt-Code', 'Label: Label for Discount Code.'),
1311
+ ('de_DE', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'aktualisieren Wunschzettel', 'Label: Update Wishlist button title.'),
1312
+ ('de_DE', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'Artikel erfolgreich aktualisiert', 'Message: When wishlist updated successfully.'),
1313
+ ('de_DE', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Cant Last Wunschzettel Artikel', 'Error: When requested wishlist item Can not Load. '),
1314
+ ('de_DE', 'message', 'Please_Select', 'Please select ', '25', 'Bitte wählen', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
1315
+ ('de_DE', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'Produkt-Links zum Herunterladen', 'Label: Label for Product Downloadable Links.'),
1316
+ ('de_DE', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Ungültige Gutscheincode', 'Error: When coupon code is invalid.'),
1317
+ ('de_DE', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Bitte einloggen, um fortzufahren', 'Error: When action required login '),
1318
+ ('de_DE', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'Geben Sie Vorname', 'Error: When firstname is empty in signup form. '),
1319
+ ('de_DE', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'Geben Sie Nachname', 'Error: When lastname is empty in signup form. '),
1320
+ ('de_DE', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'Email Adresse angeben', 'Error: When email address is empty in signup form. '),
1321
+ ('de_DE', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'Geben Sie das Passwort', 'Error: When password is empty in signup form. '),
1322
+ ('de_DE', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Konto ist bereits vorhanden', 'Error: When email address already exists.'),
1323
+ ('de_DE', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'Kundenadresse kann nicht gespeichert werden', 'Error: When error occure while saving customer Address.'),
1324
+ ('de_DE', 'message', 'No_Data_Found', 'No Data Found', '100', 'Keine Daten gefunden', 'Error: When no data found for requested page.'),
1325
+ ('de_DE', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Produkt nicht mehr verfügbar', 'Error: When requested product is no londer available.'),
1326
+ ('de_DE', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'Artikel nicht gefunden', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1327
+ ('de_DE', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'Artikel nicht gefunden', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1328
+ ('de_DE', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Upps! Artikel kann nicht geladen', 'Error: When wishlist can\'t load because of unexpected error.'),
1329
+ ('de_DE', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'Artikel nicht gefunden', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1330
+ ('de_DE', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'Artikel nicht gefunden', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1331
+ ('de_DE', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'Artikel nicht gefunden', 'Error: When system can not load wishlist Item.'),
1332
+ ('de_DE', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Gewünschten Artikel nicht mehr verfügbar', 'Error: When requested product is no longer available.'),
1333
+ ('de_DE', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'Artikel wurde aus dem Warenkorb gelöscht', 'Error: When Item has been deleted from cart.'),
1334
+ ('de_DE', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'Nicht alle Produkte sind in der gewünschten auantity', 'Error: When any of the product from cart is no longer available.'),
1335
+ ('de_DE', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'Akzeptieren Sie alle Bedingungen und Konditionen vor der Bestellung', 'Error: When user did not agree on all required addreement while placing order.'),
1336
+ ('de_DE', 'label', 'Filter', 'Filter', '10', 'Filter', 'Label: Label for Filters.'),
1337
+ ('de_DE', 'label', 'Reset_Filter', 'Reset Filter', '15', 'Filter zurücksetzen', 'Label: Reset Filter link title.'),
1338
+ ('de_DE', 'label', 'Reset', 'Reset', '10', 'rücksetzen', 'Label: Reset button title.'),
1339
+ ('de_DE', 'label', 'Popularity', 'Popularity', '25', 'Beliebtheit', 'Label: Label for filter: Popularity option. '),
1340
+ ('de_DE', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', 'Preis-Hoch zu Niedrig', 'Label: Label for filter: Price-High To Low option. '),
1341
+ ('de_DE', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', 'Preis-Niedrig zu Hoch', 'Label: Label for filter: Price-Low To High option.'),
1342
+ ('de_DE', 'label', 'Rating', 'Rating', '25', 'Wertung', 'Label: Label for filter: Rating option '),
1343
+ ('de_DE', 'label', 'Name-A_To_Z', 'Name-A To Z', '25', 'Name-A To Z', 'Label: Label for filter: Name-A To Z option.'),
1344
+ ('de_DE', 'label', 'Name-Z_To_A', 'Name-Z To A', '25', 'Name-Z bis A', 'Label: Label for filter: Name-Z To A option.'),
1345
+ ('de_DE', 'label', 'Newest', 'Newest', '25', 'neueste', 'Label: Label for filter: Newest option.'),
1346
+ ('de_DE', 'label', 'Submit_Review', 'Submit Review', '25', 'Bewertung abschicken', 'Label: Submit Review button title.'),
1347
+ ('de_DE', 'label', 'User_Reviews', 'User Reviews', '25', 'Testberichte', 'Label: User Reviews page title. '),
1348
+ ('de_DE', 'label', 'No_Reviews_Found', 'No Reviews Found', '25', 'Keine Bewertungen gefunden', 'Label: Text as No Reviews Found'),
1349
+ ('de_DE', 'label', 'Average_User_Rating', 'Average User Rating', '25', 'Average User Rating', 'Label: Label for Average User Rating.'),
1350
+ ('de_DE', 'label', 'Reviews', 'Reviews', '25', 'Bewertungen', 'Label: Label for Reviews.'),
1351
+ ('de_DE', 'label', 'Nickename', 'Nickename', '25', 'Nickename', 'Label: Label for Nickename field, available on submit review form.'),
1352
+ ('de_DE', 'label', 'Summary_Of_Your_Review', 'Summary Of Your Review', '25', 'Zusammenfassung Ihrer Kundenmeinung', 'Label: Label for review summary field, available on submit review form.'),
1353
+ ('de_DE', 'label', 'Comments', 'Comments', '25', 'Kommentare', 'Label: Label for comments field, available on submit review form.'),
1354
+ ('de_DE', 'label', 'You_May_Also_Like', 'You May Also Like', '25', 'Sie können auch lieben', 'Label: Label for related product slider on product detail page.'),
1355
+ ('de_DE', 'message', 'Please_Select_One_Of_Each_Of_The_Ratings', 'Please Select One Of Each Of The Ratings', '100', 'Wählen eines von jedem der Bewertungen', 'Error: When feedback ratings is not selected for the product.'),
1356
+ ('de_DE', 'message', 'Please_Enter_Nickename', 'Please Enter Nickename', '100', 'Geben Sie Ihre nickename', 'Error: When feedback nickename is empty.'),
1357
+ ('de_DE', 'message', 'Please_Enter_Summary', 'Please Enter Summary', '100', 'Geben Sie Feedback insgesamt', 'Error: When feedback summary is empty.'),
1358
+ ('de_DE', 'message', 'Please_Enter_Comments', 'Please Enter Comments', '100', 'Geben Sie Ihre Bemerkungen', 'Error: When feedback comments is empty.'),
1359
+ ('de_DE', 'message', 'Plugin_Not_Supported', 'Plugin Not Supported', '100', 'Diese Aktion kann nicht auf diesem Gerät ausgeführt werden. Erforderliche Unterstützung ist auf diesem Gerät nicht verfügbar.', 'Error: When the device is not supported for requested action such as share functionality.'),
1360
+ ('de_DE', 'label', 'Recently_Viewed', 'Recently Viewed', '25', 'Vor kurzem angesehen', 'Label: Recently Viewed'),
1361
+ ('de_DE', 'label', 'Share', 'Share', '7', 'Aktie', 'Label:Share button title.'),
1362
+ ('de_DE', 'label', 'Shopping_Products', 'Shopping Products', '20', 'Einkaufs Produkte', 'Label:Label for Shopping Products, available on left panel on product detail page.'),
1363
+ ('de_DE', 'label', 'Edit', 'Edit', '6', 'bearbeiten', 'Label:Edit button title, available on wishlist page. '),
1364
+ ('de_DE', 'label', 'More_Information', 'More Information', '25', 'Weitere Informationen', 'Label:More information about product'),
1365
+ ('de_DE', 'label', 'Share_App', 'Share App', '12', 'Teilen App', 'Label:Share app on CMS page'),
1366
+ ('de_DE', 'label', 'Sample_Links', 'Sample Links', '20', 'Probe-Links', 'Label:Sample Links on product detail page'),
1367
+ ('de_DE', 'label', 'Maximum_Number_Of_Characters', 'Maximum number of characters', '50', 'Maximale Anzahl der Zeichen', 'Label:Maximum number of characters for configurable product'),
1368
+ ('de_DE', 'message', 'Payment_Cancelled', 'Payment Cancelled', '50', 'Payment Cancelled', 'Message:Payment cancelled when user cancel payment'),
1369
+ ('de_DE', 'label', 'Tracking_Numbers', 'Tracking Numbers', '50', 'Tracking-Nummern', 'Label:Tracking Numbers on order detail page'),
1370
+ ('de_DE', 'label', 'Track', 'Track', '15', 'Spur', 'Label:Button on order detail page'),
1371
+ ('de_DE', 'label', 'Installment', 'Installment', '15', 'Rate', 'Label:On product detail page'),
1372
+ ('de_DE', 'label', 'Installment_Amount', 'Installment Amount', '20', 'Ratenzahlung', 'Label:On product detail page'),
1373
+ ('de_DE', 'label', 'Total_Amount', 'Total Amount', '15', 'Gesamtbetrag', 'Label:On product detail page'),
1374
+ ('de_DE', 'label', 'Single_Shot', 'Single Shot', '15', 'Single Shot', 'Label:For payuapi gateway on credit card page'),
1375
+ ('de_DE', 'message', 'Please_select_installment_option', 'Please Select Installment Option', '100', 'Bitte wählen Raten Option', 'Message:On credit card page where installment option is required'),
1376
+ ('de_DE', 'label', 'January', 'January', '50', 'Januar', 'Label:Month name on credit card page'),
1377
+ ('de_DE', 'label', 'February', 'February', '50', 'Februar', 'Label:Month name on credit card page'),
1378
+ ('de_DE', 'label', 'March', 'March', '50', 'März', 'Label:Month name on credit card page'),
1379
+ ('de_DE', 'label', 'April', 'April', '50', 'April', 'Label:Month name on credit card page'),
1380
+ ('de_DE', 'label', 'May', 'May', '50', 'Mai', 'Label:Month name on credit card page'),
1381
+ ('de_DE', 'label', 'June', 'June', '50', 'Juni', 'Label:Month name on credit card page'),
1382
+ ('de_DE', 'label', 'July', 'July', '50', 'Juli', 'Label:Month name on credit card page'),
1383
+ ('de_DE', 'label', 'August', 'August', '50', 'August', 'Label:Month name on credit card page'),
1384
+ ('de_DE', 'label', 'September', 'September', '50', 'September', 'Label:Month name on credit card page'),
1385
+ ('de_DE', 'label', 'October', 'October', '50', 'Oktober', 'Label:Month name on credit card page'),
1386
+ ('de_DE', 'label', 'November', 'November', '50', 'November', 'Label:Month name on credit card page'),
1387
+ ('de_DE', 'label', 'December', 'December', '50', 'Dezember', 'Label:Month name on credit card page'),
1388
+ ('fr_FR', 'message', 'Please_wait', 'Please wait', '100', 'Se il vous plaît, attendez', 'Error: When user trigger new action while previous one is still processsing.'),
1389
+ ('fr_FR', 'label', 'or', 'or', '25', 'ou', 'Label: Display to show 2 action options.'),
1390
+ ('fr_FR', 'label', 'Home', 'Home', '8', 'maison', 'Label: Home page title and button title.'),
1391
+ ('fr_FR', 'message', 'No_internet_connection', 'No internet connection', '100', 'Pas de connexion Internet', 'Message:No internet connection'),
1392
+ ('fr_FR', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Catégorie Panier', 'Label: Shopping Category'),
1393
+ ('fr_FR', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', 'Oops! Il n\'y a pas de catégories à afficher.', 'Text: When no category found.'),
1394
+ ('fr_FR', 'label', 'Shop_by_category', 'Shop by category', '25', 'Magasiner par catégorie', 'Label: Title to show above category names.'),
1395
+ ('fr_FR', 'label', 'Categories', 'Categories', '20', 'Catégories', 'Label: Title to show on homepage, above the category.'),
1396
+ ('fr_FR', 'label', 'All_Products', 'All Products', '20', 'tous les produits', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
1397
+ ('fr_FR', 'label', 'Profile', 'Profile', '10', 'profil', 'Label: Profile page title and button title.'),
1398
+ ('fr_FR', 'label', 'List_Page', 'List Page', '15', 'liste page', 'Label: Page title'),
1399
+ ('fr_FR', 'label', 'Product_List', 'Product List', '15', 'Liste des produits', 'Label: Product List page title '),
1400
+ ('fr_FR', 'label', 'products_found', 'products found', '20', 'produits trouvés', 'Label: Label displayed on product listing page to show No. of products found. '),
1401
+ ('fr_FR', 'label', 'Product_Detail', 'Product Detail', '15', 'Détails du produit', 'Label: Product Detail page title'),
1402
+ ('fr_FR', 'label', 'Details', 'Details', '10', 'détails', 'Label: Label displayed above the product detail on product detail page.'),
1403
+ ('fr_FR', 'label', 'Buy_Now', 'Buy Now', '10', 'acheter maintenant', 'Label: Buy Now button title.'),
1404
+ ('fr_FR', 'label', 'Choose_an_option', 'Choose an option', '20', 'Choisissez une option', 'Label: First option for product options.'),
1405
+ ('fr_FR', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'Article ajouté avec succès', 'Message: When the Item added successfully into the cart. '),
1406
+ ('fr_FR', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'Aucun produit trouvé.', 'Text: When no products found for selected search criteria or category.'),
1407
+ ('fr_FR', 'label', 'Load_More', 'Load More', '10', 'Chargez Plus', 'Label: Load More button title, displayed on product listing pages.'),
1408
+ ('fr_FR', 'label', 'Viewers', 'Viewers', '10', 'Les téléspectateurs', 'Label: Viewers Label.'),
1409
+ ('fr_FR', 'label', 'Add_to_cart', 'Add to cart', '15', 'Ajouter au panier', 'Label: Add to cart button title.'),
1410
+ ('fr_FR', 'label', 'Downloadable_link', 'Downloadable link', '20', 'lien téléchargeable', 'Label: Downloadable link title. '),
1411
+ ('fr_FR', 'label', 'Review', 'Review', '10', 'examen', 'Label: Review text and button title.'),
1412
+ ('fr_FR', 'message', 'No_reviews_found', 'No reviews found', '100', 'Aucun commentaire trouvé', 'Text: When no reviews found for selected product.'),
1413
+ ('fr_FR', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'panier', 'Label: Shopping Cart button title.'),
1414
+ ('fr_FR', 'label', 'QTY', 'QTY', '5', 'QTE', 'Label: Label for product Quantity.'),
1415
+ ('fr_FR', 'label', 'TOTAL', 'TOTAL', '15', 'TOTAL', 'Label: Label for cart &amp; order total. '),
1416
+ ('fr_FR', 'label', 'Subtotal', 'Subtotal', '15', 'total', 'Label: Label for cart &amp; order subtotal.'),
1417
+ ('fr_FR', 'label', 'Tax', 'Tax', '5', 'impôt', 'Label: Label for cart &amp; order Tax.'),
1418
+ ('fr_FR', 'label', 'Discount', 'Discount', '15', 'rabais', 'Label: Label for cart &amp; order discount. '),
1419
+ ('fr_FR', 'label', 'Grand_Total', 'Grand Total', '15', 'total', 'Label: Label for cart &amp; order grand total.'),
1420
+ ('fr_FR', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'Le panier est vide.', 'Error: When the shopping cart is empty.'),
1421
+ ('fr_FR', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Panier correctement mis à jour', 'Message: When the cart updated successfully.'),
1422
+ ('fr_FR', 'label', 'Update_Cart', 'Update Cart', '15', 'Mise à jour panier', 'Label: Update Cart button title. '),
1423
+ ('fr_FR', 'label', 'Checkout', 'Checkout', '10', 'caisse', 'Label: Checkout button title.'),
1424
+ ('fr_FR', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'Le panier est vide', 'Text: When the cart is empty. '),
1425
+ ('fr_FR', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'Un panier de votre article est d\'avoir problème', 'Text: When one of the cart item is having error such as not available or so.'),
1426
+ ('fr_FR', 'label', 'Login', 'Login', '7', 'login', 'Label: Login button title.'),
1427
+ ('fr_FR', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'Entrez votre mot de passe nom d\'utilisateur pour obtenir l\'accès.', 'Error: When requested action required login.'),
1428
+ ('fr_FR', 'label', 'Username', 'Username', '20', 'Nom d\'utilisateur', 'Label: Label for Username field.'),
1429
+ ('fr_FR', 'label', 'Password', 'Password', '20', 'mot de passe', 'Label: Label for password field.'),
1430
+ ('fr_FR', 'label', 'Sign_Up', 'Sign Up', '10', 'signer', 'Label: Sign Up button title.'),
1431
+ ('fr_FR', 'message', 'Enter_username', 'Enter username', '100', 'Entrez le nom d\'utilisateur', 'Error: When username is empty.'),
1432
+ ('fr_FR', 'message', 'Enter_password', 'Enter password', '100', 'mot de passe', 'Error: When password is empty. '),
1433
+ ('fr_FR', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Nom d\'utilisateur ou mot de passe invalide', 'Error: When Invalid username or password entered.'),
1434
+ ('fr_FR', 'label', 'First_name', 'First name', '20', 'prénom', 'Label: Label for firstname field.'),
1435
+ ('fr_FR', 'label', 'Last_name', 'Last name', '20', 'nom de famille', 'Label: Label for lastname field.'),
1436
+ ('fr_FR', 'label', 'Your_Email', 'Your Email', '20', 'votre e-mail', 'Label: Label for email address field.'),
1437
+ ('fr_FR', 'label', 'Submit', 'Submit', '10', 'soumettre', 'Label: Submit button title.'),
1438
+ ('fr_FR', 'label', 'Signup_Form', 'Signup Form', '15', 'Formulaire d\'inscription', 'Label: Signup Form page title.'),
1439
+ ('fr_FR', 'label', 'Signup', 'Signup', '10', 'Se inscrire', 'Label: Signup button title.'),
1440
+ ('fr_FR', 'message', 'Enter_firstname', 'Enter firstname', '100', 'Entrez prénom', 'Error: When firstname is empty. '),
1441
+ ('fr_FR', 'message', 'Enter_lastname', 'Enter lastname', '100', 'Entrez nom', 'Error: When lastname is empty.'),
1442
+ ('fr_FR', 'message', 'Enter_email', 'Enter email', '100', 'Entrez l\'adresse e-mail', 'Error: When email address is empty.'),
1443
+ ('fr_FR', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Se il vous plaît entrez l\'adresse e-mail valide', 'Error: When email address is invalid.'),
1444
+ ('fr_FR', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', 'Félicitation! Vous êtes inscrit avec succès', 'Message: When successfully registration has been done. '),
1445
+ ('fr_FR', 'message', 'Please_check_your_email', 'Please check your email', '100', 'Se il vous plaît vérifier votre e-mail', 'Message: When user reset their password. '),
1446
+ ('fr_FR', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Mot de passe oublié', 'Label: Forgot Password button title.'),
1447
+ ('fr_FR', 'label', 'Shipping', 'Shipping', '20', 'livraison', 'Label: Label for Shipping. '),
1448
+ ('fr_FR', 'label', 'Billing', 'Billing', '20', 'facturation', 'Label: Label for Billing'),
1449
+ ('fr_FR', 'label', 'Address', 'Address', '20', 'adresse', 'Label: Label for address field, available on payment page. '),
1450
+ ('fr_FR', 'label', 'Payment', 'Payment', '20', 'paiement', 'Label: Label for payment field, available on payment page.'),
1451
+ ('fr_FR', 'label', 'Continue', 'Continue', '20', 'continuer', 'Label: Continue button title. '),
1452
+ ('fr_FR', 'label', 'Billing_Address', 'Billing Address', '20', 'adresse de facturation', 'Label: Label for Billing Address.'),
1453
+ ('fr_FR', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Sélectionnez une adresse de facturation à partir de votre carnet d\'adresses ou entrer une nouvelle adresse.', 'Label: Title available on billing addresses drop down.'),
1454
+ ('fr_FR', 'label', 'New_Address', 'New Address', '20', 'nouvelle adresse', 'Label: Title for New Billing Address form.'),
1455
+ ('fr_FR', 'label', 'Company', 'Company', '20', 'société', 'Label: Label for company field, available on address page. '),
1456
+ ('fr_FR', 'label', 'City', 'City', '20', 'ville', 'Label: Label for city field, available on address page. '),
1457
+ ('fr_FR', 'label', 'State', 'State', '20', 'état', 'Label: Label for state field, available on address page. '),
1458
+ ('fr_FR', 'label', 'Country', 'Country', '20', 'pays', 'Label: Label for country field, available on address page. '),
1459
+ ('fr_FR', 'label', 'select', 'select', '20', 'sélectionner', 'Label: Label for drop downs. '),
1460
+ ('fr_FR', 'label', 'Billing_street', 'Billing street', '20', 'Rue de facturation', 'Label: Label for billing street field, available on address page. '),
1461
+ ('fr_FR', 'label', 'Postcode', 'Postcode', '20', 'Code Postal', 'Label: Label for postcode field, available on address page. '),
1462
+ ('fr_FR', 'label', 'Telephone', 'Telephone', '20', 'téléphone', 'Label: Label for telephone field, available on address page. '),
1463
+ ('fr_FR', 'label', 'Same_as_billing', 'Same as billing', '25', 'Identique à la facturation', 'Label: Label for Same as billing option. '),
1464
+ ('fr_FR', 'label', 'Shipping_Address', 'Shipping Address', '25', 'adresse de livraison', 'Label: Title for Shipping Address form.'),
1465
+ ('fr_FR', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Sélectionnez une adresse de livraison à partir de votre carnet d\'adresses ou entrer une nouvelle adresse.', 'Label: Title available on shipping addresses drop down.'),
1466
+ ('fr_FR', 'label', 'Shipping_street', 'Shipping street', '25', 'Rue de livraison', 'Label: Label for shipping street field, available on address page. '),
1467
+ ('fr_FR', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Entrez facturation prénom', 'Error: When billing firstname is empty.'),
1468
+ ('fr_FR', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Entrez facturation nom', 'Error: When billing lastname is empty.'),
1469
+ ('fr_FR', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Entrez facturation ville', 'Error: When billing city is empty.'),
1470
+ ('fr_FR', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Entrez Etat de facturation', 'Error: When billing state is empty.'),
1471
+ ('fr_FR', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Entrez pays facturation', 'Error: When billing country is empty.'),
1472
+ ('fr_FR', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Entrez facturation rue', 'Error: When billing street is empty.'),
1473
+ ('fr_FR', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Entrez facturation code postal', 'Error: When billing postcode is empty.'),
1474
+ ('fr_FR', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Entrez facturation téléphonique', 'Error: When billing telephone is empty.'),
1475
+ ('fr_FR', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'Entrez prénom expédition', 'Error: When shipping firstname is empty.'),
1476
+ ('fr_FR', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Entrez nom expédition', 'Error: When shipping lastname is empty.'),
1477
+ ('fr_FR', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Entrez expédition ville', 'Error: When shipping city is empty.'),
1478
+ ('fr_FR', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Entrez Etat expédition', 'Error: When shipping state is empty.'),
1479
+ ('fr_FR', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Entrez le pays de livraison', 'Error: When shipping country is empty.'),
1480
+ ('fr_FR', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Entrer la rue expédition', 'Error: When shipping street is empty.'),
1481
+ ('fr_FR', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Entrez code postal expédition', 'Error: When shipping postcode is empty.'),
1482
+ ('fr_FR', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Entrez téléphone expédition', 'Error: When shipping telephone is empty.'),
1483
+ ('fr_FR', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Mode de livraison', 'Label: Shipping Method page title. '),
1484
+ ('fr_FR', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Sélectionnez la méthode d\'expédition', 'Label: Label for Select shipping method options.'),
1485
+ ('fr_FR', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Sélectionnez la méthode d\'expédition', 'Error: When shipment method is not selected.'),
1486
+ ('fr_FR', 'label', 'Payment_Method', 'Payment Method', '25', 'Mode de paiement', 'Label: Payment Method page title. '),
1487
+ ('fr_FR', 'label', 'Select_payment_method', 'Select payment method', '25', 'Sélectionner la méthode de paiement', 'Label: Label for Select payment method options.'),
1488
+ ('fr_FR', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Sélectionner la méthode de paiement', 'Error: When payment method is not selected.'),
1489
+ ('fr_FR', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Oops, quelque chose de mal se est passé', 'Error: When magento return unexpected error.'),
1490
+ ('fr_FR', 'label', 'Credit_Card', 'Credit Card', '25', 'Carte de crédit', 'Label: Label for credit card field, available on payment page. '),
1491
+ ('fr_FR', 'label', 'Name_on_card', 'Name on card', '25', 'Nom sur la carte', 'Label: Label for name of card field, available on payment page. '),
1492
+ ('fr_FR', 'label', 'Credit_card_type', 'Credit card type', '25', 'Type de carte de crédit', 'Label: Label for CC type field, available on payment page. '),
1493
+ ('fr_FR', 'label', 'Credit_card_number', 'Credit card number', '25', 'Numéro de carte de crédit', 'Label: Label for CC number field, available on payment page. '),
1494
+ ('fr_FR', 'label', 'Expiration_Date', 'Expiration Date', '25', 'date d\'expiration', 'Label: Label for CC expiry date field, available on payment page. '),
1495
+ ('fr_FR', 'label', 'Month', 'Month', '25', 'mois', 'Label: Label for CC expiry month field, available on payment page. '),
1496
+ ('fr_FR', 'label', 'Year', 'Year', '25', 'année', 'Label: Label for CC expiry year field, available on payment page. '),
1497
+ ('fr_FR', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Numéro de la carte de vérification', 'Label: Label for CC verification number field, available on payment page. '),
1498
+ ('fr_FR', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Entrez le nom sur la carte', 'Error: When name on card is empty.'),
1499
+ ('fr_FR', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Sélectionnez le type de carte de crédit', 'Error: When credit card type is not selected.'),
1500
+ ('fr_FR', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Entrez le numéro de carte de crédit', 'Error: When credit card number is empty.'),
1501
+ ('fr_FR', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Régler le mois d\'expiration', 'Error: When expiry month is empty.'),
1502
+ ('fr_FR', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Réglage de l\'année d\'expiration', 'Error: When expiry year is empty.'),
1503
+ ('fr_FR', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Carte Définir le nombre de vérification', 'Error: When card verification number is empty.'),
1504
+ ('fr_FR', 'label', 'Order_Review', 'Order Review', '15', 'afin d\'examen', 'Label: Order Review page title. '),
1505
+ ('fr_FR', 'label', 'Agreements', 'Agreements', '25', 'accords', 'Label: Label for Agreements, available on oprder review screen.'),
1506
+ ('fr_FR', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Accepter les termes et conditions', 'Error: When user did not agreed on sign up terms.'),
1507
+ ('fr_FR', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Frais de port et de manutention', 'Label: Label for Shipping &amp; Handling.'),
1508
+ ('fr_FR', 'label', 'Place_Order', 'Place Order', '25', 'Passer la commande', 'Label: Place Order button title.'),
1509
+ ('fr_FR', 'label', 'Order_Success', 'Order Success', '15', 'afin succès', 'Label: Order Success page title. '),
1510
+ ('fr_FR', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Nous vous remercions de votre achat!', 'Message: When order successfully placed. '),
1511
+ ('fr_FR', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'Vous recevrez un email de confirmation avec les détails de votre commande et un lien pour suivre ses progrès.', 'Text: When order successfully placed '),
1512
+ ('fr_FR', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'continuer vos achats', 'LabeL: Continue Shopping button title. '),
1513
+ ('fr_FR', 'label', 'Error', 'Error', '15', 'erreur', 'Label: Error '),
1514
+ ('fr_FR', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'Article ajouté avec succès dans la liste de souhaits', 'Message: When item added into Wishlist.'),
1515
+ ('fr_FR', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Point retiré de la liste de souhaits', 'Message: When Item removed from wishlist.'),
1516
+ ('fr_FR', 'label', 'Wishlist', 'Wishlist', '15', 'Liste', 'Label: Wishlist page title. '),
1517
+ ('fr_FR', 'label', 'Remove', 'Remove', '10', 'supprimer', 'Label: Remove button title.'),
1518
+ ('fr_FR', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'Aucun élément de cadeaux trouvés', 'Text: When No wishlist items found.'),
1519
+ ('fr_FR', 'label', 'Orders', 'Orders', '15', 'ordres', 'Label: Orders history page title.'),
1520
+ ('fr_FR', 'label', 'Order_History', 'Order History', '20', 'Historique des commandes', 'Label: Order History button title. '),
1521
+ ('fr_FR', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'Pas de commandes trouvé', 'Text: When no order history found. '),
1522
+ ('fr_FR', 'label', 'Order_Detail', 'Order Detail', '15', 'afin Détail', 'Label: Order Detail page title. '),
1523
+ ('fr_FR', 'label', 'Ordered_Items', 'Ordered Items', '25', 'Les articles commandés', 'Label: Ordered Items block heading or title. '),
1524
+ ('fr_FR', 'label', 'Order_Number', 'Order Number', '20', 'numéro de commande', 'Label: Label for Order Number.'),
1525
+ ('fr_FR', 'label', 'Order_Date', 'Order Date', '20', 'date de commande', 'Label: Label for Order Date.'),
1526
+ ('fr_FR', 'label', 'User', 'User', '10', 'utilisateur', 'Label: Label for User.'),
1527
+ ('fr_FR', 'label', 'Info', 'Info', '15', 'sur', 'Label: About page title (CMS/about module)'),
1528
+ ('fr_FR', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'Ajouter à ma liste de cadeaux', 'Label: Add To Wishlist button title.'),
1529
+ ('fr_FR', 'label', 'Logout', 'Logout', '10', 'Déconnexion', 'Label: Logout button title.'),
1530
+ ('fr_FR', 'label', 'Search_Product', 'Search Product', '50', 'Recherche produit', 'Label: Search Product.'),
1531
+ ('fr_FR', 'label', 'Apply', 'Apply', '8', 'appliquer', 'Label: Apply button title (to apply discount)'),
1532
+ ('fr_FR', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Code promo appliquée avec succès', 'Message: When coupon code is applied.'),
1533
+ ('fr_FR', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Code promo retiré avec succès', 'Message: When coupon code is removed. '),
1534
+ ('fr_FR', 'label', 'Discount_Code', 'Discount Code', '25', 'code de Réduction', 'Label: Label for Discount Code.'),
1535
+ ('fr_FR', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'Mise à jour ma liste de cadeaux', 'Label: Update Wishlist button title.'),
1536
+ ('fr_FR', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'Article mis à jour avec succès', 'Message: When wishlist updated successfully.'),
1537
+ ('fr_FR', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Charge Cant WishList', 'Error: When requested wishlist item Can not Load. '),
1538
+ ('fr_FR', 'message', 'Please_Select', 'Please select ', '25', 'Se il vous plaît sélectionnez', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
1539
+ ('fr_FR', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'Produit Liens téléchargeables', 'Label: Label for Product Downloadable Links.'),
1540
+ ('fr_FR', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Code promo valide', 'Error: When coupon code is invalid.'),
1541
+ ('fr_FR', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Se il vous plaît le login pour continuer', 'Error: When action required login '),
1542
+ ('fr_FR', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'Entrez prénom', 'Error: When firstname is empty in signup form. '),
1543
+ ('fr_FR', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'Entrez nom', 'Error: When lastname is empty in signup form. '),
1544
+ ('fr_FR', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'Entrez l\'adresse e-mail', 'Error: When email address is empty in signup form. '),
1545
+ ('fr_FR', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'mot de passe', 'Error: When password is empty in signup form. '),
1546
+ ('fr_FR', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Compte existe déjà', 'Error: When email address already exists.'),
1547
+ ('fr_FR', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'Impossible d\'enregistrer l\'adresse du client', 'Error: When error occure while saving customer Address.'),
1548
+ ('fr_FR', 'message', 'No_Data_Found', 'No Data Found', '100', 'Aucune donnée trouvée', 'Error: When no data found for requested page.'),
1549
+ ('fr_FR', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Produit ne est plus disponible', 'Error: When requested product is no londer available.'),
1550
+ ('fr_FR', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'Article demandé introuvable', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1551
+ ('fr_FR', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'Article demandé introuvable', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1552
+ ('fr_FR', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Opps! Point ne peut pas charger', 'Error: When wishlist can\'t load because of unexpected error.'),
1553
+ ('fr_FR', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'Article demandé introuvable', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1554
+ ('fr_FR', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'Article demandé introuvable', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1555
+ ('fr_FR', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'Article demandé introuvable', 'Error: When system can not load wishlist Item.'),
1556
+ ('fr_FR', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Article demandé ne est plus disponible', 'Error: When requested product is no longer available.'),
1557
+ ('fr_FR', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'Élément a été supprimé du panier', 'Error: When Item has been deleted from cart.'),
1558
+ ('fr_FR', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'Tous les produits ne sont pas disponibles dans le auantity demandé', 'Error: When any of the product from cart is no longer available.'),
1559
+ ('fr_FR', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'Accepter tous les termes et conditions avant de passer commande', 'Error: When user did not agree on all required addreement while placing order.'),
1560
+ ('fr_FR', 'label', 'Filter', 'Filter', '10', 'filtre', 'Label: Label for Filters.'),
1561
+ ('fr_FR', 'label', 'Reset_Filter', 'Reset Filter', '15', 'Réinitialiser le filtre', 'Label: Reset Filter link title.'),
1562
+ ('fr_FR', 'label', 'Reset', 'Reset', '10', 'remettre', 'Label: Reset button title.'),
1563
+ ('fr_FR', 'label', 'Popularity', 'Popularity', '25', 'popularité', 'Label: Label for filter: Popularity option. '),
1564
+ ('fr_FR', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', 'Prix cher au moins cher', 'Label: Label for filter: Price-High To Low option. '),
1565
+ ('fr_FR', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', 'Prix-bas au plus élevé', 'Label: Label for filter: Price-Low To High option.'),
1566
+ ('fr_FR', 'label', 'Rating', 'Rating', '25', 'évaluation', 'Label: Label for filter: Rating option '),
1567
+ ('fr_FR', 'label', 'Name-A_To_Z', 'Name-A To Z', '25', 'Nom-de A à Z', 'Label: Label for filter: Name-A To Z option.'),
1568
+ ('fr_FR', 'label', 'Name-Z_To_A', 'Name-Z To A', '25', 'Nom-Z à A', 'Label: Label for filter: Name-Z To A option.'),
1569
+ ('fr_FR', 'label', 'Newest', 'Newest', '25', 'Date', 'Label: Label for filter: Newest option.'),
1570
+ ('fr_FR', 'label', 'Submit_Review', 'Submit Review', '25', 'Poster le commentaire', 'Label: Submit Review button title.'),
1571
+ ('fr_FR', 'label', 'User_Reviews', 'User Reviews', '25', 'Avis des utilisateurs', 'Label: User Reviews page title. '),
1572
+ ('fr_FR', 'label', 'No_Reviews_Found', 'No Reviews Found', '25', 'Aucun commentaire trouvé', 'Label: Text as No Reviews Found'),
1573
+ ('fr_FR', 'label', 'Average_User_Rating', 'Average User Rating', '25', 'Note moyenne des utilisateurs', 'Label: Label for Average User Rating.'),
1574
+ ('fr_FR', 'label', 'Reviews', 'Reviews', '25', 'Avis', 'Label: Label for Reviews.'),
1575
+ ('fr_FR', 'label', 'Nickename', 'Nickename', '25', 'Nickename', 'Label: Label for Nickename field, available on submit review form.'),
1576
+ ('fr_FR', 'label', 'Summary_Of_Your_Review', 'Summary Of Your Review', '25', 'Résumé de votre commentaire', 'Label: Label for review summary field, available on submit review form.'),
1577
+ ('fr_FR', 'label', 'Comments', 'Comments', '25', 'commentaires', 'Label: Label for comments field, available on submit review form.'),
1578
+ ('fr_FR', 'label', 'You_May_Also_Like', 'You May Also Like', '25', 'Vous aimerez aussi', 'Label: Label for related product slider on product detail page.'),
1579
+ ('fr_FR', 'message', 'Please_Select_One_Of_Each_Of_The_Ratings', 'Please Select One Of Each Of The Ratings', '100', 'Sélectionnez l\'une de chacune des notes', 'Error: When feedback ratings is not selected for the product.'),
1580
+ ('fr_FR', 'message', 'Please_Enter_Nickename', 'Please Enter Nickename', '100', 'Entrez votre nickename', 'Error: When feedback nickename is empty.'),
1581
+ ('fr_FR', 'message', 'Please_Enter_Summary', 'Please Enter Summary', '100', 'Entrez vos commentaires globale', 'Error: When feedback summary is empty.'),
1582
+ ('fr_FR', 'message', 'Please_Enter_Comments', 'Please Enter Comments', '100', 'Entrez vos commentaires', 'Error: When feedback comments is empty.'),
1583
+ ('fr_FR', 'message', 'Plugin_Not_Supported', 'Plugin Not Supported', '100', 'Cette action ne peut être effectuée sur cet appareil. Soutien nécessaire ne est pas disponible sur cet appareil.', 'Error: When the device is not supported for requested action such as share functionality.'),
1584
+ ('fr_FR', 'label', 'Recently_Viewed', 'Recently Viewed', '25', 'récemment Vu', 'Label: Recently Viewed'),
1585
+ ('fr_FR', 'label', 'Share', 'Share', '7', 'part', 'Label:Share button title.'),
1586
+ ('fr_FR', 'label', 'Shopping_Products', 'Shopping Products', '20', 'Produits commerciaux', 'Label:Label for Shopping Products, available on left panel on product detail page.'),
1587
+ ('fr_FR', 'label', 'Edit', 'Edit', '6', 'éditer', 'Label:Edit button title, available on wishlist page. '),
1588
+ ('fr_FR', 'label', 'More_Information', 'More Information', '25', 'plus d\'informations', 'Label:More information about product'),
1589
+ ('fr_FR', 'label', 'Share_App', 'Share App', '12', 'Partager App', 'Label:Share app on CMS page'),
1590
+ ('fr_FR', 'label', 'Sample_Links', 'Sample Links', '20', 'Liens exemples', 'Label:Sample Links on product detail page'),
1591
+ ('fr_FR', 'label', 'Maximum_Number_Of_Characters', 'Maximum number of characters', '50', 'Le nombre maximum de caractères', 'Label:Maximum number of characters for configurable product'),
1592
+ ('fr_FR', 'message', 'Payment_Cancelled', 'Payment Cancelled', '50', 'paiement Annulé', 'Message:Payment cancelled when user cancel payment'),
1593
+ ('fr_FR', 'label', 'Tracking_Numbers', 'Tracking Numbers', '50', 'Numéros de suivi', 'Label:Tracking Numbers on order detail page'),
1594
+ ('fr_FR', 'label', 'Track', 'Track', '15', 'piste', 'Label:Button on order detail page'),
1595
+ ('fr_FR', 'label', 'Installment', 'Installment', '15', 'tranche', 'Label:On product detail page'),
1596
+ ('fr_FR', 'label', 'Installment_Amount', 'Installment Amount', '20', 'Montant tranche', 'Label:On product detail page'),
1597
+ ('fr_FR', 'label', 'Total_Amount', 'Total Amount', '15', 'Montant Total', 'Label:On product detail page'),
1598
+ ('fr_FR', 'label', 'Single_Shot', 'Single Shot', '15', 'single Shot', 'Label:For payuapi gateway on credit card page'),
1599
+ ('fr_FR', 'message', 'Please_select_installment_option', 'Please Select Installment Option', '100', 'Se il vous plaît Sélectionnez Option versement', 'Message:On credit card page where installment option is required'),
1600
+ ('fr_FR', 'label', 'January', 'January', '50', 'janvier', 'Label:Month name on credit card page'),
1601
+ ('fr_FR', 'label', 'February', 'February', '50', 'février', 'Label:Month name on credit card page'),
1602
+ ('fr_FR', 'label', 'March', 'March', '50', 'mars', 'Label:Month name on credit card page'),
1603
+ ('fr_FR', 'label', 'April', 'April', '50', 'avril', 'Label:Month name on credit card page'),
1604
+ ('fr_FR', 'label', 'May', 'May', '50', 'mai', 'Label:Month name on credit card page'),
1605
+ ('fr_FR', 'label', 'June', 'June', '50', 'juin', 'Label:Month name on credit card page'),
1606
+ ('fr_FR', 'label', 'July', 'July', '50', 'juillet', 'Label:Month name on credit card page'),
1607
+ ('fr_FR', 'label', 'August', 'August', '50', 'août', 'Label:Month name on credit card page'),
1608
+ ('fr_FR', 'label', 'September', 'September', '50', 'septembre', 'Label:Month name on credit card page'),
1609
+ ('fr_FR', 'label', 'October', 'October', '50', 'octobre', 'Label:Month name on credit card page'),
1610
+ ('fr_FR', 'label', 'November', 'November', '50', 'novembre', 'Label:Month name on credit card page'),
1611
+ ('fr_FR', 'label', 'December', 'December', '50', 'décembre', 'Label:Month name on credit card page'),
1612
+ ('nl_NL', 'message', 'Please_wait', 'Please wait', '100', 'Een ogenblik geduld', 'Error: When user trigger new action while previous one is still processsing.'),
1613
+ ('nl_NL', 'label', 'or', 'or', '25', 'of', 'Label: Display to show 2 action options.'),
1614
+ ('nl_NL', 'label', 'Home', 'Home', '8', 'huis', 'Label: Home page title and button title.'),
1615
+ ('nl_NL', 'message', 'No_internet_connection', 'No internet connection', '100', 'Geen internet verbinding', 'Message:No internet connection'),
1616
+ ('nl_NL', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Winkelen Categorie', 'Label: Shopping Category'),
1617
+ ('nl_NL', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', 'Oeps! Er zijn geen categorieën om weer te geven.', 'Text: When no category found.'),
1618
+ ('nl_NL', 'label', 'Shop_by_category', 'Shop by category', '25', 'Winkel op categorie', 'Label: Title to show above category names.'),
1619
+ ('nl_NL', 'label', 'Categories', 'Categories', '20', 'Categorieën', 'Label: Title to show on homepage, above the category.'),
1620
+ ('nl_NL', 'label', 'All_Products', 'All Products', '20', 'alle producten', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
1621
+ ('nl_NL', 'label', 'Profile', 'Profile', '10', 'profiel', 'Label: Profile page title and button title.'),
1622
+ ('nl_NL', 'label', 'List_Page', 'List Page', '15', 'lijst Pagina', 'Label: Page title'),
1623
+ ('nl_NL', 'label', 'Product_List', 'Product List', '15', 'product List', 'Label: Product List page title '),
1624
+ ('nl_NL', 'label', 'products_found', 'products found', '20', 'producten gevonden', 'Label: Label displayed on product listing page to show No. of products found. '),
1625
+ ('nl_NL', 'label', 'Product_Detail', 'Product Detail', '15', 'Detail van het product', 'Label: Product Detail page title'),
1626
+ ('nl_NL', 'label', 'Details', 'Details', '10', 'Details', 'Label: Label displayed above the product detail on product detail page.'),
1627
+ ('nl_NL', 'label', 'Buy_Now', 'Buy Now', '10', 'Koop nu', 'Label: Buy Now button title.'),
1628
+ ('nl_NL', 'label', 'Choose_an_option', 'Choose an option', '20', 'Kies een optie', 'Label: First option for product options.'),
1629
+ ('nl_NL', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'Item succesvol toegevoegd', 'Message: When the Item added successfully into the cart. '),
1630
+ ('nl_NL', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'Geen producten gevonden.', 'Text: When no products found for selected search criteria or category.'),
1631
+ ('nl_NL', 'label', 'Load_More', 'Load More', '10', 'Laad Meer', 'Label: Load More button title, displayed on product listing pages.'),
1632
+ ('nl_NL', 'label', 'Viewers', 'Viewers', '10', 'kijkers', 'Label: Viewers Label.'),
1633
+ ('nl_NL', 'label', 'Add_to_cart', 'Add to cart', '15', 'Bestellen', 'Label: Add to cart button title.'),
1634
+ ('nl_NL', 'label', 'Downloadable_link', 'Downloadable link', '20', 'downloadbare koppeling', 'Label: Downloadable link title. '),
1635
+ ('nl_NL', 'label', 'Review', 'Review', '10', 'recensie', 'Label: Review text and button title.'),
1636
+ ('nl_NL', 'message', 'No_reviews_found', 'No reviews found', '100', 'Geen reviews gevonden', 'Text: When no reviews found for selected product.'),
1637
+ ('nl_NL', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'Winkelwagen', 'Label: Shopping Cart button title.'),
1638
+ ('nl_NL', 'label', 'QTY', 'QTY', '5', 'QTY', 'Label: Label for product Quantity.'),
1639
+ ('nl_NL', 'label', 'TOTAL', 'TOTAL', '15', 'TOTAAL', 'Label: Label for cart &amp; order total. '),
1640
+ ('nl_NL', 'label', 'Subtotal', 'Subtotal', '15', 'Subtotaal', 'Label: Label for cart &amp; order subtotal.'),
1641
+ ('nl_NL', 'label', 'Tax', 'Tax', '5', 'belasting', 'Label: Label for cart &amp; order Tax.'),
1642
+ ('nl_NL', 'label', 'Discount', 'Discount', '15', 'korting', 'Label: Label for cart &amp; order discount. '),
1643
+ ('nl_NL', 'label', 'Grand_Total', 'Grand Total', '15', 'algemeen totaal', 'Label: Label for cart &amp; order grand total.'),
1644
+ ('nl_NL', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'Het winkelmandje is leeg.', 'Error: When the shopping cart is empty.'),
1645
+ ('nl_NL', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Kar succesvol bijgewerkt', 'Message: When the cart updated successfully.'),
1646
+ ('nl_NL', 'label', 'Update_Cart', 'Update Cart', '15', 'Winkelwagen bijwerken', 'Label: Update Cart button title. '),
1647
+ ('nl_NL', 'label', 'Checkout', 'Checkout', '10', 'uitchecken', 'Label: Checkout button title.'),
1648
+ ('nl_NL', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'Winkelwagen is leeg', 'Text: When the cart is empty. '),
1649
+ ('nl_NL', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'Een van uw winkelwagen item is die probleem', 'Text: When one of the cart item is having error such as not available or so.'),
1650
+ ('nl_NL', 'label', 'Login', 'Login', '7', 'login', 'Label: Login button title.'),
1651
+ ('nl_NL', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'Voer uw gebruikersnaam wachtwoord in om toegang te krijgen.', 'Error: When requested action required login.'),
1652
+ ('nl_NL', 'label', 'Username', 'Username', '20', 'gebruikersnaam', 'Label: Label for Username field.'),
1653
+ ('nl_NL', 'label', 'Password', 'Password', '20', 'wachtwoord', 'Label: Label for password field.'),
1654
+ ('nl_NL', 'label', 'Sign_Up', 'Sign Up', '10', 'Aanmelden', 'Label: Sign Up button title.'),
1655
+ ('nl_NL', 'message', 'Enter_username', 'Enter username', '100', 'Voer gebruikersnaam', 'Error: When username is empty.'),
1656
+ ('nl_NL', 'message', 'Enter_password', 'Enter password', '100', 'Voer het wachtwoord', 'Error: When password is empty. '),
1657
+ ('nl_NL', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Ongeldige gebruikersnaam of wachtwoord', 'Error: When Invalid username or password entered.'),
1658
+ ('nl_NL', 'label', 'First_name', 'First name', '20', 'voornaam', 'Label: Label for firstname field.'),
1659
+ ('nl_NL', 'label', 'Last_name', 'Last name', '20', 'achternaam', 'Label: Label for lastname field.'),
1660
+ ('nl_NL', 'label', 'Your_Email', 'Your Email', '20', 'uw e-mail', 'Label: Label for email address field.'),
1661
+ ('nl_NL', 'label', 'Submit', 'Submit', '10', 'voorleggen', 'Label: Submit button title.'),
1662
+ ('nl_NL', 'label', 'Signup_Form', 'Signup Form', '15', 'Inschrijving', 'Label: Signup Form page title.'),
1663
+ ('nl_NL', 'label', 'Signup', 'Signup', '10', 'Inschrijven', 'Label: Signup button title.'),
1664
+ ('nl_NL', 'message', 'Enter_firstname', 'Enter firstname', '100', 'Voer voornaam', 'Error: When firstname is empty. '),
1665
+ ('nl_NL', 'message', 'Enter_lastname', 'Enter lastname', '100', 'Voer achternaam', 'Error: When lastname is empty.'),
1666
+ ('nl_NL', 'message', 'Enter_email', 'Enter email', '100', 'Voer het e-mailadres', 'Error: When email address is empty.'),
1667
+ ('nl_NL', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Vul een geldig email adres', 'Error: When email address is invalid.'),
1668
+ ('nl_NL', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', 'Felicitatie! U bent succesvol geregistreerd', 'Message: When successfully registration has been done. '),
1669
+ ('nl_NL', 'message', 'Please_check_your_email', 'Please check your email', '100', 'Controleer uw e-mail', 'Message: When user reset their password. '),
1670
+ ('nl_NL', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Wachtwoord vergeten', 'Label: Forgot Password button title.'),
1671
+ ('nl_NL', 'label', 'Shipping', 'Shipping', '20', 'scheepvaart', 'Label: Label for Shipping. '),
1672
+ ('nl_NL', 'label', 'Billing', 'Billing', '20', 'Billing', 'Label: Label for Billing'),
1673
+ ('nl_NL', 'label', 'Address', 'Address', '20', 'adres', 'Label: Label for address field, available on payment page. '),
1674
+ ('nl_NL', 'label', 'Payment', 'Payment', '20', 'betaling', 'Label: Label for payment field, available on payment page.'),
1675
+ ('nl_NL', 'label', 'Continue', 'Continue', '20', 'voortzetten', 'Label: Continue button title. '),
1676
+ ('nl_NL', 'label', 'Billing_Address', 'Billing Address', '20', 'factuuradres', 'Label: Label for Billing Address.'),
1677
+ ('nl_NL', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Selecteer een factuuradres uit uw adresboek of voer een nieuw adres.', 'Label: Title available on billing addresses drop down.'),
1678
+ ('nl_NL', 'label', 'New_Address', 'New Address', '20', 'nieuw Adres', 'Label: Title for New Billing Address form.'),
1679
+ ('nl_NL', 'label', 'Company', 'Company', '20', 'vennootschap', 'Label: Label for company field, available on address page. '),
1680
+ ('nl_NL', 'label', 'City', 'City', '20', 'City', 'Label: Label for city field, available on address page. '),
1681
+ ('nl_NL', 'label', 'State', 'State', '20', 'staat', 'Label: Label for state field, available on address page. '),
1682
+ ('nl_NL', 'label', 'Country', 'Country', '20', 'land', 'Label: Label for country field, available on address page. '),
1683
+ ('nl_NL', 'label', 'select', 'select', '20', 'kiezen', 'Label: Label for drop downs. '),
1684
+ ('nl_NL', 'label', 'Billing_street', 'Billing street', '20', 'Billing straat', 'Label: Label for billing street field, available on address page. '),
1685
+ ('nl_NL', 'label', 'Postcode', 'Postcode', '20', 'postcode', 'Label: Label for postcode field, available on address page. '),
1686
+ ('nl_NL', 'label', 'Telephone', 'Telephone', '20', 'telefoon', 'Label: Label for telephone field, available on address page. '),
1687
+ ('nl_NL', 'label', 'Same_as_billing', 'Same as billing', '25', 'Dezelfde facturering', 'Label: Label for Same as billing option. '),
1688
+ ('nl_NL', 'label', 'Shipping_Address', 'Shipping Address', '25', 'Verzenden Adres', 'Label: Title for Shipping Address form.'),
1689
+ ('nl_NL', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Selecteer een verzendadres uit uw adresboek of voer een nieuw adres.', 'Label: Title available on shipping addresses drop down.'),
1690
+ ('nl_NL', 'label', 'Shipping_street', 'Shipping street', '25', 'verzending straat', 'Label: Label for shipping street field, available on address page. '),
1691
+ ('nl_NL', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Voer facturering voornaam', 'Error: When billing firstname is empty.'),
1692
+ ('nl_NL', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Voer facturering achternaam', 'Error: When billing lastname is empty.'),
1693
+ ('nl_NL', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Voer facturering stad', 'Error: When billing city is empty.'),
1694
+ ('nl_NL', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Voer facturering staat', 'Error: When billing state is empty.'),
1695
+ ('nl_NL', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Voer land facturering', 'Error: When billing country is empty.'),
1696
+ ('nl_NL', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Voer facturering straat', 'Error: When billing street is empty.'),
1697
+ ('nl_NL', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Voer facturering postcode', 'Error: When billing postcode is empty.'),
1698
+ ('nl_NL', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Voer billing telefoon', 'Error: When billing telephone is empty.'),
1699
+ ('nl_NL', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'Voer scheepvaart voornaam', 'Error: When shipping firstname is empty.'),
1700
+ ('nl_NL', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Voer scheepvaart achternaam', 'Error: When shipping lastname is empty.'),
1701
+ ('nl_NL', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Voer scheepvaart stad', 'Error: When shipping city is empty.'),
1702
+ ('nl_NL', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Voer de scheepvaart staat', 'Error: When shipping state is empty.'),
1703
+ ('nl_NL', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Voer Land van levering', 'Error: When shipping country is empty.'),
1704
+ ('nl_NL', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Voer de scheepvaart op straat', 'Error: When shipping street is empty.'),
1705
+ ('nl_NL', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Voer scheepvaart postcode', 'Error: When shipping postcode is empty.'),
1706
+ ('nl_NL', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Voer scheepvaart telefoon', 'Error: When shipping telephone is empty.'),
1707
+ ('nl_NL', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Het verschepen Methode', 'Label: Shipping Method page title. '),
1708
+ ('nl_NL', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Selecteer verzendmethode', 'Label: Label for Select shipping method options.'),
1709
+ ('nl_NL', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Selecteer wijze van verzending', 'Error: When shipment method is not selected.'),
1710
+ ('nl_NL', 'label', 'Payment_Method', 'Payment Method', '25', 'Methode van de betaling', 'Label: Payment Method page title. '),
1711
+ ('nl_NL', 'label', 'Select_payment_method', 'Select payment method', '25', 'Kies een betaalmethode', 'Label: Label for Select payment method options.'),
1712
+ ('nl_NL', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Kies een betaalmethode', 'Error: When payment method is not selected.'),
1713
+ ('nl_NL', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Oops, er iets mis gebeurd', 'Error: When magento return unexpected error.'),
1714
+ ('nl_NL', 'label', 'Credit_Card', 'Credit Card', '25', 'creditkaart', 'Label: Label for credit card field, available on payment page. '),
1715
+ ('nl_NL', 'label', 'Name_on_card', 'Name on card', '25', 'Naam op kaart', 'Label: Label for name of card field, available on payment page. '),
1716
+ ('nl_NL', 'label', 'Credit_card_type', 'Credit card type', '25', 'Creditcardtype', 'Label: Label for CC type field, available on payment page. '),
1717
+ ('nl_NL', 'label', 'Credit_card_number', 'Credit card number', '25', 'Credit card nummer', 'Label: Label for CC number field, available on payment page. '),
1718
+ ('nl_NL', 'label', 'Expiration_Date', 'Expiration Date', '25', 'uiterste houdbaarheidsdatum', 'Label: Label for CC expiry date field, available on payment page. '),
1719
+ ('nl_NL', 'label', 'Month', 'Month', '25', 'maand', 'Label: Label for CC expiry month field, available on payment page. '),
1720
+ ('nl_NL', 'label', 'Year', 'Year', '25', 'jaar', 'Label: Label for CC expiry year field, available on payment page. '),
1721
+ ('nl_NL', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Card Verification Number', 'Label: Label for CC verification number field, available on payment page. '),
1722
+ ('nl_NL', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Voer de naam op kaart', 'Error: When name on card is empty.'),
1723
+ ('nl_NL', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Kies het type creditcard', 'Error: When credit card type is not selected.'),
1724
+ ('nl_NL', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Voer creditcardnummer', 'Error: When credit card number is empty.'),
1725
+ ('nl_NL', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Stel vervalmaand', 'Error: When expiry month is empty.'),
1726
+ ('nl_NL', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Stel afloop jaar', 'Error: When expiry year is empty.'),
1727
+ ('nl_NL', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Stel kaartverificatienummer', 'Error: When card verification number is empty.'),
1728
+ ('nl_NL', 'label', 'Order_Review', 'Order Review', '15', 'Bestel beoordeling', 'Label: Order Review page title. '),
1729
+ ('nl_NL', 'label', 'Agreements', 'Agreements', '25', 'overeenkomsten', 'Label: Label for Agreements, available on oprder review screen.'),
1730
+ ('nl_NL', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Accepteer bepalingen en voorwaarden', 'Error: When user did not agreed on sign up terms.'),
1731
+ ('nl_NL', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Het verschepen &amp; Behandeling', 'Label: Label for Shipping &amp; Handling.'),
1732
+ ('nl_NL', 'label', 'Place_Order', 'Place Order', '25', 'plaats uw bestelling', 'Label: Place Order button title.'),
1733
+ ('nl_NL', 'label', 'Order_Success', 'Order Success', '15', 'Bestel Succes', 'Label: Order Success page title. '),
1734
+ ('nl_NL', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Dank u voor uw aankoop!', 'Message: When order successfully placed. '),
1735
+ ('nl_NL', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'U ontvangt een bestelling e-mail bevestiging met de details van uw bestelling en een link op te sporen zijn vooruitgang.', 'Text: When order successfully placed '),
1736
+ ('nl_NL', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'Verder winkelen', 'LabeL: Continue Shopping button title. '),
1737
+ ('nl_NL', 'label', 'Error', 'Error', '15', 'fout', 'Label: Error '),
1738
+ ('nl_NL', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'Het object is toegevoegd aan wishlist', 'Message: When item added into Wishlist.'),
1739
+ ('nl_NL', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Voorwerp verwijderd uit het verlanglijstje', 'Message: When Item removed from wishlist.'),
1740
+ ('nl_NL', 'label', 'Wishlist', 'Wishlist', '15', 'verlanglijstje', 'Label: Wishlist page title. '),
1741
+ ('nl_NL', 'label', 'Remove', 'Remove', '10', 'verwijderen', 'Label: Remove button title.'),
1742
+ ('nl_NL', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'Geen verlanglijstje gevonden', 'Text: When No wishlist items found.'),
1743
+ ('nl_NL', 'label', 'Orders', 'Orders', '15', 'bestellingen', 'Label: Orders history page title.'),
1744
+ ('nl_NL', 'label', 'Order_History', 'Order History', '20', 'Bestel Geschiedenis', 'Label: Order History button title. '),
1745
+ ('nl_NL', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'Geen bestellingen gevonden', 'Text: When no order history found. '),
1746
+ ('nl_NL', 'label', 'Order_Detail', 'Order Detail', '15', 'Bestel Detail', 'Label: Order Detail page title. '),
1747
+ ('nl_NL', 'label', 'Ordered_Items', 'Ordered Items', '25', 'bestelde items', 'Label: Ordered Items block heading or title. '),
1748
+ ('nl_NL', 'label', 'Order_Number', 'Order Number', '20', 'Ordernummer', 'Label: Label for Order Number.'),
1749
+ ('nl_NL', 'label', 'Order_Date', 'Order Date', '20', 'Bestel Date', 'Label: Label for Order Date.'),
1750
+ ('nl_NL', 'label', 'User', 'User', '10', 'gebruiker', 'Label: Label for User.'),
1751
+ ('nl_NL', 'label', 'Info', 'Info', '15', 'over', 'Label: About page title (CMS/about module)'),
1752
+ ('nl_NL', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'Zet op verlanglijst', 'Label: Add To Wishlist button title.'),
1753
+ ('nl_NL', 'label', 'Logout', 'Logout', '10', 'Afmelden', 'Label: Logout button title.'),
1754
+ ('nl_NL', 'label', 'Search_Product', 'Search Product', '50', 'zoeken naar producten', 'Label: Search Product.'),
1755
+ ('nl_NL', 'label', 'Apply', 'Apply', '8', 'van toepassing zijn', 'Label: Apply button title (to apply discount)'),
1756
+ ('nl_NL', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Coupon code met succes toegepast', 'Message: When coupon code is applied.'),
1757
+ ('nl_NL', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Coupon code succesvol verwijderd', 'Message: When coupon code is removed. '),
1758
+ ('nl_NL', 'label', 'Discount_Code', 'Discount Code', '25', 'Kortingscode', 'Label: Label for Discount Code.'),
1759
+ ('nl_NL', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'bijwerken verlanglijst', 'Label: Update Wishlist button title.'),
1760
+ ('nl_NL', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'Item succesvol bijgewerkt', 'Message: When wishlist updated successfully.'),
1761
+ ('nl_NL', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Cant Load verlanglijst Item', 'Error: When requested wishlist item Can not Load. '),
1762
+ ('nl_NL', 'message', 'Please_Select', 'Please select ', '25', 'selecteer aub', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
1763
+ ('nl_NL', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'Product Downloadbare Links', 'Label: Label for Product Downloadable Links.'),
1764
+ ('nl_NL', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Ongeldige couponcode', 'Error: When coupon code is invalid.'),
1765
+ ('nl_NL', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Gelieve in te loggen om verder te gaan', 'Error: When action required login '),
1766
+ ('nl_NL', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'Voer voornaam', 'Error: When firstname is empty in signup form. '),
1767
+ ('nl_NL', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'Voer achternaam', 'Error: When lastname is empty in signup form. '),
1768
+ ('nl_NL', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'Voer het e-mailadres', 'Error: When email address is empty in signup form. '),
1769
+ ('nl_NL', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'Voer het wachtwoord', 'Error: When password is empty in signup form. '),
1770
+ ('nl_NL', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Account bestaat al', 'Error: When email address already exists.'),
1771
+ ('nl_NL', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'Kan niet opslaan adres van de klant', 'Error: When error occure while saving customer Address.'),
1772
+ ('nl_NL', 'message', 'No_Data_Found', 'No Data Found', '100', 'Geen gegevens gevonden', 'Error: When no data found for requested page.'),
1773
+ ('nl_NL', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Product niet meer leverbaar', 'Error: When requested product is no londer available.'),
1774
+ ('nl_NL', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'Gevraagde item niet gevonden', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1775
+ ('nl_NL', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'Gevraagde item niet gevonden', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1776
+ ('nl_NL', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Oeps! Item kan niet laden', 'Error: When wishlist can\'t load because of unexpected error.'),
1777
+ ('nl_NL', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'Gevraagde item niet gevonden', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1778
+ ('nl_NL', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'Gevraagde item niet gevonden', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1779
+ ('nl_NL', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'Gevraagde item niet gevonden', 'Error: When system can not load wishlist Item.'),
1780
+ ('nl_NL', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Gevraagde item niet meer beschikbaar', 'Error: When requested product is no longer available.'),
1781
+ ('nl_NL', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'Item is verwijderd uit het mandje', 'Error: When Item has been deleted from cart.'),
1782
+ ('nl_NL', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'Niet alle producten zijn beschikbaar in de gevraagde auantity', 'Error: When any of the product from cart is no longer available.'),
1783
+ ('nl_NL', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'Accepteer alle bepalingen en voorwaarden voor het plaatsen van de bestelling', 'Error: When user did not agree on all required addreement while placing order.'),
1784
+ ('nl_NL', 'label', 'Filter', 'Filter', '10', 'filter', 'Label: Label for Filters.'),
1785
+ ('nl_NL', 'label', 'Reset_Filter', 'Reset Filter', '15', 'Start een nieuwe zoekactie', 'Label: Reset Filter link title.'),
1786
+ ('nl_NL', 'label', 'Reset', 'Reset', '10', 'Reset', 'Label: Reset button title.'),
1787
+ ('nl_NL', 'label', 'Popularity', 'Popularity', '25', 'populariteit', 'Label: Label for filter: Popularity option. '),
1788
+ ('nl_NL', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', 'Prijs-hoog naar laag', 'Label: Label for filter: Price-High To Low option. '),
1789
+ ('nl_NL', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', 'Prijs-Laag naar Hoog', 'Label: Label for filter: Price-Low To High option.'),
1790
+ ('nl_NL', 'label', 'Rating', 'Rating', '25', 'Waardering', 'Label: Label for filter: Rating option '),
1791
+ ('nl_NL', 'label', 'Name-A_To_Z', 'Name-A To Z', '25', 'Naam-A To Z', 'Label: Label for filter: Name-A To Z option.'),
1792
+ ('nl_NL', 'label', 'Name-Z_To_A', 'Name-Z To A', '25', 'Naam-Z tot A', 'Label: Label for filter: Name-Z To A option.'),
1793
+ ('nl_NL', 'label', 'Newest', 'Newest', '25', 'Nieuwste', 'Label: Label for filter: Newest option.'),
1794
+ ('nl_NL', 'label', 'Submit_Review', 'Submit Review', '25', 'review versturen', 'Label: Submit Review button title.'),
1795
+ ('nl_NL', 'label', 'User_Reviews', 'User Reviews', '25', 'Gebruikers beoordelingen', 'Label: User Reviews page title. '),
1796
+ ('nl_NL', 'label', 'No_Reviews_Found', 'No Reviews Found', '25', 'Geen reviews gevonden', 'Label: Text as No Reviews Found'),
1797
+ ('nl_NL', 'label', 'Average_User_Rating', 'Average User Rating', '25', 'Gemiddeld Gebruikers score', 'Label: Label for Average User Rating.'),
1798
+ ('nl_NL', 'label', 'Reviews', 'Reviews', '25', 'beoordelingen', 'Label: Label for Reviews.'),
1799
+ ('nl_NL', 'label', 'Nickename', 'Nickename', '25', 'Nickename', 'Label: Label for Nickename field, available on submit review form.'),
1800
+ ('nl_NL', 'label', 'Summary_Of_Your_Review', 'Summary Of Your Review', '25', 'Samenvatting van uw review', 'Label: Label for review summary field, available on submit review form.'),
1801
+ ('nl_NL', 'label', 'Comments', 'Comments', '25', 'reacties', 'Label: Label for comments field, available on submit review form.'),
1802
+ ('nl_NL', 'label', 'You_May_Also_Like', 'You May Also Like', '25', 'Misschien wilt u ook', 'Label: Label for related product slider on product detail page.'),
1803
+ ('nl_NL', 'message', 'Please_Select_One_Of_Each_Of_The_Ratings', 'Please Select One Of Each Of The Ratings', '100', 'Selecteer één van elk van de beoordelingen', 'Error: When feedback ratings is not selected for the product.'),
1804
+ ('nl_NL', 'message', 'Please_Enter_Nickename', 'Please Enter Nickename', '100', 'Voer uw nickename', 'Error: When feedback nickename is empty.'),
1805
+ ('nl_NL', 'message', 'Please_Enter_Summary', 'Please Enter Summary', '100', 'Voer algemene feedback', 'Error: When feedback summary is empty.'),
1806
+ ('nl_NL', 'message', 'Please_Enter_Comments', 'Please Enter Comments', '100', 'Geef hier uw commentaar', 'Error: When feedback comments is empty.'),
1807
+ ('nl_NL', 'message', 'Plugin_Not_Supported', 'Plugin Not Supported', '100', 'Deze actie kan niet worden uitgevoerd op dit apparaat. Vereiste ondersteuning is niet beschikbaar op dit apparaat.', 'Error: When the device is not supported for requested action such as share functionality.'),
1808
+ ('nl_NL', 'label', 'Recently_Viewed', 'Recently Viewed', '25', 'Recent bekeken', 'Label: Recently Viewed'),
1809
+ ('nl_NL', 'label', 'Share', 'Share', '7', 'aandeel', 'Label:Share button title.'),
1810
+ ('nl_NL', 'label', 'Shopping_Products', 'Shopping Products', '20', 'Winkelen producten', 'Label:Label for Shopping Products, available on left panel on product detail page.'),
1811
+ ('nl_NL', 'label', 'Edit', 'Edit', '6', 'uitgeven', 'Label:Edit button title, available on wishlist page. '),
1812
+ ('nl_NL', 'label', 'More_Information', 'More Information', '25', 'meer informatie', 'Label:More information about product'),
1813
+ ('nl_NL', 'label', 'Share_App', 'Share App', '12', 'Share App', 'Label:Share app on CMS page'),
1814
+ ('nl_NL', 'label', 'Sample_Links', 'Sample Links', '20', 'monster Links', 'Label:Sample Links on product detail page'),
1815
+ ('nl_NL', 'label', 'Maximum_Number_Of_Characters', 'Maximum number of characters', '50', 'Maximum aantal tekens', 'Label:Maximum number of characters for configurable product'),
1816
+ ('nl_NL', 'message', 'Payment_Cancelled', 'Payment Cancelled', '50', 'betaling geannuleerd', 'Message:Payment cancelled when user cancel payment'),
1817
+ ('nl_NL', 'label', 'Tracking_Numbers', 'Tracking Numbers', '50', 'trackingnummers', 'Label:Tracking Numbers on order detail page'),
1818
+ ('nl_NL', 'label', 'Track', 'Track', '15', 'spoor', 'Label:Button on order detail page'),
1819
+ ('nl_NL', 'label', 'Installment', 'Installment', '15', 'aflevering', 'Label:On product detail page'),
1820
+ ('nl_NL', 'label', 'Installment_Amount', 'Installment Amount', '20', 'termijnbedrag', 'Label:On product detail page'),
1821
+ ('nl_NL', 'label', 'Total_Amount', 'Total Amount', '15', 'totaal bedrag', 'Label:On product detail page'),
1822
+ ('nl_NL', 'label', 'Single_Shot', 'Single Shot', '15', 'Single Shot', 'Label:For payuapi gateway on credit card page'),
1823
+ ('nl_NL', 'message', 'Please_select_installment_option', 'Please Select Installment Option', '100', 'Selecteer Voorschot Option', 'Message:On credit card page where installment option is required'),
1824
+ ('nl_NL', 'label', 'January', 'January', '50', 'januari', 'Label:Month name on credit card page'),
1825
+ ('nl_NL', 'label', 'February', 'February', '50', 'februari', 'Label:Month name on credit card page'),
1826
+ ('nl_NL', 'label', 'March', 'March', '50', 'maart', 'Label:Month name on credit card page'),
1827
+ ('nl_NL', 'label', 'April', 'April', '50', 'april', 'Label:Month name on credit card page'),
1828
+ ('nl_NL', 'label', 'May', 'May', '50', 'mei', 'Label:Month name on credit card page'),
1829
+ ('nl_NL', 'label', 'June', 'June', '50', 'juni', 'Label:Month name on credit card page'),
1830
+ ('nl_NL', 'label', 'July', 'July', '50', 'juli', 'Label:Month name on credit card page'),
1831
+ ('nl_NL', 'label', 'August', 'August', '50', 'augustus', 'Label:Month name on credit card page'),
1832
+ ('nl_NL', 'label', 'September', 'September', '50', 'september', 'Label:Month name on credit card page'),
1833
+ ('nl_NL', 'label', 'October', 'October', '50', 'oktober', 'Label:Month name on credit card page'),
1834
+ ('nl_NL', 'label', 'November', 'November', '50', 'november', 'Label:Month name on credit card page'),
1835
+ ('nl_NL', 'label', 'December', 'December', '50', 'december', 'Label:Month name on credit card page'),
1836
+ ('it_IT', 'message', 'Please_wait', 'Please wait', '100', 'attendere prego', 'Error: When user trigger new action while previous one is still processsing.'),
1837
+ ('it_IT', 'label', 'or', 'or', '25', 'o', 'Label: Display to show 2 action options.'),
1838
+ ('it_IT', 'label', 'Home', 'Home', '8', 'casa', 'Label: Home page title and button title.'),
1839
+ ('it_IT', 'message', 'No_internet_connection', 'No internet connection', '100', 'Nessuna connessione internet', 'Message:No internet connection'),
1840
+ ('it_IT', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Shopping Categoria', 'Label: Shopping Category'),
1841
+ ('it_IT', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', 'Oops! Non ci sono categorie da visualizzare.', 'Text: When no category found.'),
1842
+ ('it_IT', 'label', 'Shop_by_category', 'Shop by category', '25', 'Negozio per categoria', 'Label: Title to show above category names.'),
1843
+ ('it_IT', 'label', 'Categories', 'Categories', '20', 'Categorie', 'Label: Title to show on homepage, above the category.'),
1844
+ ('it_IT', 'label', 'All_Products', 'All Products', '20', 'Tutti i prodotti', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
1845
+ ('it_IT', 'label', 'Profile', 'Profile', '10', 'profilo', 'Label: Profile page title and button title.'),
1846
+ ('it_IT', 'label', 'List_Page', 'List Page', '15', 'Lista Pagina', 'Label: Page title'),
1847
+ ('it_IT', 'label', 'Product_List', 'Product List', '15', 'Elenco prodotti', 'Label: Product List page title '),
1848
+ ('it_IT', 'label', 'products_found', 'products found', '20', 'prodotti trovati', 'Label: Label displayed on product listing page to show No. of products found. '),
1849
+ ('it_IT', 'label', 'Product_Detail', 'Product Detail', '15', 'Dettagli del prodotto', 'Label: Product Detail page title'),
1850
+ ('it_IT', 'label', 'Details', 'Details', '10', 'Dettagli', 'Label: Label displayed above the product detail on product detail page.'),
1851
+ ('it_IT', 'label', 'Buy_Now', 'Buy Now', '10', 'acquista ora', 'Label: Buy Now button title.'),
1852
+ ('it_IT', 'label', 'Choose_an_option', 'Choose an option', '20', 'Scegli un\'opzione', 'Label: First option for product options.'),
1853
+ ('it_IT', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'Prodotto aggiunto correttamente', 'Message: When the Item added successfully into the cart. '),
1854
+ ('it_IT', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'Nessun prodotto trovato.', 'Text: When no products found for selected search criteria or category.'),
1855
+ ('it_IT', 'label', 'Load_More', 'Load More', '10', 'Carica Altro', 'Label: Load More button title, displayed on product listing pages.'),
1856
+ ('it_IT', 'label', 'Viewers', 'Viewers', '10', 'Gli spettatori', 'Label: Viewers Label.'),
1857
+ ('it_IT', 'label', 'Add_to_cart', 'Add to cart', '15', 'Aggiungi al carrello', 'Label: Add to cart button title.'),
1858
+ ('it_IT', 'label', 'Downloadable_link', 'Downloadable link', '20', 'Link per il download', 'Label: Downloadable link title. '),
1859
+ ('it_IT', 'label', 'Review', 'Review', '10', 'recensione', 'Label: Review text and button title.'),
1860
+ ('it_IT', 'message', 'No_reviews_found', 'No reviews found', '100', 'Nessun commento trovato', 'Text: When no reviews found for selected product.'),
1861
+ ('it_IT', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'carrello della spesa', 'Label: Shopping Cart button title.'),
1862
+ ('it_IT', 'label', 'QTY', 'QTY', '5', 'QTY', 'Label: Label for product Quantity.'),
1863
+ ('it_IT', 'label', 'TOTAL', 'TOTAL', '15', 'TOTALE', 'Label: Label for cart &amp; order total. '),
1864
+ ('it_IT', 'label', 'Subtotal', 'Subtotal', '15', 'Totale parziale', 'Label: Label for cart &amp; order subtotal.'),
1865
+ ('it_IT', 'label', 'Tax', 'Tax', '5', 'tasse', 'Label: Label for cart &amp; order Tax.'),
1866
+ ('it_IT', 'label', 'Discount', 'Discount', '15', 'sconto', 'Label: Label for cart &amp; order discount. '),
1867
+ ('it_IT', 'label', 'Grand_Total', 'Grand Total', '15', 'somma totale', 'Label: Label for cart &amp; order grand total.'),
1868
+ ('it_IT', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'Il carrello della spesa è vuoto.', 'Error: When the shopping cart is empty.'),
1869
+ ('it_IT', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Carrello aggiornato correttamente', 'Message: When the cart updated successfully.'),
1870
+ ('it_IT', 'label', 'Update_Cart', 'Update Cart', '15', 'Aggiornamento carrello', 'Label: Update Cart button title. '),
1871
+ ('it_IT', 'label', 'Checkout', 'Checkout', '10', 'cassa', 'Label: Checkout button title.'),
1872
+ ('it_IT', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'Il carrello è vuoto', 'Text: When the cart is empty. '),
1873
+ ('it_IT', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'Uno del vostro articolo carrello è avendo problema', 'Text: When one of the cart item is having error such as not available or so.'),
1874
+ ('it_IT', 'label', 'Login', 'Login', '7', 'accesso', 'Label: Login button title.'),
1875
+ ('it_IT', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'Immettere la password utente per accedere.', 'Error: When requested action required login.'),
1876
+ ('it_IT', 'label', 'Username', 'Username', '20', 'nome utente', 'Label: Label for Username field.'),
1877
+ ('it_IT', 'label', 'Password', 'Password', '20', 'password', 'Label: Label for password field.'),
1878
+ ('it_IT', 'label', 'Sign_Up', 'Sign Up', '10', 'Iscriviti', 'Label: Sign Up button title.'),
1879
+ ('it_IT', 'message', 'Enter_username', 'Enter username', '100', 'Inserisci username', 'Error: When username is empty.'),
1880
+ ('it_IT', 'message', 'Enter_password', 'Enter password', '100', 'Inserire la password', 'Error: When password is empty. '),
1881
+ ('it_IT', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Nome utente o password non validi', 'Error: When Invalid username or password entered.'),
1882
+ ('it_IT', 'label', 'First_name', 'First name', '20', 'nome', 'Label: Label for firstname field.'),
1883
+ ('it_IT', 'label', 'Last_name', 'Last name', '20', 'cognome', 'Label: Label for lastname field.'),
1884
+ ('it_IT', 'label', 'Your_Email', 'Your Email', '20', 'La tua e-mail', 'Label: Label for email address field.'),
1885
+ ('it_IT', 'label', 'Submit', 'Submit', '10', 'presentare', 'Label: Submit button title.'),
1886
+ ('it_IT', 'label', 'Signup_Form', 'Signup Form', '15', 'Modulo di iscrizione', 'Label: Signup Form page title.'),
1887
+ ('it_IT', 'label', 'Signup', 'Signup', '10', 'Iscriviti', 'Label: Signup button title.'),
1888
+ ('it_IT', 'message', 'Enter_firstname', 'Enter firstname', '100', 'Inserisci firstname', 'Error: When firstname is empty. '),
1889
+ ('it_IT', 'message', 'Enter_lastname', 'Enter lastname', '100', 'Inserisci cognome', 'Error: When lastname is empty.'),
1890
+ ('it_IT', 'message', 'Enter_email', 'Enter email', '100', 'Inserire l\'indirizzo e-mail', 'Error: When email address is empty.'),
1891
+ ('it_IT', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Inserisci indirizzo email valido', 'Error: When email address is invalid.'),
1892
+ ('it_IT', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', 'Congratulazioni! Siete registrati correttamente', 'Message: When successfully registration has been done. '),
1893
+ ('it_IT', 'message', 'Please_check_your_email', 'Please check your email', '100', 'Controlla la tua email', 'Message: When user reset their password. '),
1894
+ ('it_IT', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Password dimenticata', 'Label: Forgot Password button title.'),
1895
+ ('it_IT', 'label', 'Shipping', 'Shipping', '20', 'spedizione', 'Label: Label for Shipping. '),
1896
+ ('it_IT', 'label', 'Billing', 'Billing', '20', 'fatturazione', 'Label: Label for Billing'),
1897
+ ('it_IT', 'label', 'Address', 'Address', '20', 'indirizzo', 'Label: Label for address field, available on payment page. '),
1898
+ ('it_IT', 'label', 'Payment', 'Payment', '20', 'pagamento', 'Label: Label for payment field, available on payment page.'),
1899
+ ('it_IT', 'label', 'Continue', 'Continue', '20', 'continuare', 'Label: Continue button title. '),
1900
+ ('it_IT', 'label', 'Billing_Address', 'Billing Address', '20', 'Indirizzo di fatturazione', 'Label: Label for Billing Address.'),
1901
+ ('it_IT', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Selezionare un indirizzo di fatturazione dalla rubrica o inserire un nuovo indirizzo.', 'Label: Title available on billing addresses drop down.'),
1902
+ ('it_IT', 'label', 'New_Address', 'New Address', '20', 'Nuovo indirizzo', 'Label: Title for New Billing Address form.'),
1903
+ ('it_IT', 'label', 'Company', 'Company', '20', 'azienda', 'Label: Label for company field, available on address page. '),
1904
+ ('it_IT', 'label', 'City', 'City', '20', 'città', 'Label: Label for city field, available on address page. '),
1905
+ ('it_IT', 'label', 'State', 'State', '20', 'stato', 'Label: Label for state field, available on address page. '),
1906
+ ('it_IT', 'label', 'Country', 'Country', '20', 'paese', 'Label: Label for country field, available on address page. '),
1907
+ ('it_IT', 'label', 'select', 'select', '20', 'selezionare', 'Label: Label for drop downs. '),
1908
+ ('it_IT', 'label', 'Billing_street', 'Billing street', '20', 'strada di fatturazione', 'Label: Label for billing street field, available on address page. '),
1909
+ ('it_IT', 'label', 'Postcode', 'Postcode', '20', 'codice postale', 'Label: Label for postcode field, available on address page. '),
1910
+ ('it_IT', 'label', 'Telephone', 'Telephone', '20', 'telefono', 'Label: Label for telephone field, available on address page. '),
1911
+ ('it_IT', 'label', 'Same_as_billing', 'Same as billing', '25', 'Uguale fatturazione', 'Label: Label for Same as billing option. '),
1912
+ ('it_IT', 'label', 'Shipping_Address', 'Shipping Address', '25', 'Indirizzo di spedizione', 'Label: Title for Shipping Address form.'),
1913
+ ('it_IT', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Selezionare un indirizzo di spedizione dalla rubrica o inserire un nuovo indirizzo.', 'Label: Title available on shipping addresses drop down.'),
1914
+ ('it_IT', 'label', 'Shipping_street', 'Shipping street', '25', 'strada spedizione', 'Label: Label for shipping street field, available on address page. '),
1915
+ ('it_IT', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Inserisci fatturazione cognome', 'Error: When billing firstname is empty.'),
1916
+ ('it_IT', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Inserisci fatturazione cognome', 'Error: When billing lastname is empty.'),
1917
+ ('it_IT', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Inserisci città fatturazione', 'Error: When billing city is empty.'),
1918
+ ('it_IT', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Inserisci stato fatturazione', 'Error: When billing state is empty.'),
1919
+ ('it_IT', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Inserisci Paese fatturazione', 'Error: When billing country is empty.'),
1920
+ ('it_IT', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Inserisci fatturazione strada', 'Error: When billing street is empty.'),
1921
+ ('it_IT', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Inserisci fatturazione Cap', 'Error: When billing postcode is empty.'),
1922
+ ('it_IT', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Inserisci telefono fatturazione', 'Error: When billing telephone is empty.'),
1923
+ ('it_IT', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'Inserisci firstname spedizione', 'Error: When shipping firstname is empty.'),
1924
+ ('it_IT', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Inserisci cognome spedizione', 'Error: When shipping lastname is empty.'),
1925
+ ('it_IT', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Inserisci il trasporto della città', 'Error: When shipping city is empty.'),
1926
+ ('it_IT', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Inserisci Stato spedizione', 'Error: When shipping state is empty.'),
1927
+ ('it_IT', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Inserisci paese trasporto', 'Error: When shipping country is empty.'),
1928
+ ('it_IT', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Inserisci strada spedizione', 'Error: When shipping street is empty.'),
1929
+ ('it_IT', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Inserisci codice postale di spedizione', 'Error: When shipping postcode is empty.'),
1930
+ ('it_IT', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Inserisci telefonica spedizione', 'Error: When shipping telephone is empty.'),
1931
+ ('it_IT', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Metodo di trasporto', 'Label: Shipping Method page title. '),
1932
+ ('it_IT', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Seleziona metodo di spedizione', 'Label: Label for Select shipping method options.'),
1933
+ ('it_IT', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Seleziona metodo di spedizione', 'Error: When shipment method is not selected.'),
1934
+ ('it_IT', 'label', 'Payment_Method', 'Payment Method', '25', 'metodo di pagamento', 'Label: Payment Method page title. '),
1935
+ ('it_IT', 'label', 'Select_payment_method', 'Select payment method', '25', 'Seleziona metodo di pagamento', 'Label: Label for Select payment method options.'),
1936
+ ('it_IT', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Seleziona metodo di pagamento', 'Error: When payment method is not selected.'),
1937
+ ('it_IT', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Oops, qualcosa di sbagliato è successo', 'Error: When magento return unexpected error.'),
1938
+ ('it_IT', 'label', 'Credit_Card', 'Credit Card', '25', 'carta di credito', 'Label: Label for credit card field, available on payment page. '),
1939
+ ('it_IT', 'label', 'Name_on_card', 'Name on card', '25', 'Nome sulla carta', 'Label: Label for name of card field, available on payment page. '),
1940
+ ('it_IT', 'label', 'Credit_card_type', 'Credit card type', '25', 'Tipo carta di credito', 'Label: Label for CC type field, available on payment page. '),
1941
+ ('it_IT', 'label', 'Credit_card_number', 'Credit card number', '25', 'Numero di carta di credito', 'Label: Label for CC number field, available on payment page. '),
1942
+ ('it_IT', 'label', 'Expiration_Date', 'Expiration Date', '25', 'data di scadenza', 'Label: Label for CC expiry date field, available on payment page. '),
1943
+ ('it_IT', 'label', 'Month', 'Month', '25', 'mese', 'Label: Label for CC expiry month field, available on payment page. '),
1944
+ ('it_IT', 'label', 'Year', 'Year', '25', 'anno', 'Label: Label for CC expiry year field, available on payment page. '),
1945
+ ('it_IT', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Card Verification Number', 'Label: Label for CC verification number field, available on payment page. '),
1946
+ ('it_IT', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Inserire nome sulla carta', 'Error: When name on card is empty.'),
1947
+ ('it_IT', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Selezionare il tipo di carta di credito', 'Error: When credit card type is not selected.'),
1948
+ ('it_IT', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Inserire il numero di carta di credito', 'Error: When credit card number is empty.'),
1949
+ ('it_IT', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Imposta mese di scadenza', 'Error: When expiry month is empty.'),
1950
+ ('it_IT', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Impostare l\'anno di scadenza', 'Error: When expiry year is empty.'),
1951
+ ('it_IT', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Impostare il numero di verifica della carta', 'Error: When card verification number is empty.'),
1952
+ ('it_IT', 'label', 'Order_Review', 'Order Review', '15', 'ordine recensione', 'Label: Order Review page title. '),
1953
+ ('it_IT', 'label', 'Agreements', 'Agreements', '25', 'accordi', 'Label: Label for Agreements, available on oprder review screen.'),
1954
+ ('it_IT', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Accetta i termini e le condizioni', 'Error: When user did not agreed on sign up terms.'),
1955
+ ('it_IT', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Spedizione &amp; trattare', 'Label: Label for Shipping &amp; Handling.'),
1956
+ ('it_IT', 'label', 'Place_Order', 'Place Order', '25', 'Ordina', 'Label: Place Order button title.'),
1957
+ ('it_IT', 'label', 'Order_Success', 'Order Success', '15', 'ordine Successo', 'Label: Order Success page title. '),
1958
+ ('it_IT', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Grazie per il vostro acquisto!', 'Message: When order successfully placed. '),
1959
+ ('it_IT', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'Riceverai una mail di conferma dell\'ordine con i dettagli del tuo ordine e un link per monitorare i progressi.', 'Text: When order successfully placed '),
1960
+ ('it_IT', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'Continua Shopping', 'LabeL: Continue Shopping button title. '),
1961
+ ('it_IT', 'label', 'Error', 'Error', '15', 'errore', 'Label: Error '),
1962
+ ('it_IT', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'Prodotto aggiunto con successo in lista dei desideri', 'Message: When item added into Wishlist.'),
1963
+ ('it_IT', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Voce rimosso dalla lista dei desideri', 'Message: When Item removed from wishlist.'),
1964
+ ('it_IT', 'label', 'Wishlist', 'Wishlist', '15', 'Wishlist', 'Label: Wishlist page title. '),
1965
+ ('it_IT', 'label', 'Remove', 'Remove', '10', 'rimuovere', 'Label: Remove button title.'),
1966
+ ('it_IT', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'Non scartare trovato', 'Text: When No wishlist items found.'),
1967
+ ('it_IT', 'label', 'Orders', 'Orders', '15', 'ordini', 'Label: Orders history page title.'),
1968
+ ('it_IT', 'label', 'Order_History', 'Order History', '20', 'Cronologia ordini', 'Label: Order History button title. '),
1969
+ ('it_IT', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'Nessun ordine trovato', 'Text: When no order history found. '),
1970
+ ('it_IT', 'label', 'Order_Detail', 'Order Detail', '15', 'Dettagli ordine', 'Label: Order Detail page title. '),
1971
+ ('it_IT', 'label', 'Ordered_Items', 'Ordered Items', '25', 'articoli ordinati', 'Label: Ordered Items block heading or title. '),
1972
+ ('it_IT', 'label', 'Order_Number', 'Order Number', '20', 'numero d\'ordine', 'Label: Label for Order Number.'),
1973
+ ('it_IT', 'label', 'Order_Date', 'Order Date', '20', 'Data ordine', 'Label: Label for Order Date.'),
1974
+ ('it_IT', 'label', 'User', 'User', '10', 'utente', 'Label: Label for User.'),
1975
+ ('it_IT', 'label', 'Info', 'Info', '15', 'su', 'Label: About page title (CMS/about module)'),
1976
+ ('it_IT', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'Aggiungi alla lista dei desideri', 'Label: Add To Wishlist button title.'),
1977
+ ('it_IT', 'label', 'Logout', 'Logout', '10', 'Logout', 'Label: Logout button title.'),
1978
+ ('it_IT', 'label', 'Search_Product', 'Search Product', '50', 'Cerca prodotto', 'Label: Search Product.'),
1979
+ ('it_IT', 'label', 'Apply', 'Apply', '8', 'applicare', 'Label: Apply button title (to apply discount)'),
1980
+ ('it_IT', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Codici promozionali applicato con successo', 'Message: When coupon code is applied.'),
1981
+ ('it_IT', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Codici promozionali rimosso con successo', 'Message: When coupon code is removed. '),
1982
+ ('it_IT', 'label', 'Discount_Code', 'Discount Code', '25', 'Codice Sconto', 'Label: Label for Discount Code.'),
1983
+ ('it_IT', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'Aggiornamento Wishlist', 'Label: Update Wishlist button title.'),
1984
+ ('it_IT', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'Articolo aggiornato con successo', 'Message: When wishlist updated successfully.'),
1985
+ ('it_IT', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Cant Load Wishlist Item', 'Error: When requested wishlist item Can not Load. '),
1986
+ ('it_IT', 'message', 'Please_Select', 'Please select ', '25', 'seleziona', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
1987
+ ('it_IT', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'Prodotti Links scaricabili', 'Label: Label for Product Downloadable Links.'),
1988
+ ('it_IT', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Codice coupon valido', 'Error: When coupon code is invalid.'),
1989
+ ('it_IT', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Effettua il login per continuare', 'Error: When action required login '),
1990
+ ('it_IT', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'Inserisci firstname', 'Error: When firstname is empty in signup form. '),
1991
+ ('it_IT', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'Inserisci cognome', 'Error: When lastname is empty in signup form. '),
1992
+ ('it_IT', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'Inserire l\'indirizzo e-mail', 'Error: When email address is empty in signup form. '),
1993
+ ('it_IT', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'Inserire la password', 'Error: When password is empty in signup form. '),
1994
+ ('it_IT', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Account già esistente', 'Error: When email address already exists.'),
1995
+ ('it_IT', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'Impossibile salvare indirizzo del cliente', 'Error: When error occure while saving customer Address.'),
1996
+ ('it_IT', 'message', 'No_Data_Found', 'No Data Found', '100', 'Nessun dato trovato', 'Error: When no data found for requested page.'),
1997
+ ('it_IT', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Non è più disponibile Prodotto', 'Error: When requested product is no londer available.'),
1998
+ ('it_IT', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'Elemento richiesto non trovato', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
1999
+ ('it_IT', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'Elemento richiesto non trovato', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
2000
+ ('it_IT', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Opps! Elemento non può caricare', 'Error: When wishlist can\'t load because of unexpected error.'),
2001
+ ('it_IT', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'Elemento richiesto non trovato', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
2002
+ ('it_IT', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'Elemento richiesto non trovato', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
2003
+ ('it_IT', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'Elemento richiesto non trovato', 'Error: When system can not load wishlist Item.'),
2004
+ ('it_IT', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Non è più disponibile articolo richiesto', 'Error: When requested product is no longer available.'),
2005
+ ('it_IT', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'Articolo è stato eliminato dal carrello', 'Error: When Item has been deleted from cart.'),
2006
+ ('it_IT', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'Non tutti i prodotti sono disponibili in auantity richiesto', 'Error: When any of the product from cart is no longer available.'),
2007
+ ('it_IT', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'Accetta tutti i termini e le condizioni prima di ordinare', 'Error: When user did not agree on all required addreement while placing order.'),
2008
+ ('it_IT', 'label', 'Filter', 'Filter', '10', 'filtro', 'Label: Label for Filters.'),
2009
+ ('it_IT', 'label', 'Reset_Filter', 'Reset Filter', '15', 'reset Filter', 'Label: Reset Filter link title.'),
2010
+ ('it_IT', 'label', 'Reset', 'Reset', '10', 'reset', 'Label: Reset button title.'),
2011
+ ('it_IT', 'label', 'Popularity', 'Popularity', '25', 'popolarità', 'Label: Label for filter: Popularity option. '),
2012
+ ('it_IT', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', 'Prezzo: decrescente', 'Label: Label for filter: Price-High To Low option. '),
2013
+ ('it_IT', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', 'Prezzo: Crescente', 'Label: Label for filter: Price-Low To High option.'),
2014
+ ('it_IT', 'label', 'Rating', 'Rating', '25', 'valutazione', 'Label: Label for filter: Rating option '),
2015
+ ('it_IT', 'label', 'Name-A_To_Z', 'Name-A To Z', '25', 'Nome: dalla A alla Z', 'Label: Label for filter: Name-A To Z option.'),
2016
+ ('it_IT', 'label', 'Name-Z_To_A', 'Name-Z To A', '25', 'Nome: dalla Z alla A', 'Label: Label for filter: Name-Z To A option.'),
2017
+ ('it_IT', 'label', 'Newest', 'Newest', '25', 'Newest', 'Label: Label for filter: Newest option.'),
2018
+ ('it_IT', 'label', 'Submit_Review', 'Submit Review', '25', 'Invia Recensione', 'Label: Submit Review button title.'),
2019
+ ('it_IT', 'label', 'User_Reviews', 'User Reviews', '25', 'Recensioni degli utenti', 'Label: User Reviews page title. '),
2020
+ ('it_IT', 'label', 'No_Reviews_Found', 'No Reviews Found', '25', 'Nessuna recensione trovata', 'Label: Text as No Reviews Found'),
2021
+ ('it_IT', 'label', 'Average_User_Rating', 'Average User Rating', '25', 'Valutazione media degli utenti', 'Label: Label for Average User Rating.'),
2022
+ ('it_IT', 'label', 'Reviews', 'Reviews', '25', 'Recensioni', 'Label: Label for Reviews.'),
2023
+ ('it_IT', 'label', 'Nickename', 'Nickename', '25', 'Nickename', 'Label: Label for Nickename field, available on submit review form.'),
2024
+ ('it_IT', 'label', 'Summary_Of_Your_Review', 'Summary Of Your Review', '25', 'Sommario della tua recensione', 'Label: Label for review summary field, available on submit review form.'),
2025
+ ('it_IT', 'label', 'Comments', 'Comments', '25', 'Commenti', 'Label: Label for comments field, available on submit review form.'),
2026
+ ('it_IT', 'label', 'You_May_Also_Like', 'You May Also Like', '25', 'Potrebbe piacerti anche', 'Label: Label for related product slider on product detail page.'),
2027
+ ('it_IT', 'message', 'Please_Select_One_Of_Each_Of_The_Ratings', 'Please Select One Of Each Of The Ratings', '100', 'Selezionare uno di ciascuno dei rating', 'Error: When feedback ratings is not selected for the product.'),
2028
+ ('it_IT', 'message', 'Please_Enter_Nickename', 'Please Enter Nickename', '100', 'Inserisci il tuo nickename', 'Error: When feedback nickename is empty.'),
2029
+ ('it_IT', 'message', 'Please_Enter_Summary', 'Please Enter Summary', '100', 'Inserire il feedback generale', 'Error: When feedback summary is empty.'),
2030
+ ('it_IT', 'message', 'Please_Enter_Comments', 'Please Enter Comments', '100', 'Inserisci i tuoi commenti', 'Error: When feedback comments is empty.'),
2031
+ ('it_IT', 'label', 'Recently_Viewed', 'Recently Viewed', '25', 'Vista l\'ultima volta', 'Label: Recently Viewed'),
2032
+ ('it_IT', 'message', 'Plugin_Not_Supported', 'Plugin Not Supported', '100', 'Questa azione non può essere eseguita sul dispositivo. Supporto richiesto non è disponibile su questo dispositivo.', 'Error: When the device is not supported for requested action such as share functionality.'),
2033
+ ('it_IT', 'label', 'Share', 'Share', '7', 'quota', 'Label:Share button title.'),
2034
+ ('it_IT', 'label', 'Shopping_Products', 'Shopping Products', '20', 'Prodotti', 'Label:Label for Shopping Products, available on left panel on product detail page.'),
2035
+ ('it_IT', 'label', 'Edit', 'Edit', '6', 'Modifica', 'Label:Edit button title, available on wishlist page. '),
2036
+ ('it_IT', 'label', 'More_Information', 'More Information', '25', 'Maggiori informazioni', 'Label:More information about product'),
2037
+ ('it_IT', 'label', 'Share_App', 'Share App', '12', 'Share App', 'Label:Share app on CMS page'),
2038
+ ('it_IT', 'label', 'Sample_Links', 'Sample Links', '20', 'Links campione', 'Label:Sample Links on product detail page'),
2039
+ ('it_IT', 'label', 'Maximum_Number_Of_Characters', 'Maximum number of characters', '50', 'Numero massimo di caratteri', 'Label:Maximum number of characters for configurable product'),
2040
+ ('it_IT', 'message', 'Payment_Cancelled', 'Payment Cancelled', '50', 'pagamento Annullato', 'Message:Payment cancelled when user cancel payment'),
2041
+ ('it_IT', 'label', 'Tracking_Numbers', 'Tracking Numbers', '50', 'numeri di inseguimento', 'Label:Tracking Numbers on order detail page'),
2042
+ ('it_IT', 'label', 'Track', 'Track', '15', 'pista', 'Label:Button on order detail page'),
2043
+ ('it_IT', 'label', 'Installment', 'Installment', '15', 'rata', 'Label:On product detail page'),
2044
+ ('it_IT', 'label', 'Installment_Amount', 'Installment Amount', '20', 'Importo Rata', 'Label:On product detail page'),
2045
+ ('it_IT', 'label', 'Total_Amount', 'Total Amount', '15', 'importo totale', 'Label:On product detail page'),
2046
+ ('it_IT', 'label', 'Single_Shot', 'Single Shot', '15', 'single Shot', 'Label:For payuapi gateway on credit card page'),
2047
+ ('it_IT', 'message', 'Please_select_installment_option', 'Please Select Installment Option', '100', 'Selezionare l\'opzione Rata', 'Message:On credit card page where installment option is required'),
2048
+ ('it_IT', 'label', 'January', 'January', '50', 'gennaio', 'Label:Month name on credit card page'),
2049
+ ('it_IT', 'label', 'February', 'February', '50', 'febbraio', 'Label:Month name on credit card page'),
2050
+ ('it_IT', 'label', 'March', 'March', '50', 'marzo', 'Label:Month name on credit card page'),
2051
+ ('it_IT', 'label', 'April', 'April', '50', 'aprile', 'Label:Month name on credit card page'),
2052
+ ('it_IT', 'label', 'May', 'May', '50', 'maggio', 'Label:Month name on credit card page'),
2053
+ ('it_IT', 'label', 'June', 'June', '50', 'giugno', 'Label:Month name on credit card page'),
2054
+ ('it_IT', 'label', 'July', 'July', '50', 'luglio', 'Label:Month name on credit card page'),
2055
+ ('it_IT', 'label', 'August', 'August', '50', 'agosto', 'Label:Month name on credit card page'),
2056
+ ('it_IT', 'label', 'September', 'September', '50', 'settembre', 'Label:Month name on credit card page'),
2057
+ ('it_IT', 'label', 'October', 'October', '50', 'ottobre', 'Label:Month name on credit card page'),
2058
+ ('it_IT', 'label', 'November', 'November', '50', 'novembre', 'Label:Month name on credit card page'),
2059
+ ('it_IT', 'label', 'December', 'December', '50', 'dicembre', 'Label:Month name on credit card page'),
2060
+ ('tr_TR', 'message', 'Please_wait', 'Please wait', '100', 'lütfen bekleyin', 'Error: When user trigger new action while previous one is still processsing.'),
2061
+ ('tr_TR', 'label', 'or', 'or', '25', 'veya', 'Label: Display to show 2 action options.'),
2062
+ ('tr_TR', 'label', 'Home', 'Home', '8', 'ev', 'Label: Home page title and button title.'),
2063
+ ('tr_TR', 'message', 'No_internet_connection', 'No internet connection', '100', 'Hiçbir internet baÄŸlantısı', 'Message:No internet connection'),
2064
+ ('tr_TR', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Alışveriş Kategorisi', 'Label: Shopping Category'),
2065
+ ('tr_TR', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', 'Oops! Sonuç kategorisi vardır.', 'Text: When no category found.'),
2066
+ ('tr_TR', 'label', 'Shop_by_category', 'Shop by category', '25', 'Kategoriye göre alışveriÅŸ', 'Label: Title to show above category names.'),
2067
+ ('tr_TR', 'label', 'Categories', 'Categories', '20', 'Kategoriler', 'Label: Title to show on homepage, above the category.'),
2068
+ ('tr_TR', 'label', 'All_Products', 'All Products', '20', 'Tüm Ürünler', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
2069
+ ('tr_TR', 'label', 'Profile', 'Profile', '10', 'profil', 'Label: Profile page title and button title.'),
2070
+ ('tr_TR', 'label', 'List_Page', 'List Page', '15', 'listesi Sayfası', 'Label: Page title'),
2071
+ ('tr_TR', 'label', 'Product_List', 'Product List', '15', 'Ürün Listesi', 'Label: Product List page title '),
2072
+ ('tr_TR', 'label', 'products_found', 'products found', '20', 'ürün bulundu', 'Label: Label displayed on product listing page to show No. of products found. '),
2073
+ ('tr_TR', 'label', 'Product_Detail', 'Product Detail', '15', 'Ürün Detayı', 'Label: Product Detail page title'),
2074
+ ('tr_TR', 'label', 'Details', 'Details', '10', 'ayrıntılar', 'Label: Label displayed above the product detail on product detail page.'),
2075
+ ('tr_TR', 'label', 'Buy_Now', 'Buy Now', '10', 'Åžimdi Al', 'Label: Buy Now button title.'),
2076
+ ('tr_TR', 'label', 'Choose_an_option', 'Choose an option', '20', 'Bir seçenek seçin', 'Label: First option for product options.'),
2077
+ ('tr_TR', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'ÖÄŸe baÅŸarıyla eklendi', 'Message: When the Item added successfully into the cart. '),
2078
+ ('tr_TR', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'Hiçbir ürün bulundu.', 'Text: When no products found for selected search criteria or category.'),
2079
+ ('tr_TR', 'label', 'Load_More', 'Load More', '10', 'Daha Yük', 'Label: Load More button title, displayed on product listing pages.'),
2080
+ ('tr_TR', 'label', 'Viewers', 'Viewers', '10', 'izleyiciler', 'Label: Viewers Label.'),
2081
+ ('tr_TR', 'label', 'Add_to_cart', 'Add to cart', '15', 'Sepete ekle', 'Label: Add to cart button title.'),
2082
+ ('tr_TR', 'label', 'Downloadable_link', 'Downloadable link', '20', 'İndirilebilir bağlantı', 'Label: Downloadable link title. '),
2083
+ ('tr_TR', 'label', 'Review', 'Review', '10', 'İnceleme', 'Label: Review text and button title.'),
2084
+ ('tr_TR', 'message', 'No_reviews_found', 'No reviews found', '100', 'Yorum bulunamadı', 'Text: When no reviews found for selected product.'),
2085
+ ('tr_TR', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'Alışveriş Sepeti', 'Label: Shopping Cart button title.'),
2086
+ ('tr_TR', 'label', 'QTY', 'QTY', '5', 'Miktar', 'Label: Label for product Quantity.'),
2087
+ ('tr_TR', 'label', 'TOTAL', 'TOTAL', '15', 'TOPLAM', 'Label: Label for cart &amp; order total. '),
2088
+ ('tr_TR', 'label', 'Subtotal', 'Subtotal', '15', 'ara toplam', 'Label: Label for cart &amp; order subtotal.'),
2089
+ ('tr_TR', 'label', 'Tax', 'Tax', '5', 'vergi', 'Label: Label for cart &amp; order Tax.'),
2090
+ ('tr_TR', 'label', 'Discount', 'Discount', '15', 'indirim', 'Label: Label for cart &amp; order discount. '),
2091
+ ('tr_TR', 'label', 'Grand_Total', 'Grand Total', '15', 'genel Toplam', 'Label: Label for cart &amp; order grand total.'),
2092
+ ('tr_TR', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'Alışveriş sepeti boş.', 'Error: When the shopping cart is empty.'),
2093
+ ('tr_TR', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Sepeti baÅŸarıyla güncellendi', 'Message: When the cart updated successfully.'),
2094
+ ('tr_TR', 'label', 'Update_Cart', 'Update Cart', '15', 'Güncelleme Sepeti', 'Label: Update Cart button title. '),
2095
+ ('tr_TR', 'label', 'Checkout', 'Checkout', '10', 'Ödeme', 'Label: Checkout button title.'),
2096
+ ('tr_TR', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'Sepet boÅŸ', 'Text: When the cart is empty. '),
2097
+ ('tr_TR', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'Sepetinize öÄŸenin bir sorun olması olduÄŸunu', 'Text: When one of the cart item is having error such as not available or so.'),
2098
+ ('tr_TR', 'label', 'Login', 'Login', '7', 'Oturum Aç', 'Label: Login button title.'),
2099
+ ('tr_TR', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'EriÅŸmek için kullanıcı adınızı ÅŸifrenizi giriniz.', 'Error: When requested action required login.'),
2100
+ ('tr_TR', 'label', 'Username', 'Username', '20', 'Kullanıcı adı', 'Label: Label for Username field.'),
2101
+ ('tr_TR', 'label', 'Password', 'Password', '20', 'ÅŸifre', 'Label: Label for password field.'),
2102
+ ('tr_TR', 'label', 'Sign_Up', 'Sign Up', '10', 'Kaydol', 'Label: Sign Up button title.'),
2103
+ ('tr_TR', 'message', 'Enter_username', 'Enter username', '100', 'adını girin', 'Error: When username is empty.'),
2104
+ ('tr_TR', 'message', 'Enter_password', 'Enter password', '100', 'ÅŸifrenizi girin', 'Error: When password is empty. '),
2105
+ ('tr_TR', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Geçersiz kullanıcı adı veya ÅŸifre', 'Error: When Invalid username or password entered.'),
2106
+ ('tr_TR', 'label', 'First_name', 'First name', '20', 'isim', 'Label: Label for firstname field.'),
2107
+ ('tr_TR', 'label', 'Last_name', 'Last name', '20', 'soyadı', 'Label: Label for lastname field.'),
2108
+ ('tr_TR', 'label', 'Your_Email', 'Your Email', '20', 'E-posta', 'Label: Label for email address field.'),
2109
+ ('tr_TR', 'label', 'Submit', 'Submit', '10', 'sunmak', 'Label: Submit button title.'),
2110
+ ('tr_TR', 'label', 'Signup_Form', 'Signup Form', '15', 'Kayıt Formu', 'Label: Signup Form page title.'),
2111
+ ('tr_TR', 'label', 'Signup', 'Signup', '10', 'Kaydol', 'Label: Signup button title.'),
2112
+ ('tr_TR', 'message', 'Enter_firstname', 'Enter firstname', '100', 'firstName girin', 'Error: When firstname is empty. '),
2113
+ ('tr_TR', 'message', 'Enter_lastname', 'Enter lastname', '100', 'lastname girin', 'Error: When lastname is empty.'),
2114
+ ('tr_TR', 'message', 'Enter_email', 'Enter email', '100', 'E-posta adresinizi girin', 'Error: When email address is empty.'),
2115
+ ('tr_TR', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Geçerli bir e-posta adresi girin', 'Error: When email address is invalid.'),
2116
+ ('tr_TR', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', 'Tebrikler! Başarıyla kayıtlı', 'Message: When successfully registration has been done. '),
2117
+ ('tr_TR', 'message', 'Please_check_your_email', 'Please check your email', '100', 'E-postanızı kontrol edin', 'Message: When user reset their password. '),
2118
+ ('tr_TR', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Parolanızı Mı Unuttunuz', 'Label: Forgot Password button title.'),
2119
+ ('tr_TR', 'label', 'Shipping', 'Shipping', '20', 'nakliye', 'Label: Label for Shipping. '),
2120
+ ('tr_TR', 'label', 'Billing', 'Billing', '20', 'fatura', 'Label: Label for Billing'),
2121
+ ('tr_TR', 'label', 'Address', 'Address', '20', 'adres', 'Label: Label for address field, available on payment page. '),
2122
+ ('tr_TR', 'label', 'Payment', 'Payment', '20', 'ödeme', 'Label: Label for payment field, available on payment page.'),
2123
+ ('tr_TR', 'label', 'Continue', 'Continue', '20', 'devam etmek', 'Label: Continue button title. '),
2124
+ ('tr_TR', 'label', 'Billing_Address', 'Billing Address', '20', 'fatura Adresi', 'Label: Label for Billing Address.'),
2125
+ ('tr_TR', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Adres defterinden bir fatura adresi seçin veya yeni bir adres girin.', 'Label: Title available on billing addresses drop down.'),
2126
+ ('tr_TR', 'label', 'New_Address', 'New Address', '20', 'yeni Adres', 'Label: Title for New Billing Address form.'),
2127
+ ('tr_TR', 'label', 'Company', 'Company', '20', 'ÅŸirket', 'Label: Label for company field, available on address page. '),
2128
+ ('tr_TR', 'label', 'City', 'City', '20', 'ÅŸehir', 'Label: Label for city field, available on address page. '),
2129
+ ('tr_TR', 'label', 'State', 'State', '20', 'devlet', 'Label: Label for state field, available on address page. '),
2130
+ ('tr_TR', 'label', 'Country', 'Country', '20', 'ülke', 'Label: Label for country field, available on address page. '),
2131
+ ('tr_TR', 'label', 'select', 'select', '20', 'seçmek', 'Label: Label for drop downs. '),
2132
+ ('tr_TR', 'label', 'Billing_street', 'Billing street', '20', 'fatura sokak', 'Label: Label for billing street field, available on address page. '),
2133
+ ('tr_TR', 'label', 'Postcode', 'Postcode', '20', 'posta kodu', 'Label: Label for postcode field, available on address page. '),
2134
+ ('tr_TR', 'label', 'Telephone', 'Telephone', '20', 'telefon', 'Label: Label for telephone field, available on address page. '),
2135
+ ('tr_TR', 'label', 'Same_as_billing', 'Same as billing', '25', 'Fatura ile aynı', 'Label: Label for Same as billing option. '),
2136
+ ('tr_TR', 'label', 'Shipping_Address', 'Shipping Address', '25', 'Teslimat Adresi', 'Label: Title for Shipping Address form.'),
2137
+ ('tr_TR', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Adres defterinden bir sevkıyat adresi seçin veya yeni bir adres girin.', 'Label: Title available on shipping addresses drop down.'),
2138
+ ('tr_TR', 'label', 'Shipping_street', 'Shipping street', '25', 'Nakliye sokak', 'Label: Label for shipping street field, available on address page. '),
2139
+ ('tr_TR', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Fatura firstName girin', 'Error: When billing firstname is empty.'),
2140
+ ('tr_TR', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Fatura lastname girin', 'Error: When billing lastname is empty.'),
2141
+ ('tr_TR', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Fatura ÅŸehir girin', 'Error: When billing city is empty.'),
2142
+ ('tr_TR', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Fatura durumu girin', 'Error: When billing state is empty.'),
2143
+ ('tr_TR', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Fatura ülkeyi girin', 'Error: When billing country is empty.'),
2144
+ ('tr_TR', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Sokak fatura girin', 'Error: When billing street is empty.'),
2145
+ ('tr_TR', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Posta kodu fatura girin', 'Error: When billing postcode is empty.'),
2146
+ ('tr_TR', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Fatura telefon giriniz', 'Error: When billing telephone is empty.'),
2147
+ ('tr_TR', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'FirstName nakliye girin', 'Error: When shipping firstname is empty.'),
2148
+ ('tr_TR', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Lastname nakliye girin', 'Error: When shipping lastname is empty.'),
2149
+ ('tr_TR', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Åžehir nakliye giriniz', 'Error: When shipping city is empty.'),
2150
+ ('tr_TR', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Devlet nakliye girin', 'Error: When shipping state is empty.'),
2151
+ ('tr_TR', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Nakliye ülke girin', 'Error: When shipping country is empty.'),
2152
+ ('tr_TR', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Sokak nakliye girin', 'Error: When shipping street is empty.'),
2153
+ ('tr_TR', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Posta kodu nakliye giriniz', 'Error: When shipping postcode is empty.'),
2154
+ ('tr_TR', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Telefon nakliye giriniz', 'Error: When shipping telephone is empty.'),
2155
+ ('tr_TR', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Nakliye Yöntemi', 'Label: Shipping Method page title. '),
2156
+ ('tr_TR', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Seç nakliye yöntemi', 'Label: Label for Select shipping method options.'),
2157
+ ('tr_TR', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Seç sevkiyat yöntemi', 'Error: When shipment method is not selected.'),
2158
+ ('tr_TR', 'label', 'Payment_Method', 'Payment Method', '25', 'ödeme yöntemi', 'Label: Payment Method page title. '),
2159
+ ('tr_TR', 'label', 'Select_payment_method', 'Select payment method', '25', 'Seçin ödeme yöntemi', 'Label: Label for Select payment method options.'),
2160
+ ('tr_TR', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Seçin ödeme yöntemi', 'Error: When payment method is not selected.'),
2161
+ ('tr_TR', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Üzgünüz, bir ÅŸey yanlış Oldu', 'Error: When magento return unexpected error.'),
2162
+ ('tr_TR', 'label', 'Credit_Card', 'Credit Card', '25', 'kredi Kartı', 'Label: Label for credit card field, available on payment page. '),
2163
+ ('tr_TR', 'label', 'Name_on_card', 'Name on card', '25', 'Kartın üzerindeki ad', 'Label: Label for name of card field, available on payment page. '),
2164
+ ('tr_TR', 'label', 'Credit_card_type', 'Credit card type', '25', 'Kredi kartı tipi', 'Label: Label for CC type field, available on payment page. '),
2165
+ ('tr_TR', 'label', 'Credit_card_number', 'Credit card number', '25', 'Kredi Kartı Numarası', 'Label: Label for CC number field, available on payment page. '),
2166
+ ('tr_TR', 'label', 'Expiration_Date', 'Expiration Date', '25', 'Son kullanma tarihi', 'Label: Label for CC expiry date field, available on payment page. '),
2167
+ ('tr_TR', 'label', 'Month', 'Month', '25', 'ay', 'Label: Label for CC expiry month field, available on payment page. '),
2168
+ ('tr_TR', 'label', 'Year', 'Year', '25', 'yıl', 'Label: Label for CC expiry year field, available on payment page. '),
2169
+ ('tr_TR', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Kart Doğrulama Numarası', 'Label: Label for CC verification number field, available on payment page. '),
2170
+ ('tr_TR', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Karttaki adını girin', 'Error: When name on card is empty.'),
2171
+ ('tr_TR', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Seç kredi kartı türü', 'Error: When credit card type is not selected.'),
2172
+ ('tr_TR', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Kredi kartı numarasını girin', 'Error: When credit card number is empty.'),
2173
+ ('tr_TR', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Eylül bitiÅŸ ay', 'Error: When expiry month is empty.'),
2174
+ ('tr_TR', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Eylül bitiÅŸ yılı', 'Error: When expiry year is empty.'),
2175
+ ('tr_TR', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Eylül kart doÄŸrulama numarası', 'Error: When card verification number is empty.'),
2176
+ ('tr_TR', 'label', 'Order_Review', 'Order Review', '15', 'Sipariş İnceleme', 'Label: Order Review page title. '),
2177
+ ('tr_TR', 'label', 'Agreements', 'Agreements', '25', 'AnlaÅŸmalar', 'Label: Label for Agreements, available on oprder review screen.'),
2178
+ ('tr_TR', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Åžart ve koÅŸul kabul', 'Error: When user did not agreed on sign up terms.'),
2179
+ ('tr_TR', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Nakliye ve Taşıma', 'Label: Label for Shipping &amp; Handling.'),
2180
+ ('tr_TR', 'label', 'Place_Order', 'Place Order', '25', 'SipariÅŸ', 'Label: Place Order button title.'),
2181
+ ('tr_TR', 'label', 'Order_Success', 'Order Success', '15', 'Sipariş Başarı', 'Label: Order Success page title. '),
2182
+ ('tr_TR', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Satın aldığınız için teÅŸekkür ederiz!', 'Message: When order successfully placed. '),
2183
+ ('tr_TR', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'Sen ayrıntıları ve ilerleme cinsel yolla bulaÅŸan enfeksiyonların izlemek için bir baÄŸlantı ile sipariÅŸ bir sipariÅŸ onayı e-postası olacak.', 'Text: When order successfully placed '),
2184
+ ('tr_TR', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'Alışverişe Devam', 'LabeL: Continue Shopping button title. '),
2185
+ ('tr_TR', 'label', 'Error', 'Error', '15', 'hata', 'Label: Error '),
2186
+ ('tr_TR', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'ÖÄŸe baÅŸarıyla listesine eklenir', 'Message: When item added into Wishlist.'),
2187
+ ('tr_TR', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Ürün İstek çıkarıldı', 'Message: When Item removed from wishlist.'),
2188
+ ('tr_TR', 'label', 'Wishlist', 'Wishlist', '15', 'BeÄŸendiÄŸim', 'Label: Wishlist page title. '),
2189
+ ('tr_TR', 'label', 'Remove', 'Remove', '10', 'kaldır', 'Label: Remove button title.'),
2190
+ ('tr_TR', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'ÖÄŸe bulunamadı dilek', 'Text: When No wishlist items found.'),
2191
+ ('tr_TR', 'label', 'Orders', 'Orders', '15', 'SipariÅŸler', 'Label: Orders history page title.'),
2192
+ ('tr_TR', 'label', 'Order_History', 'Order History', '20', 'SipariÅŸ GeçmiÅŸi', 'Label: Order History button title. '),
2193
+ ('tr_TR', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'Hiçbir emir bulunamadı', 'Text: When no order history found. '),
2194
+ ('tr_TR', 'label', 'Order_Detail', 'Order Detail', '15', 'SipariÅŸ Detay', 'Label: Order Detail page title. '),
2195
+ ('tr_TR', 'label', 'Ordered_Items', 'Ordered Items', '25', 'Sıralı ÖÄŸeler', 'Label: Ordered Items block heading or title. '),
2196
+ ('tr_TR', 'label', 'Order_Number', 'Order Number', '20', 'Sipariş Numarası', 'Label: Label for Order Number.'),
2197
+ ('tr_TR', 'label', 'Order_Date', 'Order Date', '20', 'SipariÅŸ Tarihi', 'Label: Label for Order Date.'),
2198
+ ('tr_TR', 'label', 'User', 'User', '10', 'kullanıcı', 'Label: Label for User.'),
2199
+ ('tr_TR', 'label', 'Info', 'Info', '15', 'hakkında', 'Label: About page title (CMS/about module)'),
2200
+ ('tr_TR', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'İstek Ekle', 'Label: Add To Wishlist button title.'),
2201
+ ('tr_TR', 'label', 'Logout', 'Logout', '10', 'Çıkış', 'Label: Logout button title.'),
2202
+ ('tr_TR', 'label', 'Search_Product', 'Search Product', '50', 'Ürün Arama', 'Label: Search Product.'),
2203
+ ('tr_TR', 'label', 'Apply', 'Apply', '8', 'uygulamak', 'Label: Apply button title (to apply discount)'),
2204
+ ('tr_TR', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Kupon kodu başarıyla uygulandı', 'Message: When coupon code is applied.'),
2205
+ ('tr_TR', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Kupon kodu başarıyla kaldırıldı', 'Message: When coupon code is removed. '),
2206
+ ('tr_TR', 'label', 'Discount_Code', 'Discount Code', '25', 'İndirim Kodu', 'Label: Label for Discount Code.'),
2207
+ ('tr_TR', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'Güncelleme BeÄŸendiÄŸim', 'Label: Update Wishlist button title.'),
2208
+ ('tr_TR', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'ÖÄŸe baÅŸarıyla güncellendi', 'Message: When wishlist updated successfully.'),
2209
+ ('tr_TR', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Cant Yük Dilek ÖÄŸe', 'Error: When requested wishlist item Can not Load. '),
2210
+ ('tr_TR', 'message', 'Please_Select', 'Please select ', '25', 'Lütfen seçiniz', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
2211
+ ('tr_TR', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'İndirilebilir Ürün Linkler', 'Label: Label for Product Downloadable Links.'),
2212
+ ('tr_TR', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Geçersiz kupon kodu', 'Error: When coupon code is invalid.'),
2213
+ ('tr_TR', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Devam için giriÅŸ yapın', 'Error: When action required login '),
2214
+ ('tr_TR', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'firstName girin', 'Error: When firstname is empty in signup form. '),
2215
+ ('tr_TR', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'lastname girin', 'Error: When lastname is empty in signup form. '),
2216
+ ('tr_TR', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'E-posta adresinizi girin', 'Error: When email address is empty in signup form. '),
2217
+ ('tr_TR', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'ÅŸifrenizi girin', 'Error: When password is empty in signup form. '),
2218
+ ('tr_TR', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Hesap zaten var', 'Error: When email address already exists.'),
2219
+ ('tr_TR', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'MüÅŸteri adresini kaydedilemiyor', 'Error: When error occure while saving customer Address.'),
2220
+ ('tr_TR', 'message', 'No_Data_Found', 'No Data Found', '100', 'Hiçbir veri bulunamadı', 'Error: When no data found for requested page.'),
2221
+ ('tr_TR', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Artık mevcut ürün', 'Error: When requested product is no londer available.'),
2222
+ ('tr_TR', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'İstenen öÄŸe bulunamadı', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
2223
+ ('tr_TR', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'İstenen öÄŸe bulunamadı', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
2224
+ ('tr_TR', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Opps! ÖÄŸe yükleyemiyor', 'Error: When wishlist can\'t load because of unexpected error.'),
2225
+ ('tr_TR', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'İstenen öÄŸe bulunamadı', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
2226
+ ('tr_TR', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'İstenen öÄŸe bulunamadı', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
2227
+ ('tr_TR', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'İstenen öÄŸe bulunamadı', 'Error: When system can not load wishlist Item.'),
2228
+ ('tr_TR', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Artık mevcut İstenen öÄŸe', 'Error: When requested product is no longer available.'),
2229
+ ('tr_TR', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'Ürün sepeti silindi', 'Error: When Item has been deleted from cart.'),
2230
+ ('tr_TR', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'Tüm ürünler Talep auantity mevcuttur', 'Error: When any of the product from cart is no longer available.'),
2231
+ ('tr_TR', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'SipariÅŸ yerleÅŸtirme önce tüm ÅŸartları ve koÅŸulları kabul', 'Error: When user did not agree on all required addreement while placing order.'),
2232
+ ('tr_TR', 'label', 'Filter', 'Filter', '10', 'filtre', 'Label: Label for Filters.'),
2233
+ ('tr_TR', 'label', 'Reset_Filter', 'Reset Filter', '15', 'sıfırlama Filtre', 'Label: Reset Filter link title.'),
2234
+ ('tr_TR', 'label', 'Reset', 'Reset', '10', 'ayarlamak', 'Label: Reset button title.'),
2235
+ ('tr_TR', 'label', 'Popularity', 'Popularity', '25', 'popülerlik', 'Label: Label for filter: Popularity option. '),
2236
+ ('tr_TR', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', 'Fiyatı: DüÅŸük için Yüksek', 'Label: Label for filter: Price-High To Low option. '),
2237
+ ('tr_TR', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', 'Fiyat: Yüksek DüÅŸük için', 'Label: Label for filter: Price-Low To High option.'),
2238
+ ('tr_TR', 'label', 'Rating', 'Rating', '25', 'rating', 'Label: Label for filter: Rating option '),
2239
+ ('tr_TR', 'label', 'Name-A_To_Z', 'Name-A To Z', '25', 'Adı: A dan Z için', 'Label: Label for filter: Name-A To Z option.'),
2240
+ ('tr_TR', 'label', 'Name-Z_To_A', 'Name-Z To A', '25', 'İsim: Z A', 'Label: Label for filter: Name-Z To A option.'),
2241
+ ('tr_TR', 'label', 'Newest', 'Newest', '25', 'en yeni', 'Label: Label for filter: Newest option.'),
2242
+ ('tr_TR', 'label', 'Submit_Review', 'Submit Review', '25', 'Yorum Gönder', 'Label: Submit Review button title.'),
2243
+ ('tr_TR', 'label', 'User_Reviews', 'User Reviews', '25', 'kullanıcı Yorumları', 'Label: User Reviews page title. '),
2244
+ ('tr_TR', 'label', 'No_Reviews_Found', 'No Reviews Found', '25', 'Hiç yorum Bulunamadı', 'Label: Text as No Reviews Found'),
2245
+ ('tr_TR', 'label', 'Average_User_Rating', 'Average User Rating', '25', 'Ortalama Kullanıcı Değerlendirmesi', 'Label: Label for Average User Rating.'),
2246
+ ('tr_TR', 'label', 'Reviews', 'Reviews', '25', 'yorumlar', 'Label: Label for Reviews.'),
2247
+ ('tr_TR', 'label', 'Nickename', 'Nickename', '25', 'Nickename', 'Label: Label for Nickename field, available on submit review form.'),
2248
+ ('tr_TR', 'label', 'Summary_Of_Your_Review', 'Summary Of Your Review', '25', 'Yorumunuzun Özeti', 'Label: Label for review summary field, available on submit review form.'),
2249
+ ('tr_TR', 'label', 'Comments', 'Comments', '25', 'Yorumlar', 'Label: Label for comments field, available on submit review form.'),
2250
+ ('tr_TR', 'label', 'You_May_Also_Like', 'You May Also Like', '25', 'Åžunlar da hoÅŸunuza gidebilir', 'Label: Label for related product slider on product detail page.'),
2251
+ ('tr_TR', 'message', 'Please_Select_One_Of_Each_Of_The_Ratings', 'Please Select One Of Each Of The Ratings', '100', 'Yorumu her birini seçin', 'Error: When feedback ratings is not selected for the product.'),
2252
+ ('tr_TR', 'message', 'Please_Enter_Nickename', 'Please Enter Nickename', '100', 'Senin nickename girin', 'Error: When feedback nickename is empty.'),
2253
+ ('tr_TR', 'message', 'Please_Enter_Summary', 'Please Enter Summary', '100', 'Genel geribildirim girin', 'Error: When feedback summary is empty.'),
2254
+ ('tr_TR', 'message', 'Please_Enter_Comments', 'Please Enter Comments', '100', 'Yorumlarınızı girin', 'Error: When feedback comments is empty.'),
2255
+ ('tr_TR', 'label', 'Recently_Viewed', 'Recently Viewed', '25', 'son Görülen', 'Label: Recently Viewed'),
2256
+ ('tr_TR', 'message', 'Plugin_Not_Supported', 'Plugin Not Supported', '100', 'Bu eylem Sizin cihazda Yapılan olamaz. Gerekli destek Sizin cihazda mevcut değildir.', 'Error: When the device is not supported for requested action such as share functionality.'),
2257
+ ('tr_TR', 'label', 'Share', 'Share', '7', 'pay', 'Label:Share button title.'),
2258
+ ('tr_TR', 'label', 'Shopping_Products', 'Shopping Products', '20', 'Ürünler', 'Label:Label for Shopping Products, available on left panel on product detail page.'),
2259
+ ('tr_TR', 'label', 'Edit', 'Edit', '6', 'Düzenle', 'Label:Edit button title, available on wishlist page. '),
2260
+ ('tr_TR', 'label', 'More_Information', 'More Information', '25', 'Daha Fazla Bilgi', 'Label:More information about product'),
2261
+ ('tr_TR', 'label', 'Share_App', 'Share App', '12', 'Hisse App', 'Label:Share app on CMS page'),
2262
+ ('tr_TR', 'label', 'Sample_Links', 'Sample Links', '20', 'örnek Linkler', 'Label:Sample Links on product detail page'),
2263
+ ('tr_TR', 'label', 'Maximum_Number_Of_Characters', 'Maximum number of characters', '50', 'Maksimum karakter sayısı', 'Label:Maximum number of characters for configurable product'),
2264
+ ('tr_TR', 'message', 'Payment_Cancelled', 'Payment Cancelled', '50', 'Ödeme İptal Edildi', 'Message:Payment cancelled when user cancel payment'),
2265
+ ('tr_TR', 'label', 'Tracking_Numbers', 'Tracking Numbers', '50', 'Takip Numaraları', 'Label:Tracking Numbers on order detail page'),
2266
+ ('tr_TR', 'label', 'Track', 'Track', '15', 'iz', 'Label:Button on order detail page'),
2267
+ ('tr_TR', 'label', 'Installment', 'Installment', '15', 'taksit', 'Label:On product detail page'),
2268
+ ('tr_TR', 'label', 'Installment_Amount', 'Installment Amount', '20', 'Taksit Tutarı', 'Label:On product detail page'),
2269
+ ('tr_TR', 'label', 'Total_Amount', 'Total Amount', '15', 'toplam tutar', 'Label:On product detail page'),
2270
+ ('tr_TR', 'label', 'Single_Shot', 'Single Shot', '15', 'Tek Çekim', 'Label:For payuapi gateway on credit card page'),
2271
+ ('tr_TR', 'message', 'Please_select_installment_option', 'Please Select Installment Option', '100', 'Taksit SeçeneÄŸi Seçiniz', 'Message:On credit card page where installment option is required'),
2272
+ ('tr_TR', 'label', 'January', 'January', '50', 'Ocak', 'Label:Month name on credit card page'),
2273
+ ('tr_TR', 'label', 'February', 'February', '50', 'Åžubat', 'Label:Month name on credit card page'),
2274
+ ('tr_TR', 'label', 'March', 'March', '50', 'Mart', 'Label:Month name on credit card page'),
2275
+ ('tr_TR', 'label', 'April', 'April', '50', 'Nisan', 'Label:Month name on credit card page'),
2276
+ ('tr_TR', 'label', 'May', 'May', '50', 'Mayıs', 'Label:Month name on credit card page'),
2277
+ ('tr_TR', 'label', 'June', 'June', '50', 'Haziran', 'Label:Month name on credit card page'),
2278
+ ('tr_TR', 'label', 'July', 'July', '50', 'Temmuz', 'Label:Month name on credit card page'),
2279
+ ('tr_TR', 'label', 'August', 'August', '50', 'AÄŸustos', 'Label:Month name on credit card page'),
2280
+ ('tr_TR', 'label', 'September', 'September', '50', 'Eylül', 'Label:Month name on credit card page'),
2281
+ ('tr_TR', 'label', 'October', 'October', '50', 'Ekim', 'Label:Month name on credit card page'),
2282
+ ('tr_TR', 'label', 'November', 'November', '50', 'Kasım', 'Label:Month name on credit card page'),
2283
+ ('tr_TR', 'label', 'December', 'December', '50', 'Aralık', 'Label:Month name on credit card page');
2284
+ ");
2285
+ }
2286
+ }
2287
+ catch(Exception $e){}
2288
+ }
2289
+
2290
+ public function __createNewLanguageWords(){
2291
+ try{
2292
+
2293
+ $resource = Mage::getSingleton('core/resource');
2294
+ $conn = $resource->getConnection('core_read');
2295
+ }
2296
+ catch(Exception $e){
2297
+ echo $e->getMessage();
2298
+ }
2299
+ }
2300
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Home.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Home extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function _getHomeData($data)
6
+ {
7
+ $homedata['banners'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getHomepageBanners($data);
8
+ $homedata['recentlyViewed'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/catalog_catalog'))->getRecentlyViewedProducts();
9
+ $homedata['customCheckoutFields'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/custom'))->getCustomCheckoutFields();
10
+ $homedata['product_slider'] = Mage::getModel('mobiadmin/appwidget')->getProductSliderData($data);
11
+
12
+ return $homedata;
13
+ }
14
+
15
+ public function getHomeData($data)
16
+ {
17
+ $info = $this->successStatus();
18
+ $info['data'] = $this->_getHomeData($data);
19
+ return $info;
20
+ }
21
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Language.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Language extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function getLanguageData($locale_identifier = 'en_US')
6
+ {
7
+ $languageArray = array();
8
+ $languageCollection = Mage::getModel('mobiadmin/multilanguage')->getCollection()
9
+ ->addFieldToFilter('mm_language_code', $locale_identifier);
10
+
11
+ if($languageCollection->getSize()){
12
+ foreach($languageCollection as $languageData){
13
+ $languageArray[$languageData['mm_label_code']] = array(
14
+ 'label' => $languageData['mm_label'],
15
+ 'maxlength' => $languageData['mm_maxlength'],
16
+ 'text' => $languageData['mm_text'],
17
+ 'help' => $languageData['mm_help'],
18
+ 'type' => $languageData['mm_type']
19
+ );
20
+ }
21
+ return array($locale_identifier => array('labels' => $languageArray));;
22
+ }
23
+ else{
24
+ Mage::helper('mobiadmin')->setLanguageCodeData($locale_identifier);
25
+ return $this->getLanguageData($locale_identifier);
26
+ }
27
+ }
28
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Mobiservices.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Mobiservices extends Mage_Core_Model_Abstract {
4
+
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('mobiservices/mobiservices');
9
+ }
10
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Push.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Push extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function saveDeviceToken($data = array())
6
+ {
7
+ $appcode = isset($data['appcode']) ? $data['appcode'] : NULL;
8
+ $platform = isset($data['platform']) ? $data['platform'] : NULL;
9
+ $devicetoken = isset($data['devicetoken']) ? $data['devicetoken'] : NULL;
10
+
11
+ if(empty($appcode) || empty($platform) || empty($devicetoken)){
12
+ return $this->errorStatus("Please pass proper data");
13
+ }
14
+ else{
15
+ $collection = Mage::getModel('mobiadmin/devicetokens')->getCollection()
16
+ ->addFieldToFilter('md_appcode', $appcode)
17
+ ->addFieldToFilter('md_devicetype', $platform)
18
+ ->addFieldToFilter('md_devicetoken', $devicetoken);
19
+
20
+ if($collection->count() == 0){
21
+ Mage::getModel('mobiadmin/devicetokens')->setData(array(
22
+ 'md_appcode' => $appcode,
23
+ 'md_devicetype' => $platform,
24
+ 'md_devicetoken' => $devicetoken
25
+ ))->save();
26
+ }
27
+
28
+ return $this->successStatus();
29
+ }
30
+ }
31
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Review.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Added by Yash
5
+ * For rating andf review related functions
6
+ * Date: 27-10-2014
7
+ */
8
+ class Mobicommerce_Mobiservices_Model_1x0x3_Review extends Mobicommerce_Mobiservices_Model_Abstract {
9
+
10
+ /**
11
+ * Submit new review action
12
+ * @param productId=1&nickname=&title=&detail=&ratings[1]=1to5&ratings[2]:1to5&ratings[3]:1to5
13
+ */
14
+ public function submitReview($data = null)
15
+ {
16
+ $rating = $data['ratings'];
17
+ $productId = isset($data['productId'])?$data['productId']:0;
18
+ if (($product = $this->_initProduct($productId)) && !empty($data)) {
19
+ $session = Mage::getSingleton('core/session');
20
+ /* @var $session Mage_Core_Model_Session */
21
+ $review = Mage::getModel('review/review')->setData($data);
22
+ /* @var $review Mage_Review_Model_Review */
23
+
24
+ $validate = $review->validate();
25
+ if ($validate === true) {
26
+ try {
27
+ $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))
28
+ ->setEntityPkValue($product->getId())
29
+ ->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)
30
+ ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
31
+ ->setStoreId(Mage::app()->getStore()->getId())
32
+ ->setStores(array(Mage::app()->getStore()->getId()))
33
+ ->save();
34
+
35
+ foreach ($rating as $ratingId => $optionId) {
36
+ Mage::getModel('rating/rating')
37
+ ->setRatingId($ratingId)
38
+ ->setReviewId($review->getId())
39
+ ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
40
+ ->addOptionVote($optionId, $product->getId());
41
+ }
42
+
43
+ $review->aggregate();
44
+ $responseData = $this->successStatus(Mage::helper('core')->__('Your review has been accepted for moderation.'));
45
+ $productInfo = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/catalog_catalog'))->productInfo(array('product_id' => $productId));
46
+ $responseData['data']['product_details'] = $productInfo['data']['product_details'];
47
+ return $responseData;
48
+ }
49
+ catch (Exception $e) {
50
+ return $this->errorStatus(Mage::helper('core')->__('Unable to post the review.'));
51
+ }
52
+ }
53
+ else {
54
+ $session->setFormData($data);
55
+ if (is_array($validate)) {
56
+ $errorMessages = array();
57
+ foreach ($validate as $errorMessage) {
58
+ $errorMessages[] = $errorMessage;
59
+ }
60
+ return $this->errorStatus(implode(",", $errorMessages));
61
+ }
62
+ else {
63
+ return $this->errorStatus(Mage::helper('core')->__('Unable to post the review.'));
64
+ }
65
+ }
66
+ return $this->errorStatus("Please_Pass_Product_Id");
67
+ }
68
+
69
+ }
70
+
71
+ /**
72
+ * Initialize and check product
73
+ *
74
+ * @return Mage_Catalog_Model_Product
75
+ */
76
+ protected function _initProduct($productId = 0)
77
+ {
78
+ Mage::dispatchEvent('review_controller_product_init_before', array('controller_action'=>$this));
79
+ $categoryId = 0;//(int) $this->getRequest()->getParam('category', false);
80
+ $productId = (int) $productId;
81
+
82
+ $product = $this->_loadProduct($productId);
83
+ if (!$product) {
84
+ return false;
85
+ }
86
+
87
+ if ($categoryId) {
88
+ $category = Mage::getModel('catalog/category')->load($categoryId);
89
+ Mage::register('current_category', $category);
90
+ }
91
+
92
+ try {
93
+ Mage::dispatchEvent('review_controller_product_init', array('product'=>$product));
94
+ Mage::dispatchEvent('review_controller_product_init_after', array(
95
+ 'product' => $product,
96
+ 'controller_action' => $this
97
+ ));
98
+ } catch (Mage_Core_Exception $e) {
99
+ Mage::logException($e);
100
+ return false;
101
+ }
102
+
103
+ return $product;
104
+ }
105
+
106
+ /**
107
+ * Load product model with data by passed id.
108
+ * Return false if product was not loaded or has incorrect status.
109
+ *
110
+ * @param int $productId
111
+ * @return bool|Mage_Catalog_Model_Product
112
+ */
113
+ protected function _loadProduct($productId)
114
+ {
115
+ if (!$productId) {
116
+ return false;
117
+ }
118
+
119
+ $product = Mage::getModel('catalog/product')
120
+ ->setStoreId(Mage::app()->getStore()->getId())
121
+ ->load($productId);
122
+ /* @var $product Mage_Catalog_Model_Product */
123
+ if (!$product->getId() || !$product->isVisibleInCatalog() || !$product->isVisibleInSiteVisibility()) {
124
+ return false;
125
+ }
126
+
127
+ Mage::register('current_product', $product);
128
+ Mage::register('product', $product);
129
+
130
+ return $product;
131
+ }
132
+
133
+ /**
134
+ * Added by Yash
135
+ * To get rating options to show in product detail page
136
+ * Date: 28-10-2014
137
+ */
138
+ public function _getRatingOptions($data)
139
+ {
140
+ $ratingsOptions = Mage::getModel('rating/rating')
141
+ ->getResourceCollection()
142
+ ->addEntityFilter('product') # TOFIX
143
+ ->setPositionOrder()
144
+ ->setStoreFilter(Mage::app()->getStore()->getId())
145
+ ->addRatingPerStoreName(Mage::app()->getStore()->getId())
146
+ ->load();
147
+ $ratingsOptions->addEntitySummaryToItem($data['product_id'], Mage::app()->getStore()->getId());
148
+
149
+ /*
150
+ $ratingVoteUserArray = array();
151
+ if(isset($data['productReviews']) && !empty($data['productReviews'])):
152
+ foreach($data['productReviews'] as $productReviews):
153
+ if(!empty($productReviews['votes'])):
154
+ foreach($productReviews['votes'] as $votes):
155
+ if(array_key_exists($votes['rating_id'], $ratingVoteUserArray))
156
+ $ratingVoteUserArray[$votes['rating_id']]++;
157
+ else
158
+ $ratingVoteUserArray[$votes['rating_id']] = 1;
159
+ endforeach;
160
+ endif;
161
+ endforeach;
162
+ endif;
163
+ */
164
+
165
+ //$ratingData = $ratingsOptions->getData();
166
+ $ratingData = array();
167
+ if($ratingsOptions):
168
+ $key = 0;
169
+ foreach($ratingsOptions as $_rating):
170
+ $ratingData[$key] = $_rating->getData();
171
+ $ratingData[$key]['summary'] = $_rating->getSummary();
172
+ $ratingData[$key]['options'] = $_rating->getOptions();
173
+ if(empty($ratingData[$key]['summary']))
174
+ $ratingData[$key]['summary'] = 0;
175
+ /*
176
+ $ratingData[$key]['userCount'] = 0;
177
+ if(isset($ratingVoteUserArray[$ratingData[$key]['rating_id']]))
178
+ $ratingData[$key]['userCount'] = $ratingVoteUserArray[$ratingData[$key]['rating_id']];
179
+ */
180
+ $key++;
181
+ endforeach;
182
+ endif;
183
+
184
+ return $ratingData;
185
+ }
186
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Shoppingcart/Cart.php ADDED
@@ -0,0 +1,1078 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Shoppingcart_Cart extends Mobicommerce_Mobiservices_Model_Abstract
4
+ {
5
+ public function addtoCart($productData) {
6
+ $cart = $this->_getCart();
7
+ $params = $productData;
8
+
9
+ try {
10
+ if (isset($params->qty['qty'])) {
11
+ $filter = new Zend_Filter_LocalizedToNormalized(
12
+ array('locale' => Mage::app()->getLocale()->getLocaleCode())
13
+ );
14
+ $params['qty'] = $filter->filter($params['qty']);
15
+ }
16
+
17
+ $product = null;
18
+ $productId = (int) $params['product'];
19
+ if ($productId) {
20
+ $_product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())
21
+ ->load($productId);
22
+ if ($_product->getId()) {
23
+ $product = $_product;
24
+ }
25
+ }
26
+ $related = $params['related_product'];
27
+ $information = $this->successStatus();
28
+ if (!$product) {
29
+ return $this->errorStatus('Product_Is_Unavailable');
30
+ }
31
+
32
+ if ($product->isConfigurable()) {
33
+
34
+ $request = $this->_getProductRequest($params);
35
+ /**
36
+ * Hardcoded Configurable product default
37
+ * Set min required qty for a product if it's need
38
+ */
39
+ $qty = isset($params['qty']) ? $params['qty'] : 0;
40
+ $requestedQty = ($qty > 1) ? $qty : 1;
41
+ $subProduct = $product->getTypeInstance(true)
42
+ ->getProductByAttributes($request->getSuperAttribute(), $product);
43
+
44
+ if (!empty($subProduct)
45
+ && $requestedQty < ($requiredQty = $subProduct->getStockItem()->getMinSaleQty())
46
+ ) {
47
+ $requestedQty = $requiredQty;
48
+ }
49
+
50
+ $params['qty'] = $requestedQty;
51
+ }
52
+
53
+ $cart->addProduct($product, $params);
54
+ if (!empty($related)) {
55
+ $cart->addProductsByIds(explode(',', $related));
56
+ }
57
+
58
+ $cart->save();
59
+ $this->_getCheckoutSession()->setCartWasUpdated(true);
60
+ Mage::dispatchEvent('checkout_cart_add_product_complete', array('product' => $product, 'request' => Mage::app()->getRequest(), 'response' => Mage::app()->getResponse()));
61
+ $information['data']['cart_details'] = $this->getCartInfo();
62
+ if(Mobicommerce_Mobiservices_Model_Custom::REFRESH_CART_AFTER_ADD_PRODUCT){
63
+ $information['data']['cart_details'] = $this->getCartInfo();
64
+ }
65
+ }
66
+ catch (Mage_Core_Exception $e) {
67
+ $information = $this->errorStatus($e->getMessage());
68
+ return $information;
69
+ } catch (Exception $e) {
70
+ $information = $this->errorStatus($e->getMessage());
71
+ return $information;
72
+ }
73
+
74
+ return $information;
75
+ }
76
+
77
+ public function setDiscountCode($data){
78
+ $couponCode = $data['coupon_code'];
79
+ $return = array();
80
+ $information = '';
81
+
82
+ if ($data['remove'] == 1) {
83
+ $couponCode = '';
84
+ }
85
+
86
+ try {
87
+ $this->_getCart()->getQuote()->getShippingAddress()->setCollectShippingRates(true);
88
+ $this->_getCart()->getQuote()->setCouponCode(strlen($couponCode) ? $couponCode : '')
89
+ ->collectTotals()
90
+ ->save();
91
+ $total = $this->_getCart()->getQuote()->getTotals();
92
+ $return['discount'] = 0;
93
+ if ($total['discount'] && $total['discount']->getValue()) {
94
+ $return['discount'] = abs($total['discount']->getValue());
95
+ }
96
+ $return['grand_total'] = $total['grand_total']->getValue();
97
+ $return['sub_total'] = $total['subtotal']->getValue();
98
+ if (isset($total['tax']) && $total['tax']->getValue()) {
99
+ $tax = $total['tax']->getValue(); //Tax value if present
100
+ } else {
101
+ $tax = 0;
102
+ }
103
+ $return['tax'] = $tax;
104
+
105
+ if (strlen($couponCode)) {
106
+ if ($couponCode == $this->_getCart()->getQuote()->getCouponCode()) {
107
+ $return['coupon_code'] = (string) $data->coupon_code;
108
+ $event_name = $this->getControllerName();
109
+ $event_value = array(
110
+ 'object' => $this,
111
+ );
112
+ $data_change = $this->changeData($return, $event_name, $event_value);
113
+ $information = $this->successStatus();
114
+ $information['data'] = array(array('fee' => $data_change));
115
+ $information['message'] = Mage::helper('core')->__('Coupon code "%s" was applied.', Mage::helper('core')->htmlEscape($couponCode));
116
+ $information['data']['cart_details']= $this->getCartInfo();
117
+ return $information;
118
+ } else {
119
+ $return['coupon_code'] = '';
120
+ $event_name = $this->getControllerName();
121
+ $event_value = array(
122
+ 'object' => $this,
123
+ );
124
+ $data_change = $this->changeData($return, $event_name, $event_value);
125
+ $information = $this->errorStatus();
126
+ $information['data'] = array(array('fee' => $data_change));
127
+ $information['message'] = Mage::helper('core')->__('Coupon code "%s" is not valid.', Mage::helper('core')->htmlEscape($couponCode));
128
+ $information['data']['cart_details']= $this->getCartInfo();
129
+ return $information;
130
+ }
131
+ } else {
132
+ $event_name = $this->getControllerName();
133
+ $event_value = array(
134
+ 'object' => $this,
135
+ );
136
+ $data_change = $this->changeData($return, $event_name, $event_value);
137
+ $information = $this->successStatus();
138
+ $information['data'] = array(array('fee' => $data_change));
139
+ $information['message'] = Mage::helper('core')->__('Coupon code was canceled.');
140
+ $information['data']['cart_details']= $this->getCartInfo();
141
+ return $information;
142
+ }
143
+ } catch (Mage_Core_Exception $e) {
144
+ $information = $this->errorStatus($e->getMessage());
145
+ } catch (Exception $e) {
146
+ $information = $this->errorStatus($e->getMessage());
147
+ }
148
+ $information['data']['cart_details']= $this->getCartInfo();
149
+ return $information;
150
+ }
151
+
152
+ public function checkCartStatus(&$information) {
153
+ $cart = $this->_getCart();
154
+ $message_error = array();
155
+ if ($cart->getQuote()->getItemsCount()) {
156
+ $cart->init();
157
+ $cart->save();
158
+ if (!$this->_getQuote()->validateMinimumAmount()) {
159
+ $minimumAmount = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())
160
+ ->toCurrency(Mage::getStoreConfig('sales/minimum_order/amount'));
161
+
162
+ $warning = Mage::getStoreConfig('sales/minimum_order/description') ? Mage::getStoreConfig('sales/minimum_order/description') : Mage::helper('checkout')->__('Minimum order amount is %s', $minimumAmount);
163
+ }
164
+ $messages = array();
165
+ foreach ($cart->getQuote()->getMessages() as $message) {
166
+ if ($message) {
167
+ $messages[] = $message;
168
+ $message_error[] = "NOT CHECKOUT" . $message->getText();
169
+ }
170
+ }
171
+ }
172
+ if (count($message_error)) {
173
+ $information['message'] = $message_error;
174
+ }
175
+ $cart->getCheckoutSession()->getMessages(true);
176
+ $this->_getCheckoutSession()->setCartWasUpdated(true);
177
+ }
178
+
179
+ public function addProduct($productInfo, $requestInfo = null){
180
+ $product = $this->_getProduct($productInfo);
181
+ $request = $this->_getProductRequest($requestInfo);
182
+
183
+ $productId = $product->getId();
184
+
185
+ if ($product->getStockItem()) {
186
+ $minimumQty = $product->getStockItem()->getMinSaleQty();
187
+ //If product was not found in cart and there is set minimal qty for it
188
+ if ($minimumQty && $minimumQty > 0 && $request->getQty() < $minimumQty
189
+ && !$this->_getCart()->getQuote()->hasProductId($productId)
190
+ ) {
191
+ $request->setQty($minimumQty);
192
+ }
193
+ }
194
+
195
+ if ($productId) {
196
+ try {
197
+ $result = $this->_getCart()->getQuote()->addProduct($product, $request);
198
+ } catch (Mage_Core_Exception $e) {
199
+ $this->_getCheckoutSession()->setUseNotice(false);
200
+ $result = $e->getMessage();
201
+ }
202
+ /**
203
+ * String we can get if prepare process has error
204
+ */
205
+ if (is_string($result)) {
206
+ $redirectUrl = ($product->hasOptionsValidationFail()) ? $product->getUrlModel()->getUrl(
207
+ $product, array('_query' => array('startcustomization' => 1))
208
+ ) : $product->getProductUrl();
209
+ $this->_getCheckoutSession()->setRedirectUrl($redirectUrl);
210
+ if ($this->_getCheckoutSession()->getUseNotice() === null) {
211
+ $this->_getCheckoutSession()->setUseNotice(true);
212
+ }
213
+ Mage::throwException($result);
214
+ }
215
+ } else {
216
+ Mage::throwException(Mage::helper('checkout')->__('The product does not exist.'));
217
+ }
218
+
219
+ Mage::dispatchEvent('checkout_cart_product_add_after', array('quote_item' => $result, 'product' => $product));
220
+ $this->_getCart()->getCheckoutSession()->setLastAddedProductId($productId);
221
+ return $result;
222
+ }
223
+
224
+ public function getCartDetails(){
225
+ $information = $this->successStatus();
226
+ $information['data']['cart_details'] = $this->getCartInfo();
227
+ return $information;
228
+ }
229
+
230
+ public function getProductOptions($item){
231
+ $options = array();
232
+ if (version_compare(Mage::getVersion(), '1.5.0.0', '>=') === true) {
233
+ $helper = Mage::helper('catalog/product_configuration');
234
+ if ($item->getProductType() == "simple") {
235
+ $options = Mage::helper('mobiservices/shoppingcart')->formatOptionsCart($helper->getCustomOptions($item));
236
+ } elseif ($item->getProductType() == "configurable") {
237
+ $options = Mage::helper('mobiservices/shoppingcart')->formatOptionsCart($helper->getConfigurableOptions($item));
238
+ } elseif ($item->getProductType() == "bundle") {
239
+ $options = Mage::helper('mobiservices/shoppingcart')->getOptions($item);
240
+ } elseif ($item->getProductType() == "virtual") {
241
+ $options = Mage::helper('mobiservices/shoppingcart')->getOptions($item);
242
+ } elseif ($item->getProductType() == "downloadable") {
243
+ $options = Mage::helper('mobiservices/shoppingcart')->getDownloadableOptions($item);
244
+ }
245
+ } else {
246
+ //Zend_debug::dump(get_class($item));die();
247
+ if ($item->getProductType() != "bundle") {
248
+ $options = Mage::helper('mobiservices/shoppingcart')->getUsedProductOption($item);
249
+ } else {
250
+ $options = Mage::helper('mobiservices/shoppingcart')->getOptions($item);
251
+ }
252
+ }
253
+ return $options;
254
+ }
255
+
256
+ public function getCartInfo(){
257
+ $quote = Mage::getModel('checkout/session')->getQuote();
258
+ $quote->collectTotals()->save();
259
+ $quote->save();
260
+
261
+ $list = array();
262
+ $allItems = $quote->getAllVisibleItems();
263
+ $shippingRequired = true;
264
+ $nonShippingRequiredProducts = 0;
265
+ foreach ($allItems as $item) {
266
+ $product = $item->getProduct();
267
+ $options = $this->getProductOptions($item);
268
+
269
+ $getHasError = $item->getHasError();
270
+ $errorDescription = false;
271
+ if($getHasError)
272
+ $errorDescription = $this->_remove_cart_duplicate_error($item->getErrorInfos());
273
+
274
+ $list[] = array(
275
+ 'item_id' => $item->getId(),
276
+ 'product_id' => $product->getId(),
277
+ 'name' => $product->getName(),
278
+ 'price' => $item->getPrice(),
279
+ 'product_type' => $item->getProductType(),
280
+ 'row_total' => $item->getRowTotal(),
281
+ 'product_thumbnail_url' => Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(200)->__toString(),
282
+ 'qty' => $item->getQty(),
283
+ 'product_max_qty' => Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty(),
284
+ 'options' => $options,
285
+ 'hasError' => $getHasError,
286
+ 'errorDescription' => $errorDescription,
287
+ );
288
+ if(in_array($item->getProductType(), array('downloadable', 'virtual'))){
289
+ $nonShippingRequiredProducts++;
290
+ }
291
+ }
292
+ $info['items'] = $list;
293
+ $cart_array = array_merge($info, $this->getCartTotals(), $this->getCartAddresses());
294
+ if(empty($list))
295
+ $cart_array['cart_qty'] = 0;
296
+
297
+ if($nonShippingRequiredProducts == count($list) && $nonShippingRequiredProducts > 0){
298
+ $shippingRequired = false;
299
+ }
300
+ $cart_array['shippingRequired'] = $shippingRequired;
301
+
302
+ $sessionCustomer = Mage::getSingleton("customer/session");
303
+ $userinfo = array();
304
+ if($sessionCustomer->isLoggedIn()) {
305
+ $_customer = $sessionCustomer->getCustomer();
306
+ $userinfo = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/user'))->_getCustomerProfileData($_customer);
307
+ }
308
+ $cart_array['userinfo'] = $userinfo;
309
+ $cart_array['wishlist'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/wishlist_wishlist'))->getWishlistInfo();
310
+ return $cart_array;
311
+ }
312
+
313
+ protected function _remove_cart_duplicate_error($errors = null){
314
+ $final_errors = array();
315
+ $codes_array = array();
316
+ if(!empty($errors))
317
+ {
318
+ foreach($errors as $err)
319
+ {
320
+ if(!in_array($err['code'], $codes_array)){
321
+ $final_errors[] = $err;
322
+ $codes_array[] = $err['code'];
323
+ }
324
+ }
325
+ }
326
+ return $final_errors;
327
+ }
328
+
329
+ public function getCartAddresses(){
330
+ $cartShippingAddress = $this->_getQuote()->getShippingAddress();
331
+ if($cartShippingAddress) {
332
+ $addr['shipping_address'] = $this->_getAddress($cartShippingAddress);
333
+ }
334
+
335
+ $cartBillingAddress = $this->_getQuote()->getBillingAddress();
336
+ if($cartBillingAddress) {
337
+ $addr['billing_address'] = $this->_getAddress($cartBillingAddress);
338
+ }
339
+ return $addr;
340
+ }
341
+
342
+ protected function _getAddress($address){
343
+ $info[] = array(
344
+ 'ID' => $address->getID(),
345
+ 'firstname' => $address->getFirstname(),
346
+ 'lastname' => $address->getLastname(),
347
+ 'company' => $address->getCompany(),
348
+ 'street' => $address->getStreet(),
349
+ 'city' => $address->getCity(),
350
+ 'region' => $address->getRegion(),
351
+ 'region_id' => $address->getRegionId(),
352
+ 'postcode' => $address->getPostcode(),
353
+ 'country_id' => $address->getCountryId(),
354
+ 'telephone' => $address->getTelephone(),
355
+ 'fax' => $address->getFax(),
356
+ 'shipping_description' => $address->getShippingDescription(),
357
+ 'shipping_amount' => $address->getShippingAmount(),
358
+ );
359
+ return $info;
360
+ }
361
+
362
+ public function getCartTotals(){
363
+ $this->_getQuote()->collectTotals()->save();
364
+ $total = $this->_getCart()->getQuote()->getTotals();
365
+ $cartdata = $this->_getCart()->getQuote()->getData();
366
+ $return['discount'] = 0;
367
+ $return['couponcode'] = $this->_getCart()->getQuote()->getCouponCode();
368
+ $return['cart_qty'] = Mage::helper('checkout/cart')->getSummaryCount();
369
+ if ($total['discount'] && $total['discount']->getValue()) {
370
+ $return['discount_amount'] = abs($total['discount']->getValue());
371
+ }
372
+ $return['grand_total'] = $total['grand_total']->getValue();
373
+ $return['subtotal'] = $total['subtotal']->getValue();
374
+ if (isset($total['tax']) && $total['tax']->getValue()) {
375
+ $tax = $total['tax']->getValue(); //Tax value if present
376
+ } else {
377
+ $tax = 0;
378
+ }
379
+ $return['tax_amount'] = $tax;
380
+ if(!empty($cartdata) && $cartdata['items_qty'] > 0){
381
+ try{
382
+ $return['paymentinfo'] = array(
383
+ 'title' => $this->_getCart()->getQuote()->getPayment()->getMethodInstance()->getTitle(),
384
+ 'fee' => isset($cartdata['cod_fee'])?$cartdata['cod_fee']:0,
385
+ );
386
+ if(isset($cartdata['codfee']) && !empty($cartdata['codfee'])){
387
+ $return['paymentinfo']['fee'] = $cartdata['codfee'];
388
+ }
389
+
390
+ if(Mobicommerce_Mobiservices_Model_Custom::ROUNDUP_CART_VALUES){
391
+ $return['grand_total'] = round($return['grand_total']);
392
+ $return['tax_amount'] = round($return['tax_amount']);
393
+ $return['subtotal'] = round($return['subtotal']);
394
+ }
395
+ }
396
+ catch(Exception $e){}
397
+ }
398
+ return $return;
399
+ }
400
+
401
+ public function updateCart($data){
402
+ $cartData = $data['cart'];
403
+ $information = $this->successStatus();
404
+ try {
405
+ if (count($cartData)) {
406
+ $filter = new Zend_Filter_LocalizedToNormalized(
407
+ array('locale' => Mage::app()->getLocale()->getLocaleCode())
408
+ );
409
+
410
+ foreach ($cartData as $index => $data) {
411
+ if (isset($data['qty'])) {
412
+ $cartData[$index]['qty'] = $filter->filter(trim($data['qty']));
413
+ }
414
+ }
415
+
416
+ $cart = $this->_getCart();
417
+ if (!$cart->getCustomerSession()->getCustomer()->getId() && $cart->getQuote()->getCustomerId()) {
418
+ $cart->getQuote()->setCustomerId(null);
419
+ }
420
+
421
+ if (version_compare(Mage::getVersion(), '1.4.2.0', '>=') === true) {
422
+ $cartData = $cart->suggestItemsQty($cartData);
423
+ }
424
+ $cart->updateItems($cartData)
425
+ ->save();
426
+ }
427
+ } catch (Mage_Core_Exception $e) {
428
+ $information = $this->errorStatus($e->getMessage());
429
+ return $information;
430
+ } catch (Exception $e) {
431
+ $information = $this->errorStatus($e->getMessage());
432
+ return $information;
433
+ }
434
+
435
+ $this->_getCheckoutSession()->setCartWasUpdated(true);
436
+ $information['data']['cart_details']= $this->getCartInfo();
437
+ return $information;
438
+ }
439
+
440
+ public function deleteItem($data){
441
+ $id = (int) $data['item_id'];
442
+ if ($id) {
443
+ try {
444
+ $this->_getCart()->removeItem($id)->save();
445
+ } catch (Mage_Core_Exception $e) {
446
+ $information = $this->errorStatus($e->getMessage());
447
+ return $information;
448
+ } catch (Exception $e) {
449
+ $information = $this->errorStatus($e->getMessage());
450
+ return $information;
451
+ }
452
+ }
453
+ $information = $this->successStatus('Item_Has_Been_Deleted_From_Cart');
454
+ $this->_getCheckoutSession()->setCartWasUpdated(true);
455
+ $information['data']['cart_details'] = $this->getCartInfo();
456
+ return $information;
457
+ }
458
+
459
+ protected function _getProductRequest($requestInfo){
460
+ if ($requestInfo instanceof Varien_Object) {
461
+ $request = $requestInfo;
462
+ } elseif (is_numeric($requestInfo)) {
463
+ $request = new Varien_Object();
464
+ $request->setQty($requestInfo);
465
+ } else {
466
+ $request = new Varien_Object($requestInfo);
467
+ }
468
+
469
+ if (!$request->hasQty()) {
470
+ $request->setQty(1);
471
+ }
472
+ return $request;
473
+ }
474
+
475
+ public function saveBilling($data){
476
+ try {
477
+ if ($this->checkUserLoginSession()) {
478
+ $this->_getOnepage()->saveCheckoutMethod('customer');
479
+ } elseif (isset($data['customer_password']) && $data['customer_password']) {
480
+ $this->_getOnepage()->saveCheckoutMethod('register');
481
+ } else {
482
+ $this->_getOnepage()->saveCheckoutMethod('guest');
483
+ }
484
+ } catch (Exception $e) {
485
+ $information = $this->errorStatus($e->getMessage());
486
+ $information['data']['cart_details'] = $this->getCartInfo();
487
+ }
488
+
489
+ $billing_address = $data['billing'];
490
+ $customerBillingAddressId = $data['billing_address_id'];
491
+ if (isset($data['email'])) {
492
+ $billing_address['email'] = trim($billing_address['email']);
493
+ }
494
+ $result['billing'] = $this->_getOnepage()->saveBilling($billing_address, $customerBillingAddressId);
495
+
496
+ if(isset($result['billing']['error'])){
497
+ $information = $this->errorStatus($result['billing']['message']);
498
+ $information['data']['cart_details'] = $this->getCartInfo();
499
+ return $information;
500
+ }
501
+
502
+ if(isset($billing_address['use_for_shipping'])){
503
+ if($billing_address['use_for_shipping']!="1"){
504
+ $shipping_address = $data['shipping'];
505
+ $customerShippingAddressId = $data['shipping_address_id'];
506
+ $result['shipping'] = $this->_getOnepage()->saveShipping($shipping_address, $customerShippingAddressId);
507
+
508
+ if(isset($result['shipping']['error'])){
509
+ $information = $this->errorStatus($result['shipping']['message']);
510
+ $information['data']['cart_details'] = $this->getCartInfo();
511
+ return $information;
512
+ }
513
+ }
514
+ }
515
+
516
+ $this->_getCheckoutSession()->getQuote()->getShippingAddress()->collectShippingRates()->save();
517
+ $info = $this->successStatus();
518
+ $info['data']['cart_details'] = $this->getCartInfo();
519
+ $info['data']['shipping_methods'] = $this->_getShippingMethods();
520
+ $info['data']['payment_methods'] = $this->_getPaymentMethos();
521
+
522
+ return $info;
523
+ }
524
+
525
+ public function _getPaymentMethos(){
526
+ $quote = $this->_getCheckoutSession()->getQuote();
527
+ $store = $quote->getStoreId();
528
+ $total = $quote->getBaseSubtotal() + $quote->getShippingAddress()->getBaseShippingAmount();
529
+ $methodsResult = array();
530
+ $methods = Mage::helper('payment')->getStoreMethods($store, $quote);
531
+ foreach ($methods as $key => $method) {
532
+ if ($this->_canUsePaymentMethod($method, $quote) &&
533
+ (!in_array($method->getCode(), $this->_getRestrictedMethods()) &&
534
+ (in_array($method->getCode(), $this->_getAllowedMethods()) || $method->getConfigData('cctypes')))
535
+ && ($total != 0
536
+ || $method->getCode() == 'free'
537
+ || ($quote->hasRecurringItems() && $method->canManageRecurringProfiles()))){
538
+ //$this->_assignMethod($method, $quote);
539
+ //print_r($method);exit;
540
+ } else {
541
+ if(!($this->_canUsePaymentMethod($method, $quote) && $method->getCode() == 'mobipayments')){
542
+ unset($methods[$key]);
543
+ }
544
+ }
545
+ }
546
+
547
+ foreach ($methods as $method) {
548
+ $list[] = $this->getPaymentMethodDetail($method);
549
+ }
550
+ return $list;
551
+ }
552
+
553
+ public function getPaymentMethodDetail($method){
554
+ $code = $method->getCode();
555
+ $list = $this->_getPaymentMethodTypes();
556
+ if (in_array($code, $this->_getAllowedMethods())) {
557
+ $type = $list[$code];
558
+ } else {
559
+ $type = 1;
560
+ }
561
+ $detail = array();
562
+ $detail['title'] = $method->getTitle();
563
+ $detail['code'] = strtoupper($method->getCode());
564
+ if ($type == 0) {
565
+ if ($code == "checkmo") {
566
+ $detail['payable_to'] = $method->getConfigData('payable_to');
567
+ $detail['payable_to_label'] = "Payable To";
568
+ $detail['mailing_address'] = $method->getConfigData('mailing_address');
569
+ $detail['mailing_address_label'] = "Mailing Address";
570
+ $detail['show_type'] = 0;
571
+ } else if(in_array($code, array('banktransfer', 'cashondelivery', 'mobipaypaloffline'))) {
572
+ $detail['instructions'] = $method->getConfigData('instructions');
573
+ $detail['show_type'] = 0;
574
+ }
575
+ else if(in_array($code, array('bankpayment'))){
576
+ $instructions = $method->getCustomText();
577
+ $custom_text = $method->getCustomText();
578
+ $accounts = unserialize($method->getConfigData('bank_accounts'));
579
+ if($accounts){
580
+ $account_holder = $accounts['account_holder'];
581
+ if($account_holder){
582
+ foreach($account_holder as $ah_key => $ah){
583
+ if(!empty($ah)){
584
+ if(!empty($instructions))
585
+ $instructions .= "<br />";
586
+ $instructions .= "Intestatario: ".$ah;
587
+ if(!empty($accounts['account_number'][$ah_key]))
588
+ $instructions .= "<br />Account Number: ".$accounts['account_number'][$ah_key];
589
+ if(!empty($accounts['account_number'][$ah_key]))
590
+ $instructions .= "<br />Bank Name: ".$accounts['bank_name'][$ah_key];
591
+ if(!empty($accounts['iban'][$ah_key]))
592
+ $instructions .= "<br />IBAN: ".$accounts['iban'][$ah_key];
593
+ if(!empty($accounts['bic'][$ah_key]))
594
+ $instructions .= "<br />BIC: ".$accounts['bic'][$ah_key];
595
+ }
596
+ }
597
+ }
598
+ }
599
+ $detail['instructions'] = $instructions;
600
+ $detail['show_type'] = 0;
601
+ }
602
+ else if(in_array($code, array('cashondeliverypayment'))) {
603
+ $detail['cost_default'] = $method->getConfigData('cost');
604
+ $detail['instructions'] = $method->getConfigData('cost');
605
+ $detail['show_type'] = 0;
606
+ }
607
+ else {
608
+ $detail['show_type'] = 0;
609
+ }
610
+ } elseif ($type == 1) {
611
+ if($code == 'paymill_creditcard') {
612
+ try{
613
+ $detail['configData'] = Mage::getModel('mobipayments/paymill')->getConfigData();
614
+ }
615
+ catch(Exception $e){
616
+ $detail['configData'] = null;
617
+ }
618
+ }
619
+ $detail['cc_types'] = $this->_getPaymentMethodAvailableCcTypes($method);
620
+ $detail['useccv'] = $method->getConfigData('useccv');
621
+ $detail['show_type'] = 1;
622
+ } elseif ($type == 2) {
623
+ $detail['email'] = $method->getConfigData('business_account');
624
+ $detail['client_id'] = $method->getConfigData('client_id');
625
+ $detail['is_sandbox'] = $method->getConfigData('is_sandbox');
626
+ $detail['bncode'] = "Magestore_SI_MagentoCE";
627
+ $detail['show_type'] = 2;
628
+ } elseif($type == 9) {
629
+ $detail['show_type'] = 9;
630
+ $detail['urls'] = array(
631
+ 'redirect_url' => $method->getOrderPlaceRedirectUrl(),
632
+ 'success_url' => $method->getPaidSuccessUrl(),
633
+ 'cancel_url' => $method->getPaidCancelUrl(),
634
+ 'notify_url' => $method->getPaidNotifyUrl(),
635
+ 'condition' => 'EQUAL',
636
+ );
637
+
638
+ if(in_array($method->getCode(), array(
639
+ 'msp_ideal',
640
+ 'msp_deal',
641
+ 'msp_banktransfer',
642
+ 'msp_visa',
643
+ 'msp_mastercard',
644
+ 'msp_maestro',
645
+ 'msp_babygiftcard'
646
+ ))){
647
+ $detail['urls']['success_url'] = Mage::getUrl("msp/standard/return", array("_secure" => true));
648
+ $detail['urls']['cancel_url'] = Mage::getUrl("msp/standard/cancel", array("_secure" => true));
649
+ $detail['urls']['condition'] = 'LIKE';
650
+ }
651
+ else if(in_array($method->getCode(), array(
652
+ 'payuapi'
653
+ ))){
654
+ $detail['cc_types'] = $this->_getPaymentMethodAvailableCcTypes($method);
655
+ $detail['note_1'] = $method->getConfigData('VG6YYEN1');
656
+ $detail['note_2'] = $method->getConfigData('VG6YYEN2');
657
+
658
+ $cartTotals = $this->getCartTotals();
659
+ $grandTotal = $cartTotals['grand_total'];
660
+
661
+ $installment_options = array();
662
+ $installment_key_pair = array(
663
+ array(
664
+ "name" => "Axess",
665
+ "keycode" => "V7H1993D1",
666
+ "valuecode" => "VGD8UEY31",
667
+ "is_active" => false,
668
+ "options" => array()
669
+ ),
670
+ array(
671
+ "name" => "Bonus",
672
+ "keycode" => "V7H1993D2",
673
+ "valuecode" => "VGD8UEY32",
674
+ "is_active" => false,
675
+ "options" => array()
676
+ ),
677
+ array(
678
+ "name" => "Maximum",
679
+ "keycode" => "V7H1993D3",
680
+ "valuecode" => "VGD8UEY33",
681
+ "is_active" => false,
682
+ "options" => array()
683
+ ),
684
+ array(
685
+ "name" => "Finans",
686
+ "keycode" => "V7H1993D4",
687
+ "valuecode" => "VGD8UEY34",
688
+ "is_active" => false,
689
+ "options" => array()
690
+ ),
691
+ array(
692
+ "name" => "World",
693
+ "keycode" => "V7H1993D5",
694
+ "valuecode" => "VGD8UEY35",
695
+ "is_active" => false,
696
+ "options" => array()
697
+ ),
698
+ array(
699
+ "name" => "Asya",
700
+ "keycode" => "V7H1993D6",
701
+ "valuecode" => "VGD8UEY36",
702
+ "is_active" => false,
703
+ "options" => array()
704
+ ),
705
+ array(
706
+ "name" => "Halkbank",
707
+ "keycode" => "V7H1993D7",
708
+ "valuecode" => "VGD8UEY37",
709
+ "is_active" => false,
710
+ "options" => array()
711
+ )
712
+ );
713
+ foreach($installment_key_pair as $installment_key => $installment_pair){
714
+ if($method->getConfigData($installment_pair['keycode'])){
715
+ $installment_key_pair[$installment_key]['is_active'] = true;
716
+ $installment_key_pair[$installment_key]['options_str'] = $method->getConfigData($installment_pair['valuecode']);
717
+ $installment_key_pair[$installment_key]['options'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/custom'))->_processPayuapiInstallmentOptionsString($installment_key_pair[$installment_key]['options_str'], $grandTotal, $interest_type = 'simple', $force_yearly_interest = true);
718
+ $installment_options[$installment_pair['keycode']] = $installment_key_pair[$installment_key];
719
+ }
720
+ }
721
+ $detail['installment_options'] = $installment_options;
722
+ }
723
+
724
+ if(empty($detail['urls']['success_url']))
725
+ $detail['urls']['success_url'] = Mage::getUrl("checkout/onepage/success", array("_secure" => true));
726
+ if(empty($detail['urls']['cancel_url']))
727
+ $detail['urls']['cancel_url'] = Mage::getUrl("checkout/onepage/failure", array("_secure" => true));
728
+ }
729
+ return $detail;
730
+ }
731
+
732
+ protected function _getRestrictedMethods(){
733
+ return array(
734
+ 'authorizenet_directpost',
735
+ 'paypal_direct'
736
+ );
737
+ }
738
+
739
+ protected function _getAllowedMethods(){
740
+ return array(
741
+ 'zooz',
742
+ 'transfer_mobile',
743
+ 'cashondelivery',
744
+ 'cashondeliverypayment',
745
+ 'checkmo',
746
+ 'banktransfer',
747
+ 'bankpayment',
748
+ 'paymill_creditcard',
749
+ 'payfast',
750
+ 'payuapi',
751
+ 'mobipaypaloffline',
752
+ 'msp_ideal',
753
+ 'msp_deal',
754
+ 'msp_banktransfer',
755
+ 'msp_visa',
756
+ 'msp_mastercard',
757
+ 'msp_maestro',
758
+ 'msp_babygiftcard'
759
+ );
760
+ }
761
+
762
+ protected function _getPaymentMethodTypes(){
763
+ return array(
764
+ 'zooz' => 2,
765
+ 'transfer_mobile' => 0,
766
+ 'cashondelivery' => 0,
767
+ 'cashondeliverypayment' => 0,
768
+ 'checkmo' => 0,
769
+ 'banktransfer' => 0,
770
+ 'bankpayment' => 0,
771
+ 'paymill_creditcard' => 1,
772
+ 'mobipaypaloffline' => 0,
773
+ 'payfast' => 9,
774
+ 'msp_ideal' => 9,
775
+ 'msp_deal' => 9,
776
+ 'msp_banktransfer' => 9,
777
+ 'msp_visa' => 9,
778
+ 'msp_mastercard' => 9,
779
+ 'msp_maestro' => 9,
780
+ 'msp_babygiftcard' => 9,
781
+ 'payuapi' => 9,
782
+ );
783
+ }
784
+
785
+ protected function _assignMethod($method, $quote) {
786
+ $method->setInfoInstance($quote->getPayment());
787
+ }
788
+
789
+ protected function _canUsePaymentMethod($method, $quote){
790
+ //if (!($method->isGateway() || $method->canUseInternal())) {
791
+ if (!($method->isGateway() || $method->canUseCheckout())) {
792
+ return false;
793
+ }
794
+
795
+ if (!$method->canUseForCountry($quote->getBillingAddress()->getCountry())) {
796
+ return false;
797
+ }
798
+
799
+ if (!$method->canUseForCurrency(Mage::app()->getStore($quote->getStoreId())->getBaseCurrencyCode())) {
800
+ return false;
801
+ }
802
+
803
+ /**
804
+ * Checking for min/max order total for assigned payment method
805
+ */
806
+ $total = $quote->getBaseGrandTotal();
807
+ $minTotal = $method->getConfigData('min_order_total');
808
+ $maxTotal = $method->getConfigData('max_order_total');
809
+
810
+ if ((!empty($minTotal) && ($total < $minTotal)) || (!empty($maxTotal) && ($total > $maxTotal))) {
811
+ return false;
812
+ }
813
+
814
+ return true;
815
+ }
816
+
817
+ protected function _getPaymentMethodAvailableCcTypes($method){
818
+ $ccTypes = Mage::getSingleton('payment/config')->getCcTypes();
819
+ $methodCcTypes = explode(',', $method->getConfigData('cctypes'));
820
+ foreach ($ccTypes as $code => $title) {
821
+ if (!in_array($code, $methodCcTypes)) {
822
+ unset($ccTypes[$code]);
823
+ }
824
+ }
825
+ if (empty($ccTypes)) {
826
+ return null;
827
+ }
828
+
829
+ return $ccTypes;
830
+ }
831
+
832
+ public function _getShippingMethods(){
833
+ $shipping = $this->_getCheckoutSession()->getQuote()->getShippingAddress();
834
+ $methods = $shipping->getGroupedAllShippingRates();
835
+ $list = array();
836
+ foreach ($methods as $_ccode => $_carrier) {
837
+ foreach ($_carrier as $_rate) {
838
+ $list[] = $_rate->getData();
839
+ /*
840
+ $list[] = array(
841
+ /*
842
+ 's_method_id' => $_rate->getId(),
843
+ 's_method_code' => $_rate->getCode(),
844
+ 's_method_title' => $_rate->getCarrierTitle(),
845
+ 's_method_fee' => floatval($_rate->getPrice()),
846
+ 's_method_name' => $_rate->getMethodTitle(),
847
+
848
+ 's_method_id' => $_rate->getId(),
849
+ 'code' => $_rate->getCode(),
850
+ 'carrier_title' => $_rate->getCarrierTitle(),
851
+ 'price' => floatval($_rate->getPrice()),
852
+ 's_method_name' => $_rate->getMethodTitle(),
853
+ );
854
+ */
855
+ }
856
+ }
857
+
858
+ $method_group = array();
859
+ if(!empty($list)){
860
+ foreach($list as $key => $value){
861
+ if(array_key_exists($value['carrier'], $method_group)){
862
+ $method_group[$value['carrier']]++;
863
+ }
864
+ else{
865
+ $method_group[$value['carrier']] = 1;
866
+ }
867
+ $list[$key]['carrier_index'] = $method_group[$value['carrier']];
868
+ }
869
+ }
870
+
871
+ return $list;
872
+ }
873
+
874
+ public function getShippingMethods(){
875
+ $info = $this->successStatus();
876
+ $info['data']['shipping_methods'] = $this->_getShippingMethods();
877
+ $info['data']['cart_details'] = $this->getCartInfo();
878
+ return $info;
879
+ }
880
+
881
+ public function getPaymentMethos(){
882
+ $info = $this->successStatus();
883
+ $info['data']['payment_methods'] = $this->_getPaymentMethos();
884
+ $info['data']['cart_details'] = $this->getCartInfo();
885
+ return $info;
886
+ }
887
+
888
+ public function saveShippingMethod($data){
889
+ $method = $data['shipping_method'];
890
+ if(Mobicommerce_Mobiservices_Model_Custom::IS_SHIPPING_METHOD_CUSTOM_FIELDS){
891
+ $_POST = $_GET;
892
+ }
893
+ try {
894
+ $result = $this->_getOnepage()->saveShippingMethod($method);
895
+ if (!$result) {
896
+ Mage::dispatchEvent(
897
+ 'checkout_controller_onepage_save_shipping_method',
898
+ array(
899
+ 'request' => Mage::app()->getRequest(),
900
+ 'quote' => $this->_getOnepage()->getQuote())
901
+ );
902
+ $this->_getOnepage()->getQuote()->collectTotals();
903
+ $this->_getOnepage()->getQuote()->collectTotals()->save();
904
+ $info = $this->successStatus();
905
+ $info['data']['payment_methods'] = $this->_getPaymentMethos();
906
+ $info['data']['cart_details'] = $this->getCartInfo();
907
+ return $info;
908
+ } else {
909
+ if(isset($result['message']))
910
+ return $this->errorStatus($result['message']);
911
+ else
912
+ return $this->errorStatus(array($result));
913
+ }
914
+ } catch (Exception $e) {
915
+ $info = $this->errorStatus($e->getMessage());
916
+ return $info;
917
+ }
918
+ }
919
+
920
+ public function _savePaymentMethod($data){
921
+ try {
922
+ $data = $data['payment'];
923
+ if($data == "") return false;
924
+ $result = $this->_getOnepage()->savePayment($data);
925
+ return true;
926
+
927
+ } catch (Exception $e) {
928
+ if (is_array($e->getMessage())) {
929
+ Mage::getSingleton('core/session')->setErrorPayment($e->getMessage());
930
+ return false;
931
+ } else {
932
+ Mage::getSingleton('core/session')->setErrorPayment(array($e->getMessage()));
933
+ return false;
934
+ }
935
+ }
936
+ }
937
+
938
+ public function savePaymentMethod($data){
939
+ $paymentStatus = $this->_savePaymentMethod($data);
940
+ if(!$paymentStatus){
941
+ $error = Mage::getSingleton('core/session')->getErrorPayment();
942
+ $info = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->errorStatus($error);
943
+ return $info;
944
+ }
945
+ $info = $this->successStatus();
946
+ $info['data']['agreements'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/config'))->_getAgreements();
947
+ $info['data']['cart_details'] = $this->getCartInfo();
948
+ return $info;
949
+ }
950
+
951
+ public function validateOrder($data){
952
+ if (!Mage::helper('checkout')->canOnepageCheckout()) {
953
+ $this->_getCheckoutSession()->addError($this->__('The onepage checkout is disabled.'));
954
+ return $this->errorStatus('The onepage checkout is disabled.');
955
+ }
956
+
957
+ $quote = $this->_getOnepage()->getQuote();
958
+ if (!$quote->hasItems() || $quote->getHasError()) {
959
+ if(!$quote->hasItems()){
960
+ $error = $this->errorStatus('Not_All_Products_Are_Available_In_The_Requested_Quantity');
961
+ $error['data']['cart_details'] = $this->getCartInfo();
962
+ return $error;
963
+ }
964
+ else if($quote->getHasError())
965
+ {
966
+ $error = $this->errorStatus('Not_All_Products_Are_Available_In_The_Requested_Quantity');
967
+ $error['data']['cart_details'] = $this->getCartInfo();
968
+
969
+ return $error;
970
+ }
971
+ }
972
+ if (!$quote->validateMinimumAmount()) {
973
+ /*
974
+ $error = Mage::getStoreConfig('sales/minimum_order/error_message');
975
+ $this->_getCheckoutSession()->addError($error);
976
+ return $this->errorStatus($error);
977
+ */
978
+ $error = Mage::getStoreConfig('sales/minimum_order/error_message');
979
+ $this->_getCheckoutSession()->addError($error);
980
+ $error['data']['cart_details'] = $this->getCartInfo();
981
+ return $error;
982
+ }
983
+
984
+ //$this->_getCheckoutSession()->setCartWasUpdated(false);
985
+ //$this->_getOnepage()->initCheckout();
986
+ return null;
987
+ }
988
+
989
+ public function saveOrder($data){
990
+ $information = null;
991
+ $redirectUrl = null;
992
+ try {
993
+ $requiredAgreements = Mage::helper('checkout')->getRequiredAgreementIds();
994
+ if ($requiredAgreements) {
995
+ $postedAgreements = $data['agreement'];
996
+ if($postedAgreements){
997
+ $diff = array_diff($requiredAgreements, $postedAgreements);
998
+
999
+ if ($diff) {
1000
+ $information = $this->errorStatus('Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order');
1001
+ return $information;
1002
+ }
1003
+ } else {
1004
+ $information = $this->errorStatus('Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order');
1005
+ return $information;
1006
+ }
1007
+ }
1008
+ $payment = $data['payment'];
1009
+ if ($payment) {
1010
+ //$dataPayment = $check_card;
1011
+ if (version_compare(Mage::getVersion(), '1.8.0.0', '>=') === true) {
1012
+ $payment['checks'] = Mage_Payment_Model_Method_Abstract::CHECK_USE_CHECKOUT
1013
+ | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_COUNTRY
1014
+ | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_CURRENCY
1015
+ | Mage_Payment_Model_Method_Abstract::CHECK_ORDER_TOTAL_MIN_MAX
1016
+ | Mage_Payment_Model_Method_Abstract::CHECK_ZERO_TOTAL;
1017
+ }
1018
+ }
1019
+ $this->_getOnepage()->getQuote()->getPayment()->importData($payment);
1020
+ $this->_getOnepage()->saveOrder();
1021
+ $redirectUrl = $this->_getOnepage()->getCheckout()->getRedirectUrl();
1022
+ // } catch (Mage_Payment_Model_Info_Exception $e) {
1023
+ //} catch (Mage_Core_Exception $e) {
1024
+ } catch (Exception $e) {
1025
+ $_error = $this->errorStatus($e->getMessage());
1026
+ $this->_getOnepage()->getCheckout()->setUpdateSection(null);
1027
+ return $_error;
1028
+ }
1029
+ $this->_getOnepage()->getQuote()->save();
1030
+ $_result = $this->successStatus();
1031
+ $_returndata = array(
1032
+ 'invoice_number' => $this->_getCheckoutSession()->getLastRealOrderId(),
1033
+ 'redirectUrl' => $redirectUrl
1034
+ );
1035
+ $_result['data'] = $_returndata;
1036
+ $_result['message'] = Mage::helper('core')->__('Your order has been received. Thank you for your purchase!');
1037
+
1038
+ $cart_session = $this->_getOnepage()->getCheckout();
1039
+ $lastOrderId = $cart_session->getLastOrderId();
1040
+ $this->_oldQuote = $cart_session->getData('old_quote');
1041
+ $cart_session->clear();
1042
+ Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
1043
+
1044
+ $_result['data']['order_data'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/user'))->_getOrderHistory();
1045
+ return $_result;
1046
+ }
1047
+
1048
+ public function clearCartData($data = null){
1049
+ $cart_session = $this->_getOnepage()->getCheckout();
1050
+ $cart_session->clear();
1051
+
1052
+ $info = $this->successStatus();
1053
+ return $info;
1054
+ }
1055
+
1056
+ protected function _getQuote(){
1057
+ return $this->_getCart()->getQuote();
1058
+ }
1059
+
1060
+ protected function _getCheckoutSession(){
1061
+ return Mage::getSingleton('checkout/session');
1062
+ }
1063
+
1064
+ protected function _getCart(){
1065
+ return Mage::getSingleton('checkout/cart');
1066
+ }
1067
+
1068
+ public function _getOnepage(){
1069
+ return Mage::getSingleton('checkout/type_onepage');
1070
+ }
1071
+
1072
+ public function changeData($data_change, $event_name, $event_value){
1073
+ $this->_data = $data_change;
1074
+ // dispatchEvent to change data
1075
+ $this->eventChangeData($event_name, $event_value);
1076
+ return $this->getCacheData();
1077
+ }
1078
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Social.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Social extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ protected $socialPlugin = "MAGEGIANT_SOCIAL_LOGIN";
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ }
10
+
11
+ public function getSocialPlatforms()
12
+ {
13
+ $platforms = array($this->socialPlugin);
14
+ switch($this->socialPlugin){
15
+ case 'MAGEGIANT_SOCIAL_LOGIN':
16
+ default:
17
+ if (Mage::helper('core')->isModuleEnabled('Magegiant_SocialLogin')) {
18
+ $platforms = Mage::getBlockSingleton('sociallogin/sociallogin')->getSocialButton();
19
+ }
20
+ break;
21
+ }
22
+ return $platforms;
23
+ }
24
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/User.php ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_User extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function signIn($data)
6
+ {
7
+ $userInfo = array();
8
+ try {
9
+ $customer = Mage::getModel('customer/customer')
10
+ ->setWebsiteId($this->_getWebsiteId());
11
+ if ($customer->authenticate($data['username'], $data['password'])) {
12
+ $this->_getUserSession()->setCustomerAsLoggedIn($customer);
13
+ $this->_loginFromMobile($data);
14
+ }
15
+ $_customer = $this->_getUserSession()->getCustomer();
16
+ $information = $this->successStatus();
17
+ $information = array_merge($information,$this->_getCustomerProfileData($_customer));
18
+ $information['data']['cart_details'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
19
+ if(Mobicommerce_Mobiservices_Model_Custom::REFRESH_CART_AFTER_ADD_PRODUCT){
20
+ $information['data']['cart_details'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
21
+ }
22
+ return $information;
23
+
24
+ } catch (Exception $e) {
25
+ $this->logout();
26
+ return $this->errorStatus($e->getMessage());
27
+ }
28
+ }
29
+
30
+ public function _getCustomerProfileData($_customer)
31
+ {
32
+ $userInfo['customer_id'] = $_customer->getId();
33
+ $userInfo['email'] = $_customer->getEmail();
34
+ $userInfo['firstname'] = $_customer->getFirstname();
35
+ $userInfo['lastname'] = $_customer->getLastname();
36
+ $userInfo['fullname'] = $_customer->getName();
37
+ $userInfo['fulldata'] = $_customer->getData();
38
+ $userInfo['cart_qty'] = Mage::helper('checkout/cart')->getSummaryCount();
39
+
40
+ $information['data'] = $userInfo;
41
+ $information['data']['billing_address']['_data'] = $this->_getPrimaryBillingAddress($_customer);
42
+ $information['data']['shipping_address']['_data'] = $this->_getPrimaryShippingAddress($_customer);
43
+ $information['data']['additional_addresses']['_data'] = $this->_getAdditionalAddresses($_customer);
44
+ //$information['data']['profile'] = array($userInfo);
45
+ $customer_addresses = array();
46
+ if(isset($information['data']['billing_address']['_data']) && !empty($information['data']['billing_address']['_data'])) {
47
+ if(!array_key_exists($information['data']['billing_address']['_data']['id'], $customer_addresses)) {
48
+ $customer_addresses[$information['data']['billing_address']['_data']['id']] = $information['data']['billing_address']['_data'];
49
+ }
50
+ }
51
+
52
+ if(isset($information['data']['shipping_address']['_data']) && !empty($information['data']['shipping_address']['_data'])) {
53
+ if(!array_key_exists($information['data']['shipping_address']['_data']['id'], $customer_addresses)) {
54
+ $customer_addresses[$information['data']['shipping_address']['_data']['id']] = $information['data']['shipping_address']['_data'];
55
+ }
56
+ }
57
+
58
+ if(isset($information['data']['additional_addresses']['_data']) && !empty($information['data']['additional_addresses']['_data'])) {
59
+ foreach($information['data']['additional_addresses']['_data'] as $key => $value) {
60
+ if(!array_key_exists($value['id'], $customer_addresses)) {
61
+ $customer_addresses[$value['id']] = $value;
62
+ }
63
+ }
64
+ }
65
+ $information['data']['unique_addresses'] = $customer_addresses;
66
+
67
+ return $information;
68
+ }
69
+
70
+ public function _getPrimaryBillingAddress($customer)
71
+ {
72
+ return $this->_formatAddress($customer->getPrimaryBillingAddress());
73
+ }
74
+
75
+ public function _getPrimaryShippingAddress($customer)
76
+ {
77
+ return $this->_formatAddress($customer->getPrimaryShippingAddress());
78
+ }
79
+
80
+ public function _getAdditionalAddresses($customer)
81
+ {
82
+ $_addresses = array();
83
+ $addresses = $customer->getAdditionalAddresses();
84
+ foreach ($addresses as $address) {
85
+ $_addresses[] = $this->_formatAddress($address);
86
+ }
87
+ return $_addresses;
88
+ }
89
+
90
+ public function _formatAddress($address)
91
+ {
92
+ if(!$address) return array();
93
+ return array(
94
+ 'id' => $address->getId(),
95
+ 'firstname' => $address->getFirstname(),
96
+ 'lastname' => $address->getLastname(),
97
+ 'fullname' => $address->getName(),
98
+ 'street' => $address->getStreet(),
99
+ 'city' => $address->getCity(),
100
+ 'region' => $address->getRegion(),
101
+ 'region_id' => $address->getRegionId(),
102
+ 'state_code' => $address->getRegionCode(),
103
+ 'postcode' => $address->getPostcode(),
104
+ 'country' => $address->getCountryModel()->loadByCode($address->getCountry())->getName(),
105
+ 'country_id' => $address->getCountryId(),
106
+ 'country_code' => $address->getCountry(),
107
+ 'company' => $address->getCompany(),
108
+ 'telephone' => $address->getTelephone(),
109
+ 'fax' => $address->getFax(),
110
+ 'prefix' => $address->getPrefix(),
111
+ 'middlename' => $address->getMiddleName(),
112
+ );
113
+ }
114
+
115
+ public function getCustomerProfileData($data)
116
+ {
117
+ if($this->checkUserLoginSession()){
118
+ $_customer = $this->_getUserSession()->getCustomer();
119
+ $information = $this->successStatus();
120
+ $information = array_merge($information,$this->_getCustomerProfileData($_customer));
121
+ return $information;
122
+ } else {
123
+ return $this->errorStatus(array('Please_Login_To_Continue'));
124
+ }
125
+ }
126
+
127
+ public function logout()
128
+ {
129
+ try {
130
+ $this->_getUserSession()->logout()
131
+ ->setBeforeAuthUrl(Mage::getUrl());
132
+
133
+ $information = $this->successStatus();
134
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
135
+ return $information;
136
+ } catch (Exception $e) {
137
+ return $this->errorStatus($e->getMessage());
138
+ }
139
+ }
140
+
141
+ public function signUp($data)
142
+ {
143
+ $message = array();
144
+
145
+ if($data['firstname']=="") return $this->errorStatus(array("Customer_First_Name_Is_Required"));
146
+ if($data['lastname']=="") return $this->errorStatus(array("Customer_Last_Name_Is_Required"));
147
+ if($data['email']=="") return $this->errorStatus(array("Customer_Email_Is_Required"));
148
+ if($data['password']=="") return $this->errorStatus(array("Customer_Password_Is_Required"));
149
+
150
+ $customer = Mage::getModel('customer/customer');
151
+ $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
152
+ $customer->loadByEmail($data['email']);
153
+
154
+ if ($customer->getId()) {
155
+ $message[] = Mage::helper('core')->__('Account_Already_Exists');
156
+ $information = $this->errorStatus($message);
157
+ return $information;
158
+ } else {
159
+ $customer->setFirstname($data['firstname']);
160
+ $customer->setLastname($data['lastname']);
161
+ $customer->setEmail($data['email']);
162
+ $customer->setPassword($data['password']);
163
+
164
+ if(isset($data['customAttributes']) && !empty($data['customAttributes'])){
165
+ foreach($data['customAttributes'] as $key => $value){
166
+ $customer->setData($key, $value);
167
+ }
168
+ }
169
+ }
170
+ try {
171
+ $customer->save();
172
+ $customer->setConfirmation(null);
173
+ $customer->save();
174
+ $this->_getUserSession()->loginById($customer->getId());
175
+ //return $this->checkUserLoginSession();exit;
176
+ if($this->checkUserLoginSession()){
177
+ $_customer = $this->_getUserSession()->getCustomer();
178
+
179
+ /* added by Yash for sending welcome email to user */
180
+ $session = $this->_getUserSession();
181
+ if ($_customer->isConfirmationRequired()) {
182
+ /** @var $app Mage_Core_Model_App */
183
+ $app = $this->_getApp();
184
+ /** @var $store Mage_Core_Model_Store*/
185
+ $store = $app->getStore();
186
+ $_customer->sendNewAccountEmail(
187
+ 'confirmation',
188
+ $session->getBeforeAuthUrl(),
189
+ $store->getId()
190
+ );
191
+ } else {
192
+ $session->setCustomerAsLoggedIn($_customer);
193
+ $session->renewSession();
194
+ $url = $this->_welcomeCustomer($_customer);
195
+ }
196
+ $this->_loginFromMobile($data);
197
+ /* added by Yash for sending welcome email to user - upto here */
198
+
199
+ $information = $this->successStatus();
200
+ $information = array_merge($information, $this->_getCustomerProfileData($_customer));
201
+ $information['data']['cart_details'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
202
+ return $information;
203
+ } else {
204
+ return $this->errorStatus(array('User is not logged in'));
205
+ }
206
+ } catch (Exception $e) {
207
+ return $this->errorStatus($e->getMessage());
208
+ }
209
+ }
210
+
211
+ protected function _loginFromMobile($data)
212
+ {
213
+ if(isset($data['isMobiPaypalApplicable']) && $data['isMobiPaypalApplicable'] == '1'){
214
+ $session = Mage::getSingleton('checkout/session');
215
+ $session->setActivePaypalMobile("1");
216
+ }
217
+ }
218
+
219
+ public function saveCustomerAddress($data)
220
+ {
221
+ $return = array();
222
+ $result = true;
223
+ $errors = false;
224
+ $customer = $this->_getUserSession()->getCustomer();
225
+ $address = Mage::getModel('customer/address');
226
+ $addressId = $data['id'];
227
+ if (version_compare(Mage::getVersion(), '1.4.2.0', '<') === true) {
228
+ $address->setData($data);
229
+ }
230
+ if ($addressId && $addressId != '') {
231
+ $existsAddress = $customer->getAddressById($addressId);
232
+ if ($existsAddress->getId() && $existsAddress->getCustomerId() == $customer->getId()) {
233
+ $address->setId($existsAddress->getId());
234
+ }
235
+ } else {
236
+ $address->setId(null);
237
+ }
238
+
239
+ if (version_compare(Mage::getVersion(), '1.4.2.0', '>=') === true) {
240
+ $addressForm = Mage::getModel('customer/form');
241
+ $addressForm->setFormCode('customer_address_edit')
242
+ ->setEntity($address);
243
+ }
244
+ try {
245
+ if (version_compare(Mage::getVersion(), '1.4.2.0', '>=') === true) {
246
+ $addressForm->compactData($data);
247
+ }
248
+ $address->setCustomerId($customer->getId());
249
+ if($data['primary_billing']=="1") $address->setIsDefaultBilling('1');
250
+ if($data['primary_shipping']=="1") $address->setIsDefaultShipping('1');
251
+ $address->setCustomerId($customer->getId());
252
+ $addressErrors = $address->validate();
253
+ if ($addressErrors !== true) {
254
+ $errors = true;
255
+ }
256
+
257
+ if (!$errors) {
258
+ $address->save();
259
+ $information = $this->successStatus();
260
+ $information = array_merge($information,$this->_getCustomerProfileData($customer));
261
+ return $information;
262
+ } else {
263
+ return $this->errorStatus(array('Cannot_Save_Customer_Address'));
264
+ }
265
+ } catch (Exception $e) {
266
+ return $this->errorStatus($e->getMessage());
267
+ }
268
+ return $return;
269
+ }
270
+
271
+ public function forgetPassword($data)
272
+ {
273
+ $email = $data['user_email'];
274
+ if (is_null($email)) {
275
+ return $this->errorStatus('Please_enter_valid_email');
276
+ } else {
277
+ if (!Zend_Validate::is($email, 'EmailAddress')) {
278
+ return $this->errorStatus(array(Mage::helper('core')->__('Please_enter_valid_email')));
279
+ }
280
+ $customer = Mage::getModel('customer/customer')->getCollection()
281
+ ->addFieldToFilter('email', $email)
282
+ ->getFirstItem();
283
+
284
+ if ($customer->getId()) {
285
+ try {
286
+ $newResetPasswordLinkToken = Mage::helper('customer')->generateResetPasswordLinkToken();
287
+ $customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
288
+ $customer->sendPasswordResetConfirmationEmail();
289
+ } catch (Exception $e) {
290
+ return $this->errorStatus($e->getMessage());
291
+ }
292
+ $information = $this->successStatus();
293
+ $information['message'] = array(Mage::helper('customer')->__('If there is an account associated with %s you will receive an email with a link to reset your password.', Mage::helper('customer')->htmlEscape($email)));
294
+ return $information;
295
+ } else {
296
+ $information = $this->errorStatus(array(Mage::helper('customer')->__('Customer is not exist')));
297
+ return $information;
298
+ }
299
+ }
300
+ }
301
+
302
+ protected function _getUserSession()
303
+ {
304
+ return Mage::getSingleton('customer/session');
305
+ }
306
+
307
+ /**
308
+ * Get App
309
+ *
310
+ * @return Mage_Core_Model_App
311
+ */
312
+ protected function _getApp()
313
+ {
314
+ return Mage::app();
315
+ }
316
+
317
+ /**
318
+ * Check whether VAT ID validation is enabled
319
+ *
320
+ * @param Mage_Core_Model_Store|string|int $store
321
+ * @return bool
322
+ */
323
+ protected function _isVatValidationEnabled($store = null)
324
+ {
325
+ try{
326
+ return $this->_getHelper('customer/address')->isVatValidationEnabled($store);
327
+ }
328
+ catch(Exception $e){
329
+ return false;
330
+ }
331
+ }
332
+
333
+ /**
334
+ * Get Helper
335
+ *
336
+ * @param string $path
337
+ * @return Mage_Core_Helper_Abstract
338
+ */
339
+ protected function _getHelper($path)
340
+ {
341
+ return Mage::helper($path);
342
+ }
343
+
344
+ /**
345
+ * Add welcome message and send new account email.
346
+ * Returns success URL
347
+ *
348
+ * @param Mage_Customer_Model_Customer $customer
349
+ * @param bool $isJustConfirmed
350
+ * @return string
351
+ */
352
+ protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
353
+ {
354
+ if ($this->_isVatValidationEnabled()) {
355
+ // Show corresponding VAT message to customer
356
+ $configAddressType = $this->_getHelper('customer/address')->getTaxCalculationAddressType();
357
+ $userPrompt = '';
358
+ switch ($configAddressType) {
359
+ case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING:
360
+ $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you shipping address for proper VAT calculation',
361
+ $this->_getUrl('customer/address/edit'));
362
+ break;
363
+ default:
364
+ $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you billing address for proper VAT calculation',
365
+ $this->_getUrl('customer/address/edit'));
366
+ }
367
+ $this->_getSession()->addSuccess($userPrompt);
368
+ }
369
+
370
+ $customer->sendNewAccountEmail(
371
+ $isJustConfirmed ? 'confirmed' : 'registered',
372
+ '',
373
+ Mage::app()->getStore()->getId()
374
+ );
375
+
376
+ $successUrl = $this->_getUrl('*/*/index', array('_secure' => true));
377
+ if ($this->_getSession()->getBeforeAuthUrl()) {
378
+ $successUrl = $this->_getSession()->getBeforeAuthUrl(true);
379
+ }
380
+ return $successUrl;
381
+ }
382
+
383
+ /**
384
+ * Get Url method
385
+ *
386
+ * @param string $url
387
+ * @param array $params
388
+ * @return string
389
+ */
390
+ protected function _getUrl($url, $params = array()){
391
+ return Mage::getUrl($url, $params);
392
+ }
393
+
394
+ /**
395
+ * Retrieve customer session model object
396
+ *
397
+ * @return Mage_Customer_Model_Session
398
+ */
399
+ protected function _getSession(){
400
+ return Mage::getSingleton('customer/session');
401
+ }
402
+
403
+ public function getOrderList($data) {
404
+
405
+ $session = Mage::getSingleton('customer/session');
406
+
407
+ if(!$session->isLoggedIn()){
408
+ $information = $this->errorStatus("Please_Login_To_Continue");
409
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
410
+ return $information;
411
+ }
412
+
413
+ $list = $this->_getOrderHistory($data);
414
+ $information = $this->successStatus();
415
+ $information['data']['order_data'] = $list;
416
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
417
+ return $information;
418
+ }
419
+
420
+ /* added by yash */
421
+ public function _getOrderHistory($data){
422
+ $orders = Mage::getModel('sales/order')->getCollection()
423
+ ->addFieldToFilter('customer_id', $this->_getSession()->getCustomer()->getId())
424
+ ->setOrder('entity_id', 'DESC');
425
+ $orders_list = array();
426
+ if(count($orders) > 0){
427
+ foreach ($orders as $order) {
428
+ $orders_list[] = $order->getData();
429
+ }
430
+ }
431
+ return $orders_list;
432
+ }
433
+ /* added by yash - upto here */
434
+
435
+ public function getOrderDetail($data){
436
+ $session = Mage::getSingleton('customer/session');
437
+
438
+ if(!$session->isLoggedIn()){
439
+ $information = $this->errorStatus("Please_Login_To_Continue");
440
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
441
+ return $information;
442
+ }
443
+
444
+ $id = $data['order_id'];
445
+
446
+ $detail = array();
447
+ $order = Mage::getModel('sales/order')->load($id);
448
+
449
+ if (count($order->getData()) == 0) {
450
+ return $this->errorStatus();
451
+ }
452
+ $shipping = $order->getShippingAddress();
453
+ $billing = $order->getBillingAddress();
454
+
455
+ $detail = array(
456
+ 'order_id' => $id,
457
+ 'order_date' => $order->getUpdatedAt(),
458
+ 'order_code' => $order->getIncrementId(),
459
+ 'order_total' => $order->getGrandTotal(),
460
+ 'order_subtotal' => $order->getSubtotal(),
461
+ 'tax' => $order->getTaxAmount(),
462
+ 's_fee' => $order->getShippingAmount(),
463
+ 'order_gift_code' => $order->getCouponCode(),
464
+ 'discount' => abs($order->getDiscountAmount()),
465
+ 'order_note' => $order->getCustomerNote(),
466
+ 'order_items' => $this->getProductFromOrderDetail($order, $width, $height),
467
+ 'payment_method' => $order->getPayment()->getMethodInstance()->getTitle(),
468
+ 'shipping_method' => $order->getShippingDescription(),
469
+ 'card_4digits' => ''
470
+ );
471
+
472
+ if($shipping){
473
+ $shipping_street = $shipping->getStreetFull();
474
+ $detail['shippingAddress'] = array(
475
+ 'name' => $shipping->getName(),
476
+ 'street' => $shipping_street,
477
+ 'city' => $shipping->getCity(),
478
+ 'state_name' => $shipping->getRegion(),
479
+ 'state_code' => $shipping->getRegionCode(),
480
+ 'zip' => $shipping->getPostcode(),
481
+ 'country_name' => $shipping->getCountryModel()->loadByCode($billing->getCountry())->getName(),
482
+ 'country_code' => $shipping->getCountry(),
483
+ 'phone' => $shipping->getTelephone(),
484
+ 'email' => $order->getCustomerEmail(),
485
+ );
486
+ }
487
+ if($billing){
488
+ $billing_street = $billing->getStreetFull();
489
+ $detail['billingAddress'] = array(
490
+ 'name' => $billing->getName(),
491
+ 'street' => $billing_street,
492
+ 'city' => $billing->getCity(),
493
+ 'state_name' => $billing->getRegion(),
494
+ 'state_code' => $billing->getRegionCode(),
495
+ 'zip' => $billing->getPostcode(),
496
+ 'country_name' => $billing->getCountryModel()->loadByCode($billing->getCountry())->getName(),
497
+ 'country_code' => $billing->getCountry(),
498
+ 'phone' => $billing->getTelephone(),
499
+ 'email' => $order->getCustomerEmail(),
500
+ );
501
+ }
502
+
503
+ /**
504
+ * Added by Yash
505
+ * Added on: 16-12-2014
506
+ * For getting tracking number for aftership extension
507
+ */
508
+ $tracking_info = array();
509
+ $shipmentCollection = Mage::getResourceModel('sales/order_shipment_collection')
510
+ ->setOrderFilter($order)
511
+ ->load();
512
+ if($shipmentCollection){
513
+ foreach ($shipmentCollection as $shipment){
514
+ foreach($shipment->getAllTracks() as $tracknum){
515
+ //$tracknum->getNumber();
516
+ $tracking_info[] = $tracknum->getData();
517
+ }
518
+ }
519
+ }
520
+ $detail['tracking_info'] = $tracking_info;
521
+ /* upto here */
522
+
523
+ $information = $this->successStatus();
524
+ $information['data']['order_details'] = $detail;
525
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
526
+ return $information;
527
+ }
528
+
529
+ public function getProductFromOrderDetail($order, $width, $height) {
530
+ $productInfo = array();
531
+ $itemCollection = $order->getAllVisibleItems();
532
+ foreach ($itemCollection as $item) {
533
+ $options = array();
534
+ if ($item->getProductOptions()) {
535
+ $options = $this->getOptions($item->getProductType(), $item->getProductOptions());
536
+ }
537
+
538
+ $product_id = $item->getProductId();
539
+ $product = $item->getProduct();
540
+ if (version_compare(Mage::getVersion(), '1.7.0.0', '<') === true) {
541
+ $product = Mage::getModel('catalog/product')->load($product_id);
542
+ }
543
+
544
+ $image = Mage::helper('catalog/image')->init($product, 'small_image')->resize(300)->__toString();
545
+ $productInfo[] = array(
546
+ 'product_id' => $product_id,
547
+ 'product_name' => $item->getName(),
548
+ 'product_price' => $item->getPrice(),
549
+ 'product_subtotal' => $item->getRowTotal(),
550
+ 'product_subtotal_inctax' => $item->getRowTotalInclTax(),
551
+ 'product_image' => $image,
552
+ 'product_qty' => $item->getQtyToShip(),
553
+ 'options' => $options,
554
+ );
555
+ }
556
+
557
+ return $productInfo;
558
+ }
559
+
560
+ public function getOptions($type, $options) {
561
+ $list = array();
562
+ if ($type == 'bundle') {
563
+ foreach ($options['bundle_options'] as $option) {
564
+ foreach ($option['value'] as $value) {
565
+ $list[] = array(
566
+ 'option_title' => $option['label'],
567
+ 'option_value' => $value['title'],
568
+ 'option_price' => $value['price'],
569
+ );
570
+ }
571
+ }
572
+ } else {
573
+ //$options = array();
574
+ if (isset($options['additional_options'])) {
575
+ $optionsList = $options['additional_options'];
576
+ } elseif (isset($options['attributes_info'])) {
577
+ $optionsList = $options['attributes_info'];
578
+ } elseif (isset($options['options'])) {
579
+ $optionsList = $options['options'];
580
+ }
581
+ foreach ($optionsList as $option) {
582
+ $list[] = array(
583
+ 'option_title' => $option['label'],
584
+ 'option_value' => $option['value'],
585
+ 'option_price' => isset($option['price']) == true ? $option['price'] : 0,
586
+ );
587
+ }
588
+ }
589
+ return $list;
590
+ }
591
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x0x3/Wishlist/Wishlist.php ADDED
@@ -0,0 +1,602 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x0x3_Wishlist_Wishlist extends Mobicommerce_Mobiservices_Model_Abstract
4
+ {
5
+ protected function _getWishlist($wishlistId = null)
6
+ {
7
+ $wishlist = Mage::registry('wishlist');
8
+ if ($wishlist) {
9
+ return $wishlist;
10
+ }
11
+
12
+ try {
13
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
14
+ /* @var Mage_Wishlist_Model_Wishlist $wishlist */
15
+ $wishlist = Mage::getModel('wishlist/wishlist');
16
+ if ($wishlistId) {
17
+ $wishlist->load($wishlistId);
18
+ } else {
19
+ $wishlist->loadByCustomer($customerId, true);
20
+ }
21
+
22
+ if (!$wishlist->getId() || $wishlist->getCustomerId() != $customerId) {
23
+ $wishlist = null;
24
+ Mage::throwException(
25
+ Mage::helper('wishlist')->__("Requested wishlist doesn't exist")
26
+ );
27
+ }
28
+
29
+ Mage::register('wishlist', $wishlist);
30
+ } catch (Mage_Core_Exception $e) {
31
+ Mage::getSingleton('wishlist/session')->addError($e->getMessage());
32
+ return false;
33
+ } catch (Exception $e) {
34
+ Mage::getSingleton('wishlist/session')->addException($e,
35
+ Mage::helper('wishlist')->__('Wishlist could not be created.')
36
+ );
37
+ return false;
38
+ }
39
+
40
+ return $wishlist;
41
+ }
42
+
43
+ public function addWishlistItem($wishlistData)
44
+ {
45
+ $session = Mage::getSingleton('customer/session');
46
+
47
+ if(!$session->isLoggedIn())
48
+ {
49
+ $information = $this->errorStatus("Please_Login_To_Continue");
50
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
51
+ return $information;
52
+ }
53
+ $params = $wishlistData;
54
+ $wishlist = $this->_getWishlist();
55
+ if (!$wishlist) {
56
+ return $this->norouteAction();
57
+ }
58
+
59
+ $productId = (int)$params['product'];
60
+ if (!$productId) {
61
+ $information = $this->errorStatus("Product_Does_Not_Exists");
62
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
63
+ return $information;
64
+ }
65
+
66
+ $product = Mage::getModel('catalog/product')->load($productId);
67
+ if (!$product->getId() || !$product->isVisibleInCatalog()) {
68
+ $information = $this->errorStatus("Cannot_Specify_Product");
69
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
70
+ return $information;
71
+ }
72
+
73
+ $requestParams = $params;
74
+ $buyRequest = new Varien_Object($requestParams);
75
+
76
+ $result = $wishlist->addNewItem($product, $buyRequest);
77
+
78
+ if (is_string($result)) {
79
+ Mage::throwException($result);
80
+ }
81
+ $wishlist->save();
82
+
83
+ Mage::dispatchEvent(
84
+ 'wishlist_add_product',
85
+ array(
86
+ 'wishlist' => $wishlist,
87
+ 'product' => $product,
88
+ 'item' => $result
89
+ )
90
+ );
91
+
92
+ $session->setAddActionReferer($referer);
93
+
94
+ Mage::helper('wishlist')->calculate();
95
+ $information = $this->successStatus();
96
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
97
+ return $information;
98
+ }
99
+
100
+ public function getWishlistInfo()
101
+ {
102
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
103
+ $wishlist = Mage::getModel('wishlist/wishlist');
104
+
105
+ $list = array(
106
+ 'wishlist' => NULL,
107
+ 'wishlist_items' => NULL,
108
+ );
109
+ if($customerId)
110
+ {
111
+ $wishlist->loadByCustomer($customerId, true);
112
+ }
113
+ else
114
+ {
115
+ return $list;
116
+ }
117
+
118
+ $items = $wishlist->getItemCollection();
119
+ $wishlistItems = array();
120
+ $i = 0;
121
+ if(count($items) > 0)
122
+ {
123
+ foreach($items as $item)
124
+ {
125
+ $_product = $item->getProduct();
126
+
127
+ $wishlistItems[$i] = $item->getData();
128
+ $wishlistItems[$i]['product_type'] = $_product->getTypeID();
129
+ $wishlistItems[$i]['price'] = $_product->getFinalPrice();
130
+ $wishlistItems[$i]['product_Data'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/catalog_catalog'))->productInfo($item);
131
+ $wishlistItems[$i]['wihlist_options'] = $this->_getWishlistItemOptions($item);
132
+ $wishlistItems[$i]['options'] = $this->_getWishlistOptionsWithValues($_product, $wishlistItems[$i]['wihlist_options'], $wishlistItems[$i]['product_Data']['data']['product_details']['options']);
133
+ $i++;
134
+ }
135
+ $list = array(
136
+ 'wishlist' => $wishlist->getData(),
137
+ 'wishlist_items' => $wishlistItems,
138
+ );
139
+ }
140
+ return $list;
141
+ }
142
+
143
+ /*
144
+ * added by yash
145
+ * to get wishlist item options
146
+ */
147
+ protected function _getWishlistItemOptions($item){
148
+ $woptions = $item->getOptions();
149
+ $options = array();
150
+ $options_ids = null;
151
+ $info_buyRequest = null;
152
+ if($woptions){
153
+ foreach($woptions as $r){
154
+ $att = $r->getData();
155
+ if($att['code'] == 'attributes'){
156
+ $attributes = $att['value'];
157
+ $attributes = unserialize($attributes);
158
+ foreach ($attributes as $attr_id => $attr_value)
159
+ {
160
+ $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', $attr_id);
161
+ $attr_options = $attribute->getSource()->getAllOptions(false);
162
+ foreach ($attr_options as $option)
163
+ {
164
+ if ($option['value'] == $attr_value)
165
+ {
166
+ $options[$attribute->getFrontendLabel()] = $option['label'];
167
+ }
168
+ }
169
+ }
170
+ $wishlistItems[$i]['t'][] = $options;
171
+ }
172
+ else if($att['code'] == 'info_buyRequest'){
173
+ $info_buyRequest = $att['value'];
174
+ $info_buyRequest = unserialize($info_buyRequest);
175
+ if($info_buyRequest){
176
+ $options_ids = array(
177
+ "info_buyRequest" => $info_buyRequest
178
+ );
179
+ }
180
+ }
181
+ }
182
+ }
183
+
184
+ return array(
185
+ 'options_text' => $options,
186
+ 'info_buyRequest' => $info_buyRequest
187
+ );
188
+ }
189
+ /* added by yash - upto here */
190
+
191
+ public function removeWishlistItem($wishlistData)
192
+ {
193
+ $session = Mage::getSingleton('customer/session');
194
+
195
+ if(!$session->isLoggedIn())
196
+ {
197
+ $information = $this->errorStatus("Please_Login_To_Continue");
198
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
199
+ return $information;
200
+ }
201
+
202
+ $wishlist_item_id = (int) $wishlistData['wishlist_item_id'];
203
+
204
+ if(!$wishlist_item_id)
205
+ {
206
+ $information = $this->errorStatus("Please_Pass_Item_Id");
207
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
208
+ return $information;
209
+ }
210
+
211
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
212
+ $wishlist = Mage::getModel('wishlist/wishlist')->getCollection()->addFieldToFilter('customer_id',$customerId)->getFirstItem()->load();
213
+ $wishlistId = $wishlist->getWishlistId();
214
+
215
+ if(!$wishlistId)
216
+ {
217
+ $information = $this->errorStatus("Wishlist_Does_Not_Exists");
218
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
219
+ return $information;
220
+ }
221
+
222
+ $item = Mage::getModel('wishlist/item')->getCollection()->addFieldToFilter('wishlist_id',$wishlistId);
223
+
224
+ if(count($item) > 0)
225
+ {
226
+ foreach($item as $_item)
227
+ {
228
+ if($_item->wishlist_item_id == $wishlist_item_id){
229
+ $_item->delete();
230
+ }
231
+ }
232
+ $wishlist->save();
233
+ }
234
+
235
+ $information = $this->getWishlistInfo();
236
+ Mage::helper('wishlist')->calculate();
237
+
238
+ $information = $this->successStatus();
239
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
240
+ return $information;
241
+ }
242
+
243
+ public function getOptions($type, $options)
244
+ {
245
+ $list = array();
246
+ if ($type == 'bundle') {
247
+ foreach ($options['bundle_options'] as $option) {
248
+ foreach ($option['value'] as $value) {
249
+ $list[] = array(
250
+ 'option_title' => $option['label'],
251
+ 'option_value' => $value['title'],
252
+ 'option_price' => $value['price'],
253
+ );
254
+ }
255
+ }
256
+ } else {
257
+ if (isset($options['additional_options'])) {
258
+ $optionsList = $options['additional_options'];
259
+ } elseif (isset($options['attributes_info'])) {
260
+ $optionsList = $options['attributes_info'];
261
+ } elseif (isset($options['options'])) {
262
+ $optionsList = $options['options'];
263
+ }
264
+ foreach ($optionsList as $option) {
265
+ $list[] = array(
266
+ 'option_title' => $option['label'],
267
+ 'option_value' => $option['value'],
268
+ 'option_price' => isset($option['price']) == true ? $option['price'] : 0,
269
+ );
270
+ }
271
+ }
272
+ return $list;
273
+ }
274
+
275
+ public function addtocartWishlistItem($data)
276
+ {
277
+ $session = Mage::getSingleton('customer/session');
278
+
279
+ if(!$session->isLoggedIn())
280
+ {
281
+ $information = $this->errorStatus("Please_Login_To_Continue");
282
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
283
+ return $information;
284
+ }
285
+
286
+ $itemId = $data['item_id'];
287
+
288
+ /* @var $item Mage_Wishlist_Model_Item */
289
+ $item = Mage::getModel('wishlist/item')->load($itemId);
290
+ if (!$item->getId()) {
291
+ $information = $this->errorStatus("Please_Pass_Item_Id");
292
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
293
+ return $information;
294
+ }
295
+ $wishlist = $this->_getWishlist($item->getWishlistId());
296
+ if (!$wishlist) {
297
+ $information = $this->errorStatus("Item_Does_Not_Exists");
298
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
299
+ return $information;
300
+ }
301
+
302
+ // Set qty
303
+ $qty = (int)$data['qty'];
304
+ if(empty($qty)){
305
+ $qty = 1;
306
+ }
307
+
308
+ /* @var $session Mage_Wishlist_Model_Session */
309
+ $session = Mage::getSingleton('wishlist/session');
310
+ $cart = Mage::getSingleton('checkout/cart');
311
+
312
+ try {
313
+ $options = Mage::getModel('wishlist/item_option')->getCollection()
314
+ ->addItemFilter(array($itemId));
315
+ $item->setOptions($options->getOptionsByItem($itemId));
316
+
317
+ $buyRequest = Mage::helper('catalog/product')->addParamsToBuyRequest(
318
+ $data,
319
+ array('current_config' => $item->getBuyRequest())
320
+ );
321
+
322
+ $item->mergeBuyRequest($buyRequest);
323
+ if ($item->addToCart($cart, true)) {
324
+ $cart->save()->getQuote()->collectTotals();
325
+ }
326
+
327
+ $wishlist->save();
328
+ Mage::helper('wishlist')->calculate();
329
+
330
+ } catch (Mage_Core_Exception $e) {
331
+ if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {
332
+ $information = $this->errorStatus(Mage::helper('wishlist')->__('This product(s) is currently out of stock'));
333
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
334
+ return $information;
335
+ } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {
336
+ $information = $this->errorStatus($e->getMessage());
337
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
338
+ return $information;
339
+ } else {
340
+ $information = $this->errorStatus($e->getMessage());
341
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
342
+ return $information;
343
+ }
344
+ } catch (Exception $e) {
345
+ $information = $this->errorStatus(Mage::helper('wishlist')->__('Cannot add item to shopping cart'));
346
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
347
+ return $information;
348
+ }
349
+
350
+ Mage::helper('wishlist')->calculate();
351
+
352
+ $information = $this->successStatus();
353
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
354
+ return $information;
355
+ }
356
+
357
+ /*
358
+ * added by yash
359
+ * to update wishlist item on edit screen
360
+ */
361
+ public function updateWishlistItem($data){
362
+ $session = Mage::getSingleton('customer/session');
363
+ if(!$session->isLoggedIn())
364
+ {
365
+ $information = $this->errorStatus("Please_Login_To_Continue");
366
+ $information['data']['cart_details'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
367
+ return $information;
368
+ }
369
+
370
+ $productId = (int) $data['product'];
371
+ if (!$productId) {
372
+ $information = $this->errorStatus("Please_Pass_Product_Id");
373
+ $information['data']['cart_details'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
374
+ return $information;
375
+ }
376
+
377
+ $product = Mage::getModel('catalog/product')->load($productId);
378
+ if (!$product->getId() || !$product->isVisibleInCatalog()) {
379
+ $information = $this->errorStatus(Mage::helper('wishlist')->__('Cannot specify product.'));
380
+ $information['data']['cart_details'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
381
+ return $information;
382
+ }
383
+
384
+ try {
385
+ $id = (int) $data['id'];
386
+
387
+ /* @var Mage_Wishlist_Model_Item */
388
+ $item = Mage::getModel('wishlist/item');
389
+ $item->load($id);
390
+ $wishlist = $this->_getWishlist($item->getWishlistId());
391
+ if (!$wishlist) {
392
+ $information = $this->errorStatus("Cannot_Load_Wishlist_Item");
393
+ $information['data']['cart_details'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
394
+ return $information;
395
+ }
396
+
397
+ $buyRequest = new Varien_Object($data);
398
+ $wishlist->updateItem($id, $buyRequest)
399
+ ->save();
400
+
401
+ Mage::helper('wishlist')->calculate();
402
+
403
+ Mage::dispatchEvent('wishlist_update_item', array(
404
+ 'wishlist' => $wishlist, 'product' => $product, 'item' => $wishlist->getItem($id))
405
+ );
406
+
407
+ Mage::helper('wishlist')->calculate();
408
+
409
+ $message = Mage::helper('wishlist')->__('%1$s has been updated in your wishlist.', $product->getName());
410
+ $information = $this->successStatus($message);
411
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
412
+ return $information;
413
+ } catch (Mage_Core_Exception $e) {
414
+ $information = $this->errorStatus($e->getMessage());
415
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
416
+ return $information;
417
+ } catch (Exception $e) {
418
+ $session->addError(Mage::helper('wishlist')->__('An error occurred while updating wishlist.'));
419
+ Mage::logException($e);
420
+ $information = $this->errorStatus(Mage::helper('wishlist')->__('An error occurred while updating wishlist.'));
421
+ $information['data']['cart_details']= Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo();
422
+ return $information;
423
+ }
424
+ }
425
+
426
+ protected function _getWishlistOptionsWithValues($_product = null, $wihlistOptions = null, $productOptions = null)
427
+ {
428
+ $options = array();
429
+ switch($_product->getTypeID()){
430
+ case 'bundle':
431
+ $bundleOptions = $wihlistOptions['info_buyRequest']['bundle_option'];
432
+ $bundleOptionsQty = $wihlistOptions['info_buyRequest']['bundle_option_qty'];
433
+ $bundleProductOptions = $this->_setProductOptionArray($_product->getTypeID(), $productOptions['bundle']);
434
+ if(!empty($bundleOptions)){
435
+ foreach ($bundleOptions as $key => $value) {
436
+ $_option = array();
437
+ if(is_array($value)){
438
+ foreach($value as $mkey => $mvalue) {
439
+ $_option[] = array(
440
+ "option_title" => $bundleProductOptions[$key]['option_title'],
441
+ "option_value" => (isset($bundleOptionsQty[$key]) ? $bundleOptionsQty[$key] : '1') . " x " . $bundleProductOptions[$key]['options'][$mvalue]['option_value']
442
+ );
443
+ }
444
+ }
445
+ else{
446
+ //echo '<pre>';print_r($bundleOptionsQty);exit;
447
+ $_option[] = array(
448
+ "option_title" => $bundleProductOptions[$key]['option_title'],
449
+ "option_value" => (isset($bundleOptionsQty[$key]) ? $bundleOptionsQty[$key] : '1') . " x " . $bundleProductOptions[$key]['options'][$value]['option_value']
450
+ );
451
+ }
452
+ $options[] = $_option;
453
+ }
454
+ }
455
+ break;
456
+ case 'grouped':
457
+ $groupedOptions = $wihlistOptions['info_buyRequest']['super_group'];
458
+ $groupedProductOptions = $this->_setProductOptionArray($_product->getTypeID(), $productOptions['super_group']);
459
+ if(!empty($groupedOptions)){
460
+ foreach ($groupedOptions as $key => $value) {
461
+ $_option = array();
462
+ if(!is_array($value)){
463
+ $_option = array(
464
+ "option_title" => $groupedProductOptions[$key]['option_title'],
465
+ "option_value" => $value
466
+ );
467
+ }
468
+ $options[] = $_option;
469
+ }
470
+ }
471
+ break;
472
+ case 'configurable':
473
+ $configurableOptions = $wihlistOptions['info_buyRequest']['super_attribute'];
474
+ $configurableProductOptions = $this->_setProductOptionArray($_product->getTypeID(), $productOptions['product_super_attributes']);
475
+ //print_r($productOptions['product_super_attributes']);exit;
476
+ if(!empty($configurableOptions)){
477
+ foreach ($configurableOptions as $key => $value) {
478
+ $_option = array();
479
+ if(!is_array($value)){
480
+ $_option = array(
481
+ "option_title" => $configurableProductOptions[$key]['label'],
482
+ "option_value" => $configurableProductOptions[$key]['prices'][$value]['store_label']
483
+ );
484
+ }
485
+ $options[] = $_option;
486
+ }
487
+ }
488
+ break;
489
+ case 'downloadable':
490
+ //print_r($wihlistOptions['info_buyRequest']);exit;
491
+ $downloadableOptions = $wihlistOptions['info_buyRequest']['links'];
492
+ $downloadableProductOptions = $this->_setProductOptionArray($_product->getTypeID(), $productOptions['link']);
493
+ //print_r($downloadableProductOptions);exit;
494
+ if(!empty($downloadableOptions)){
495
+ $_option = array();
496
+ foreach ($downloadableOptions as $key => $value) {
497
+ if(!is_array($value)){
498
+ $_option[] = $downloadableProductOptions[$value]['title'];
499
+ }
500
+ }
501
+ $options[] = array(
502
+ "option_title" => "Links",
503
+ "option_value" => implode(", ", $_option),
504
+ );
505
+ }
506
+ break;
507
+ default:
508
+ break;
509
+ }
510
+
511
+ $simpleOptions = $wihlistOptions['info_buyRequest']['options'];
512
+ $simpleProductOptions = $this->_setProductOptionArray('simple', $productOptions['product_options']);
513
+ //print_r($simpleOptions);print_r($simpleProductOptions);exit;
514
+ if(!empty($simpleOptions)){
515
+ foreach ($simpleOptions as $key => $value) {
516
+ $_option = array();
517
+ if(in_array($simpleProductOptions[$key]['type'], array('field', 'area', 'date', 'date_time', 'time'))){
518
+ $_option = array(
519
+ "option_title" => $simpleProductOptions[$key]['title'],
520
+ "option_value" => $value
521
+ );
522
+ }
523
+ elseif(in_array($simpleProductOptions[$key]['type'], array('drop_down', 'radio'))){
524
+ $_option = array(
525
+ "option_title" => $simpleProductOptions[$key]['title'],
526
+ "option_value" => $simpleProductOptions[$key]['options'][$value]['title']
527
+ );
528
+ }
529
+ elseif(in_array($simpleProductOptions[$key]['type'], array('checkbox', 'multiple'))){
530
+ if(is_array($value)){
531
+ foreach($value as $mkey => $mvalue) {
532
+ $_option[] = $simpleProductOptions[$key]['options'][$mvalue]['title'];
533
+ }
534
+ $_option = array(
535
+ "option_title" => $simpleProductOptions[$key]['title'],
536
+ "option_value" => implode(", ", $_option)
537
+ );
538
+ }
539
+ else{
540
+ $_option = array(
541
+ "option_title" => $simpleProductOptions[$key]['title'],
542
+ "option_value" => $simpleProductOptions[$key]['options'][$value]['title']
543
+ );
544
+ }
545
+ }
546
+ $options[] = $_option;
547
+ }
548
+ }
549
+ return $options;
550
+ }
551
+
552
+ protected function _setProductOptionArray($productType, $options = array())
553
+ {
554
+ if(empty($options))
555
+ return false;
556
+
557
+ $outputOptions = array();
558
+ if($productType == 'configurable'){
559
+ foreach($options as $key => $value){
560
+ $innerOptions = array();
561
+ if(!empty($value['prices'])){
562
+ foreach($value['prices'] as $ikey => $ivalue){
563
+ $innerOptions[$ivalue['value_index']] = $ivalue;
564
+ }
565
+ }
566
+ $outputOptions[$value['attribute_id']] = $value;
567
+ $outputOptions[$value['attribute_id']]['prices'] = $innerOptions;
568
+ unset($outputOptions[$value['attribute_id']]['product_attribute']);
569
+ }
570
+ }
571
+ else if($productType == 'downloadable'){
572
+ foreach($options as $key => $value){
573
+ $innerOptions = array();
574
+ if(!empty($value['options'])){
575
+ foreach($value['options'] as $ikey => $ivalue){
576
+ $innerOptions[$ivalue['link_id']] = $ivalue;
577
+ }
578
+ }
579
+ $outputOptions[$value['link_id']] = $value;
580
+ $outputOptions[$value['link_id']]['options'] = $innerOptions;
581
+ }
582
+ }
583
+ else{
584
+ foreach($options as $key => $value){
585
+ $innerOptions = array();
586
+ if(!empty($value['options'])){
587
+ foreach($value['options'] as $ikey => $ivalue){
588
+ if(isset($ivalue['option_type_id']))
589
+ $innerOptions[$ivalue['option_type_id']] = $ivalue;
590
+ else
591
+ $innerOptions[$ivalue['option_id']] = $ivalue;
592
+ }
593
+ }
594
+ $outputOptions[$value['option_id']] = $value;
595
+ $outputOptions[$value['option_id']]['options'] = $innerOptions;
596
+ }
597
+ }
598
+ //print_r($outputOptions);exit;
599
+ return $outputOptions;
600
+ }
601
+ }
602
+ ?>
app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Abstract.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x3x1_Abstract extends Mage_Core_Model_Abstract {
4
+
5
+ public function successStatus($success = array('SUCCESS'))
6
+ {
7
+ return array(
8
+ 'status' => 'SUCCESS',
9
+ 'message' => $success,
10
+ );
11
+ }
12
+
13
+ public function errorStatus($error = array('0','opps! unknown Error '))
14
+ {
15
+ return array(
16
+ 'status' => 'FAIL',
17
+ 'message' => is_array($error)?$error[0]:$error,
18
+ );
19
+ }
20
+
21
+ public function checkUserLoginSession()
22
+ {
23
+ return Mage::getSingleton('customer/session')->isLoggedIn();
24
+ }
25
+
26
+ public function _getStoreId()
27
+ {
28
+ return Mage::app()->getStore()->getStoreId();
29
+ }
30
+
31
+ public function _getStoreName()
32
+ {
33
+ return Mage::app()->getStore()->getName();
34
+ }
35
+
36
+ public function _getWebsiteId()
37
+ {
38
+ return Mage::app()->getStore()->getWebsiteId();
39
+ }
40
+
41
+ public function eventChangeData($name_event, $value)
42
+ {
43
+ Mage::dispatchEvent($name_event, $value);
44
+ }
45
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Appsetting.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x3x1_Appsetting extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function getCmsdata($data)
6
+ {
7
+ $cmsCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
8
+ ->addFieldToFilter('app_code', $data['appcode'])
9
+ ->addFieldToFilter('setting_code', 'cms_settings');
10
+
11
+ if($cmsCollection->getSize()){
12
+ foreach($cmsCollection as $cmsData){
13
+ return Mage::helper('mobiadmin')->_jsonUnserialize($cmsData['value']);
14
+ }
15
+ }
16
+ else{
17
+ return null;
18
+ }
19
+ }
20
+
21
+ public function getAppinfo($data)
22
+ {
23
+ $AppinfoCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
24
+ ->addFieldToFilter('app_code', $data['appcode'])
25
+ ->addFieldToFilter('setting_code', 'appinfo');
26
+
27
+ if($AppinfoCollection->getSize()){
28
+ foreach($AppinfoCollection as $appinfo){
29
+ return Mage::helper('mobiadmin')->_jsonUnserialize($appinfo['value']);
30
+ }
31
+ }
32
+ else{
33
+ return null;
34
+ }
35
+ }
36
+
37
+ public function getPushdata($data)
38
+ {
39
+ $pushCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
40
+ ->addFieldToFilter('app_code', $data['appcode'])
41
+ ->addFieldToFilter('setting_code', 'push_notification');
42
+
43
+ if($pushCollection->getSize()){
44
+ foreach($pushCollection as $pushCollection){
45
+ return Mage::helper('mobiadmin')->_jsonUnserialize($pushCollection['value']);
46
+ }
47
+ }
48
+ else{
49
+ return null;
50
+ }
51
+ }
52
+
53
+ public function getHomepageBanners($data)
54
+ {
55
+ $bannersArray = array();
56
+ $bannersCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
57
+ ->addFieldToFilter('app_code', $data['appcode'])
58
+ ->addFieldToFilter('setting_code', 'banner_settings');
59
+
60
+ if($bannersCollection->getSize()){
61
+ foreach($bannersCollection as $banners){
62
+ $banners = Mage::helper('mobiadmin')->_jsonUnserialize($banners['value']);
63
+ if($banners){
64
+ foreach($banners as $banner){
65
+ if($banner['is_active'] == '1'){
66
+ $bannersArray[] = $banner['url'];
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ return $bannersArray;
73
+ }
74
+
75
+ public function getPopupdata($data)
76
+ {
77
+ $popupCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
78
+ ->addFieldToFilter('app_code', $data['appcode'])
79
+ ->addFieldToFilter('setting_code', 'popup_setting');
80
+
81
+ if($popupCollection->getSize()){
82
+ foreach($popupCollection as $pushCollection){
83
+ return Mage::helper('mobiadmin')->_jsonUnserialize($pushCollection['value']);
84
+ }
85
+ }
86
+ else{
87
+ return null;
88
+ }
89
+ }
90
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Catalog/Catalog.php ADDED
@@ -0,0 +1,1242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x3x1_Catalog_Catalog extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function _categoryTreeList($storeId = null, $appcode = null)
6
+ {
7
+ if(!empty($storeId))
8
+ $parentId = Mage::app()->getStore($storeId)->getRootCategoryId();
9
+ else
10
+ $parentId = Mage::app()->getStore()->getRootCategoryId();
11
+ $tree = Mage::getResourceSingleton('catalog/category_tree')->load();
12
+ $root = $tree->getNodeById($parentId);
13
+ if($root && $root->getId() == 1) {
14
+ $root->setName(Mage::helper('catalog')->__('Root'));
15
+ }
16
+ $collection = Mage::getModel('catalog/category')->getCollection()
17
+ ->addAttributeToSelect('name')
18
+ ->addAttributeToFilter('is_active','1')
19
+ //->addAttributeToFilter('display_mode',array('nlike'=>'PAGE'))
20
+ ->addAttributeToFilter('include_in_menu','1');
21
+
22
+ $tree->addCollectionData($collection, true);
23
+
24
+ $categories = $this->_nodeToArray($root);
25
+ $categories = $this->_make_tree_to_list($categories['children']);
26
+ $categories = $this->_remove_category_children($categories);
27
+ $categories = $this->_attachCategoryIcon($categories, $appcode);
28
+ return $categories;
29
+ }
30
+
31
+ public function getCatalogSearch($data)
32
+ {
33
+ $keyword = $data['q'];
34
+ $_helper = Mage::helper('catalogsearch');
35
+ $queryParam = str_replace('%20', ' ', $keyword);
36
+ Mage::app()->getRequest()->setParam($_helper->getQueryParamName(), $queryParam);
37
+ /** @var $query Mage_CatalogSearch_Model_Query */
38
+ $query = $_helper->getQuery();
39
+ $query->setStoreId(Mage::app()->getStore()->getId());
40
+
41
+ if ($query->getQueryText() != '') {
42
+ $check = false;
43
+ if (Mage::helper('catalogsearch')->isMinQueryLength()) {
44
+ $query->setId(0)
45
+ ->setIsActive(1)
46
+ ->setIsProcessed(1);
47
+ } else {
48
+ if ($query->getId()) {
49
+ $query->setPopularity($query->getPopularity() + 1);
50
+ } else {
51
+ $query->setPopularity(1);
52
+ }
53
+
54
+ if ($query->getRedirect()) {
55
+ $query->save();
56
+ //break
57
+ $check = true;
58
+ } else {
59
+ $query->prepare();
60
+ }
61
+ }
62
+ if ($check == FALSE) {
63
+ Mage::helper('catalogsearch')->checkNotes();
64
+ if (!Mage::helper('catalogsearch')->isMinQueryLength()) {
65
+ $query->save();
66
+ }
67
+ }
68
+ } else {
69
+ return $this->statusError();
70
+ }
71
+ if (method_exists($_helper, 'getEngine')) {
72
+ $engine = Mage::helper('catalogsearch')->getEngine();
73
+ if ($engine instanceof Varien_Object) {
74
+ $isLayeredNavigationAllowed = $engine->isLeyeredNavigationAllowed();
75
+ } else {
76
+ $isLayeredNavigationAllowed = true;
77
+ }
78
+ } else {
79
+ $isLayeredNavigationAllowed = true;
80
+ }
81
+ $layer = Mage::getSingleton('catalogsearch/layer');
82
+ $collection = $layer->getProductCollection();
83
+ return $collection;
84
+ }
85
+
86
+ function _nodeToArray(Varien_Data_Tree_Node $node)
87
+ {
88
+ $result = array();
89
+ $result['category_id'] = $node->getId();
90
+ $result['parent_id'] = $node->getParentId();
91
+ $result['name'] = $node->getName();
92
+ $result['is_active'] = $node->getIsActive();
93
+ $result['position'] = $node->getPosition();
94
+ $result['level'] = $node->getLevel();
95
+ $result['children'] = array();
96
+ $category = Mage::getModel('catalog/category')->load($node->getId());
97
+ //$result['imageurl'] = $this->getResizedImage($category->getImageUrl(),300,300);
98
+ $result['imageurl'] = $this->getResizedImage(Mage::getBaseUrl('media').'catalog/category/'.$category->getThumbnail(),300,300);
99
+ $result['products_count'] = $this->_getProductCountForCategory($category);
100
+
101
+ foreach ($node->getChildren() as $child) {
102
+ $result['children'][] = $this->_nodeToArray($child);
103
+ }
104
+
105
+ return $result;
106
+ }
107
+
108
+ public function _remove_category_children($categories = array())
109
+ {
110
+ if(!empty($categories))
111
+ {
112
+ foreach($categories as $key => $category)
113
+ {
114
+ $categories[$key]['children'] = count($category['children']);
115
+ }
116
+ }
117
+ return $categories;
118
+ }
119
+
120
+ public function _make_tree_to_list($categories = null, $category_result = array())
121
+ {
122
+ if(!empty($categories))
123
+ {
124
+ foreach($categories as $category)
125
+ {
126
+ $category_result[] = $category;
127
+ if(count($category['children']) > 0)
128
+ {
129
+ $category_result = $this->_make_tree_to_list($category['children'], $category_result);
130
+ }
131
+ }
132
+ }
133
+ return $category_result;
134
+ }
135
+
136
+ public function _getProductCountForCategory($category)
137
+ {
138
+ $product_total=0;
139
+ $storeId = $this->_getStoreId();
140
+ $pCollection = $category->getProductCollection()
141
+ ->addAttributeToSelect('*')
142
+ ->setStoreId($storeId)
143
+ ->addFinalPrice();
144
+
145
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($pCollection);
146
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($pCollection);
147
+ $pCollection->addUrlRewrite(0);
148
+
149
+ $product_total = $pCollection->getSize();
150
+ return $product_total;
151
+ }
152
+
153
+ public function getCatrgories()
154
+ {
155
+ $categoriesTree = $this->successStatus();
156
+ $categoriesTree['data']['categories'] = $this->_categoryTreeList();
157
+ return $categoriesTree;
158
+ }
159
+
160
+ public function productList($data)
161
+ {
162
+ $storeId = $this->_getStoreId();
163
+
164
+ $pCollection = Mage::getModel('catalog/product')->getCollection()
165
+ ->addAttributeToSelect('*')
166
+ ->addAttributeToFilter('status', '1')
167
+ ->addAttributeToFilter('visibility', '4')
168
+ ->setStoreId($storeId)
169
+ ->addFinalPrice();
170
+
171
+ if($data['category_id'] != '')
172
+ {
173
+ $pCollection->joinField('category_id',
174
+ 'catalog/category_product_index',
175
+ 'category_id',
176
+ 'product_id=entity_id',
177
+ "{{table}}.store_id='".$storeId."' AND {{table}}.visibility IN (4) AND {{table}}.category_id = '".$data['category_id']."'",
178
+ 'INNER');
179
+ //->addAttributeToFilter('category_id', array('in' => $data['category_id']));
180
+ }
181
+
182
+ if($data['q'] != '')
183
+ {
184
+ $pCollection = $this->getCatalogSearch($data);
185
+ }
186
+ //echo '<pre>';print_r($data);exit;
187
+ if(!empty($data['filter']))
188
+ {
189
+ $filterData = array();
190
+ $filter = (string)$data['filter'];
191
+ if(!empty($filter)):
192
+ $filter = explode('&', $filter);
193
+ if(!empty($filter)):
194
+ foreach($filter as $fdata):
195
+ $explode = explode('=', $fdata);
196
+ if(count($explode) == 2):
197
+ if(array_key_exists($explode[0], $filterData))
198
+ $filterData[$explode[0]][] = $explode[1];
199
+ else
200
+ $filterData[$explode[0]] = array($explode[1]);
201
+ endif;
202
+ endforeach;
203
+ endif;
204
+ endif;
205
+
206
+ if(!empty($filterData)):
207
+ foreach($filterData as $fkey => $fdata):
208
+ if(count($fdata) == 1):
209
+ $filterData[$fkey] = $fdata[0];
210
+ endif;
211
+ endforeach;
212
+ endif;
213
+ $data['filter'] = $filterData;
214
+ //print_r($filterData);exit;
215
+ if(!empty($data['filter'])):
216
+ //$pCollection->addAttributeToSelect('*');
217
+ foreach($data['filter'] as $key => $value)
218
+ {
219
+ if(is_array($value))
220
+ {
221
+ //print_r($key);exit;
222
+ if($key == "price")
223
+ {
224
+ foreach($value as $option)
225
+ {
226
+ $option = explode("-",$option);
227
+ $option = explode("-",$value);
228
+ if($option[0] == '') $option[0] = 0;
229
+ if($option[1] == '') $option[1] = 100000000;
230
+ $pCollection->addAttributeToFilter($key,array('from'=>$option[0],'to'=>$option[1]));
231
+ }
232
+ }
233
+ else
234
+ {
235
+ $optionArray = array();
236
+ foreach($value as $option)
237
+ {
238
+ //$pCollection->addAttributeToFilter($key,$option);
239
+ $optionArray[] = array('attribute'=> $key, 'finset'=> $option);
240
+ //echo $key . ":" . $option;exit;
241
+ }
242
+ $pCollection->addAttributeToFilter($optionArray);
243
+ }
244
+ }
245
+ else
246
+ {
247
+ if($key == "price")
248
+ {
249
+ //foreach($value as $option)
250
+ {
251
+ //$option = explode("-",$option);
252
+ $option = explode("-",$value);
253
+ if($option[0] == '') $option[0] = 0;
254
+ if($option[1] == '') $option[1] = 100000000;
255
+ $pCollection->addAttributeToFilter($key,array('from'=>$option[0],'to'=>$option[1]));
256
+ }
257
+ }
258
+ else{
259
+ //print_r(array($key, $value));exit;
260
+ $value = (int)$value;
261
+ //$pCollection->addAttributeToFilter($key,array("finset"=>$value));
262
+ $pCollection->joinField($key.'_idx',
263
+ 'catalog_product_index_eav',
264
+ null,
265
+ 'entity_id=entity_id',
266
+ "{{table}}.store_id='".$storeId."' AND {{table}}.value = '".$value."'",
267
+ 'INNER');
268
+ //$pCollection->addAttributeToFilter('color', 27);
269
+ /*
270
+ $pCollection->addAttributeToFilter(
271
+ array(
272
+ array('attribute' => 'color', 'null' => true),
273
+ array('attribute' => 'color', 'in' => array(27)),
274
+ ),
275
+ '',
276
+ 'INNER'
277
+ );
278
+ */
279
+ //$pCollection->addFieldToFilter($key,array('eq' => $option));
280
+ }
281
+ }
282
+ }
283
+ endif;
284
+ }
285
+ //echo $pCollection->getSelect()->__toString();exit;
286
+ switch ($data['order'])
287
+ {
288
+ case "price-l-h":
289
+ $pCollection->setOrder('price', 'asc');
290
+ break;
291
+ case "price-h-l":
292
+ $pCollection->setOrder('price', 'desc');
293
+ break;
294
+ case "rating-h-l":
295
+ $pCollection->joinField('rating_score',
296
+ 'review_entity_summary',
297
+ 'rating_summary',
298
+ 'entity_pk_value=entity_id',
299
+ array('entity_type'=>1, 'store_id'=> Mage::app()->getStore()->getId()),
300
+ 'left'
301
+ );
302
+ $pCollection->setOrder('rating_score', 'desc');
303
+ break;
304
+ case "name-a-z":
305
+ $pCollection->setOrder('name', 'asc');
306
+ break;
307
+ case "name-z-a":
308
+ $pCollection->setOrder('name', 'desc');
309
+ break;
310
+ case "newest_first":
311
+ $pCollection->setOrder('entity_id', 'desc');
312
+ break;
313
+ default:
314
+ $pCollection->setOrder('ordered_qty', 'asc'); //most_popular
315
+ }
316
+
317
+ if(isset($data['category_id']) && !empty($data['category_id'])):
318
+ $category = Mage::getModel("catalog/category")->load($data['category_id']);
319
+ $layer = Mage::getModel("catalog/layer");
320
+ $layer->setCurrentCategory($category);
321
+ $attributes = $layer->getFilterableAttributes();
322
+ $filter = array(
323
+ "message" => "",
324
+ "data" => array()
325
+ );
326
+
327
+ try{
328
+ if(count($attributes)>0)
329
+ {
330
+ foreach ($attributes as $attribute)
331
+ {
332
+ if ($attribute->getAttributeCode() == 'price') {
333
+ $filterBlockName = 'catalog/layer_filter_price';
334
+ } elseif ($attribute->getBackendType() == 'decimal') {
335
+ $filterBlockName = 'catalog/layer_filter_decimal';
336
+ } else {
337
+ $filterBlockName = 'catalog/layer_filter_attribute';
338
+ }
339
+
340
+ $result = Mage::getBlockSingleton($filterBlockName)->setLayer($layer)->setAttributeModel($attribute)->init();
341
+ if($result->getItems())
342
+ {
343
+ $attributeCode = (string)$attribute->getAttributeCode();
344
+ $fd = array();
345
+ $fd['attributeCode'] = $attributeCode;
346
+ $fd['type'] = $attribute->getFrontendInput();
347
+ $fd['label'] = $attribute->getFrontendLabel();
348
+ $fd['code'] = $attribute->getId();
349
+ $j = 0;
350
+ foreach($result->getItems() as $option)
351
+ {
352
+ $fd['options'][$j]['label'] = $option->getLabel();
353
+ $fd['options'][$j]['value'] = $option->getValue();
354
+ $fd['options'][$j]['count'] = $option->getCount();
355
+ $j++;
356
+ }
357
+ $filter['data'][] = $fd;
358
+ }
359
+ }
360
+ }
361
+ }
362
+ catch(Exception $e){
363
+ $filter['message'] = $e->getMessage();
364
+ }
365
+ endif;
366
+
367
+ $pCollection->addUrlRewrite(0);
368
+
369
+ if(!isset($data['page']) || $data['page']=="") $data['page']=1;
370
+ if(!isset($data['limit']) || $data['limit']=="") $data['limit']=20;
371
+ $data['offset'] = ($data['page']-1) * $data['limit'];
372
+
373
+ $productList = array();
374
+ $product_total = $pCollection->getSize();
375
+ $pCollection->setPageSize($data['offset'] + $data['limit']);
376
+
377
+ if ($data['offset'] > $product_total)
378
+ return $this->errorStatus(array('opps! No information found'));
379
+ $check_limit = 0;
380
+ $check_offset = 0;
381
+
382
+ foreach ($pCollection as $product) {
383
+ if (++$check_offset <= $data['offset']) {
384
+ continue;
385
+ }
386
+ if (++$check_limit > $data['limit'])
387
+ break;
388
+
389
+ $stock = true;
390
+ if (version_compare(Mage::getVersion(), '1.4.0.1', '=') === true) {
391
+ if (!$product->isSaleable()) $stock = false;
392
+ }
393
+
394
+ $info_product = array(
395
+ 'product_id' => $product->getId(),
396
+ 'entity_id' => $product->getId(),
397
+ 'name' => $product->getName(),
398
+ 'type_id' => $product->getTypeId(),
399
+ 'price' => $product->getPrice(),
400
+ 'special_price' => $product->getFinalPrice(),
401
+ 'stock_status' => $stock,
402
+ 'reviews' => $ratings[5],
403
+ 'product_small_image_url' => Mage::helper('catalog/image')->init($product, 'small_image')->resize(300)->__toString(),
404
+ 'product_image_url' => Mage::helper('catalog/image')->init($product, 'small_image')->resize(300)->__toString(),
405
+ //'product_image' => $this->getImageProduct($product, null, $width, $height),
406
+ //'manufacturer_name' => $product->getAttributeText('manufacturer') == false ? '' : $product->getAttributeText('manufacturer'),
407
+ 'product_reviews' => $this->_getProductReviews($product->getId())
408
+ );
409
+
410
+ $prices = $this->_productPrices($product);
411
+ //---- add bundle and grouped price into product info array
412
+ if ($prices) {
413
+ $info_product = array_merge($info_product, $prices);
414
+ }
415
+
416
+ $requestObj = Mage::app()->getFrontController()->getRequest();
417
+ $event_name = $requestObj->getRequestedRouteName() . '_' .
418
+ $requestObj->getRequestedControllerName() . '_' .
419
+ $requestObj->getRequestedActionName();
420
+
421
+ $name_of_event= $event_name. '_product_detail';
422
+ //$event_name = $this->getControllerName() . '_product_detail';
423
+ $event_value = array(
424
+ 'object' => $this,
425
+ 'product' => $product
426
+ );
427
+ Mage::dispatchEvent($name_of_event, $event_value);
428
+ $productList[] = $info_product;
429
+ }
430
+
431
+ $information = $this->successStatus();
432
+ $information['message'] = array($product_total);
433
+ $information['data']['products'] = $productList;
434
+ $information['data']['filters'] = $filter;
435
+ $information['data']['product_count'] = $product_total;
436
+
437
+ return $information;
438
+ }
439
+
440
+ public function getRandomProducts($randomCount = 10)
441
+ {
442
+ $storeId = $this->_getStoreId();
443
+ $pCollection = Mage::getModel('catalog/product')->getCollection()
444
+ ->addAttributeToSelect('*')
445
+ ->addAttributeToFilter('status', '1')
446
+ ->addAttributeToFilter('visibility', '4')
447
+ ->setStoreId($storeId)
448
+ ->addFinalPrice();
449
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($pCollection);
450
+ $pCollection->getSelect()->order('RAND()');
451
+ $pCollection->getSelect()->limit($randomCount);
452
+
453
+ $products = array();
454
+ if(!empty($pCollection)){
455
+ foreach ($pCollection as $key => $_product) {
456
+ $row = array();
457
+ $row['entity_id'] = $_product->getId();
458
+ $row['entity_type_id'] = $_product->getEntityTypeId();
459
+ $row['attribute_set_id'] = $_product->getAttributeSetId();
460
+ $row['type_id'] = $_product->getTypeId();
461
+ $row['sku'] = $_product->getSku();
462
+ $row['name'] = $_product->getName();
463
+ $row['price'] = $_product->getPrice();
464
+ $row['final_price'] = $_product->getFinalPrice();
465
+ $row['special_price'] = $_product->getSpecialPrice();
466
+ $row['is_salable'] = $_product->getIsSalable();
467
+ $row['status'] = $_product->getStatus();
468
+ $row['product_thumbnail_url'] = Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(200)->__toString();
469
+ $products[] = $row;
470
+ }
471
+ }
472
+
473
+ return $products;
474
+ }
475
+
476
+ function getProductRatingStar($productId)
477
+ {
478
+ $reviews = Mage::getModel('review/review')
479
+ ->getResourceCollection()
480
+ ->addStoreFilter(Mage::app()->getStore()->getId())
481
+ ->addEntityFilter('product', $productId)
482
+ ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
483
+ ->setDateOrder()
484
+ ->addRateVotes();
485
+
486
+ $starReview = array();
487
+ $starReview[0] = 0;
488
+ $starReview[1] = 0;
489
+ $starReview[2] = 0;
490
+ $starReview[3] = 0;
491
+ $starReview[4] = 0;
492
+ $starReview[5] = 0;
493
+ if (count($reviews) > 0) {
494
+ foreach ($reviews->getItems() as $review) {
495
+ $starReview[5]++;
496
+ $tmp2 = 0;
497
+ foreach ($review->getRatingVotes() as $vote) {
498
+ $tmp2 += ($vote->getPercent() / 20);
499
+ }
500
+ $tmp1 = (int) ($tmp2 / count($review->getRatingVotes()));
501
+ $tmp3 = $tmp2 % 3;
502
+ $tmp1 = $tmp3 < 5 ? $tmp1 : $tmp1 + 1;
503
+ if ($tmp1 == 1) {
504
+ $starReview[0]++;
505
+ } elseif ($tmp1 == 2) {
506
+ $starReview[1]++;
507
+ } elseif ($tmp1 == 3) {
508
+ $starReview[2]++;
509
+ } elseif ($tmp1 == 4) {
510
+ $starReview[3]++;
511
+ } elseif ($tmp1 == 5) {
512
+ $starReview[4]++;
513
+ } elseif ($tmp1 == 0) {
514
+ $starReview[5]--;
515
+ }
516
+ }
517
+ }
518
+ return $starReview;
519
+ }
520
+
521
+ /**
522
+ * added by yash
523
+ * for getting product reviews
524
+ */
525
+ function _getProductReviews($productId)
526
+ {
527
+ $reviews = Mage::getModel('review/review')
528
+ ->getResourceCollection()
529
+ ->addStoreFilter(Mage::app()->getStore()->getId())
530
+ ->addEntityFilter('product', $productId)
531
+ ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
532
+ ->setDateOrder()
533
+ ->addRateVotes();
534
+
535
+ $reviews_array = array();
536
+ $ratings = array();
537
+
538
+ if (count($reviews) > 0) {
539
+ foreach ($reviews->getItems() as $review) {
540
+ $reviewData = $review->getData();
541
+ $averageUserVoting = 0;
542
+
543
+ $votes = Mage::getModel('rating/rating_option_vote')
544
+ ->getResourceCollection()
545
+ ->setReviewFilter($reviewData['review_id'])
546
+ ->setStoreFilter(Mage::app()->getStore()->getId())
547
+ ->load();
548
+ $votesData = $votes->getData();
549
+ if(!empty($votesData)):
550
+ foreach($votesData as $vdata):
551
+ $averageUserVoting += $vdata['value'];
552
+ $ratings[] = $vdata['value'];
553
+ endforeach;
554
+ $averageUserVoting = round(($averageUserVoting / count($votesData)), 2);
555
+ endif;
556
+ $reviewData['votes'] = $votesData;
557
+ $reviewData['averageUserVoting'] = $averageUserVoting;
558
+
559
+ //$reviews_array[] = $review->getData();
560
+ $reviews_array[] = $reviewData;
561
+ }
562
+ }
563
+ $averageRating = round((array_sum($ratings)/count($ratings)),2);
564
+
565
+ $result_array = array(
566
+ 'reviewsCount' => count($reviews),
567
+ 'averageRating' => $averageRating,
568
+ 'reviews' => $reviews_array,
569
+ );
570
+ return $result_array;
571
+ }
572
+
573
+ public function productInfo($data)
574
+ {
575
+ $product_id = $data['product_id'];
576
+ $product = Mage::getModel('catalog/product')->load($product_id);
577
+ if (!$product->getId()) {
578
+ $information = $this->errorStatus("Product_Does_Not_Exists");
579
+ return $information;
580
+ }
581
+
582
+ $option = $this->_getAllProductOptions($product);
583
+ $prices = $this->_productPrices($product);
584
+
585
+ $images=array();
586
+ $i=0;
587
+ foreach ($product->getMediaGallery('images') as $image) {
588
+ if ($image['disabled']) {
589
+ continue;
590
+ }
591
+ $images[$i]['full_image_url'] = Mage::helper('catalog/image')->init($product, 'thumbnail',$image['file'])->resize(300)->__toString();
592
+ $images[$i]['id'] = isset($image['value_id']) ? $image['value_id'] : null;
593
+ $images[$i]['position'] = $image['position'];
594
+ $images[$i]['label'] = $image['label'];
595
+ $i++;
596
+ }
597
+ if(empty($images)){
598
+ $images[] = array(
599
+ 'full_image_url' => Mage::helper('catalog/image')->init($product, 'image')->resize(200)->__toString(),
600
+ 'id' => '0',
601
+ 'position' => '1',
602
+ 'label' => 'Base Image',
603
+ );
604
+ }
605
+
606
+ $stock = true;
607
+ if (version_compare(Mage::getVersion(), '1.4.0.1', '=') === true) {
608
+ if (!$product->isSaleable()) $stock = false;
609
+ }
610
+
611
+ $productInfo = array(
612
+ 'product_id' => $product_id,
613
+ 'name' => $product->getName(),
614
+ 'url' => $product->getProductUrl(),
615
+ 'type' => $product->getTypeId(),
616
+ 'attributeSetName' => Mage::getModel("eav/entity_attribute_set")->load($product->getAttributeSetId())->getAttributeSetName(),
617
+ 'price' => $product->getPrice(),
618
+ 'special_price' => $product->getFinalPrice(),
619
+ 'description' => Mage::helper('catalog/output')->productAttribute($product, $product->getDescription(), 'description'),
620
+ 'short_description' => Mage::helper('catalog/output')->productAttribute($product, $product->getShortDescription(), 'short_description'),
621
+ 'max_qty' => (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty(),
622
+ 'product_images' => $images,
623
+ 'product_thumbnail_url' => Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(200)->__toString(),
624
+ 'stock_status' => $stock,
625
+ 'options' => $option,
626
+ 'product_reviews' => $this->_getProductReviews($product_id)
627
+ );
628
+
629
+ if ($prices) {
630
+ $productInfo = array_merge($productInfo, $prices);
631
+ }
632
+
633
+ $productInfo = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/custom'))->getCustomProductDetailFields($product, $productInfo);
634
+
635
+ $requestObj = Mage::app()->getFrontController()->getRequest();
636
+ $event_name = $requestObj->getRequestedRouteName() . '_' .
637
+ $requestObj->getRequestedControllerName() . '_' .
638
+ $requestObj->getRequestedActionName();
639
+
640
+ $name_of_event= $event_name. '_product_detail';
641
+
642
+ $event_value = array(
643
+ 'object' => $this,
644
+ 'product' => $product
645
+ );
646
+ Mage::dispatchEvent($name_of_event, $event_value);
647
+ $information = '';
648
+
649
+ if (count($productInfo)) {
650
+ if(isset($data['addRecentViews']) && $data['addRecentViews'] == '1'){
651
+ Mage::dispatchEvent('catalog_controller_product_view', array('product' => $product));
652
+ Mage::getSingleton('catalog/session')->setLastViewedProductId($product->getId());
653
+ }
654
+ $information = $this->successStatus();
655
+ $information['data']['product_details'] = $productInfo;
656
+ $information['data']['related_products'] = $this->getRelatedProducts($product);
657
+ $information['data']['product_details']['ratingOptions'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/review'))->_getRatingOptions(array(
658
+ "product_id" => $product_id,
659
+ ));
660
+ if(isset($data['addRecentViews']) && $data['addRecentViews'] == '1'){
661
+ $information['data']['recentlyViewed'] = $this->getRecentlyViewedProducts();
662
+ }
663
+ } else {
664
+ $information = $this->errorStatus();
665
+ }
666
+ return $information;
667
+ }
668
+
669
+ public function _productPrices($product)
670
+ {
671
+ // ----- Get Price for bundle and ground products
672
+ $type = $product->getTypeId();
673
+ switch ($type) {
674
+ case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE :
675
+ /*
676
+ ----- Bundle price
677
+ */
678
+ $prices = array();
679
+ $productPrice = $product->getPriceModel();
680
+ if (version_compare(Mage::getVersion(), '1.4.2.0', '>=') === true) {
681
+ list($_minimalPriceTax, $_maximalPriceTax) = $productPrice->getTotalPrices($product, null, null, false);
682
+ }else{
683
+ list($_minimalPriceTax, $_maximalPriceTax) = $productPrice->getPrices($product, null, null, false);
684
+ }
685
+
686
+ if ($product->getPriceType() == 1) {
687
+ $_weeeTaxAmount = Mage::helper('weee')->getAmount($product);
688
+ $_weeeTaxAmountInclTaxes = $_weeeTaxAmount;
689
+ if (Mage::helper('weee')->isTaxable()) {
690
+ $_attributes = Mage::helper('weee')->getProductWeeeAttributesForRenderer($product, null, null, null, true);
691
+ $_weeeTaxAmountInclTaxes = Mage::helper('weee')->getAmountInclTaxes($_attributes);
692
+ }
693
+ if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($product, array(0, 1, 4))) {
694
+ $_minimalPriceTax += $_weeeTaxAmount;
695
+ $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes;
696
+ }
697
+ if ($_weeeTaxAmount && Mage::helper('weee')->typeOfDisplay($product, 2)) {
698
+ $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes;
699
+ }
700
+
701
+ }
702
+ $prices = array(
703
+ 'min_price' => $_minimalPriceTax,
704
+ 'max_price' => $_maximalPriceTax,
705
+ );
706
+
707
+ // --- ENd Budle price
708
+ break;
709
+ case Mage_Catalog_Model_Product_Type::TYPE_GROUPED :
710
+ /*
711
+ ----- Grouped price
712
+ */
713
+ $prices = array();
714
+ $_taxHelper = Mage::helper('tax');
715
+ $_minimalPriceValue = $product->getMinimalPrice();
716
+ //$_exclTax = $_taxHelper->getPrice($product, $_minimalPriceValue);
717
+ //$_inclTax = $_taxHelper->getPrice($product, $_minimalPriceValue, true);
718
+ //print_r($product->getData());exit;
719
+
720
+ /* custom code added for getting minimum and maximum price for grouped product */
721
+ $groupedProduct = $product;
722
+ $aProductIds = $groupedProduct->getTypeInstance()->getChildrenIds($groupedProduct->getId());
723
+
724
+ $group_prices = array();
725
+ foreach ($aProductIds as $ids) {
726
+ foreach ($ids as $id) {
727
+ $aProduct = Mage::getModel('catalog/product')->load($id);
728
+ $group_prices[] = $aProduct->getPriceModel()->getPrice($aProduct);
729
+ }
730
+ }
731
+ if(!empty($group_prices))
732
+ {
733
+ $prices = array(
734
+ 'min_price' => min($group_prices),
735
+ 'max_price' => max($group_prices)
736
+ );
737
+ }
738
+
739
+ break;
740
+ // -----END -- Grouped Price
741
+ }
742
+ // ----- end Price
743
+ return $prices;
744
+ }
745
+
746
+ public function getAttributes($product)
747
+ {
748
+ $result = array();
749
+ $attributes = $product->getAttributes();
750
+ foreach ($attributes as $attribute) {
751
+ if ($attribute->getIsVisibleOnFront()) {
752
+ // Zend_debug::dump(get_class_methods($attribute));die();
753
+ $result[] = array(
754
+ 'title' => $attribute->getFrontendLabel(),
755
+ 'value' => $attribute->getFrontend()->getValue($product),
756
+ );
757
+ }
758
+ }
759
+ return $result;
760
+ }
761
+
762
+ public function getProductOptions($product)
763
+ {
764
+ $type = $product->getTypeId();
765
+ switch ($type) {
766
+ case Mage_Catalog_Model_Product_Type::TYPE_SIMPLE:
767
+ return $this->getSimpleProductOptions($product);
768
+ break;
769
+ case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE :
770
+ return $this->getBundleProductOptions($product);
771
+ break;
772
+ case Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE :
773
+ return $this->getConfigurableProductOptions($product);
774
+ break;
775
+ case Mage_Catalog_Model_Product_Type::TYPE_GROUPED :
776
+ return $this->getGroupedProductOptions($product);
777
+ break;
778
+ case Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL :
779
+ return $this->getVirtualProductOptions($product);
780
+ break;
781
+ }
782
+ }
783
+
784
+ public function _getAllProductOptions($product)
785
+ {
786
+ $type = $product->getTypeId();
787
+
788
+ $options = array(
789
+ 'product_options' => $this->getSimpleProductOptions($product),
790
+ 'product_super_attributes' => array(),
791
+ 'super_group' => array(),
792
+ 'link' => array(),
793
+ 'sample_links' => array(),
794
+ 'bundle' => array(),
795
+ 'virtual' => array(),
796
+ );
797
+
798
+ switch ($type) {
799
+ case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE :
800
+ $options['bundle'] = $this->getBundleProductOptions($product);
801
+ break;
802
+ case Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE :
803
+ $options['product_super_attributes'] = $this->getConfigurableProductOptions($product);
804
+ break;
805
+ case 'downloadable' :
806
+ $links = $this->getDownloadableLinks($product);
807
+ $options['link'] = $links['links'];
808
+ $options['sample_links'] = $links['samples'];
809
+ break;
810
+ case Mage_Catalog_Model_Product_Type::TYPE_GROUPED :
811
+ $options['super_group'] = $this->getGroupedProductOptions($product);
812
+ break;
813
+ case Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL :
814
+ $options['virtual'] = $this->getVirtualProductOptions($product);
815
+ break;
816
+ }
817
+
818
+ return $options;
819
+ }
820
+
821
+ public function getSimpleProductOptions($product)
822
+ {
823
+ $options=array();
824
+ foreach ($product->getOptions() as $o) {
825
+ $_tmpOptions = $o->getData();
826
+ if($o->getGroupByType() == Mage_Catalog_Model_Product_Option::OPTION_GROUP_TEXT)
827
+ {
828
+ $_tmpTextType= array(
829
+ 'price' => $o->getPrice(true),
830
+ 'price_type' => $o->getPriceType(),
831
+ 'sku' => $o->getSku(),
832
+ 'max_characters' => $o->getMaxCharacters(),
833
+ );
834
+ $_tmpOptions = array_merge($_tmpOptions, $_tmpTextType);
835
+ }
836
+ if($o->getGroupByType() == Mage_Catalog_Model_Product_Option::OPTION_GROUP_DATE)
837
+ {
838
+ $_tmpTextType= array(
839
+ 'price' => $o->getPrice(true),
840
+ 'price_type' => $o->getPriceType(),
841
+ 'sku' => $o->getSku(),
842
+ );
843
+ $_tmpOptions = array_merge($_tmpOptions, $_tmpTextType);
844
+ }
845
+ if($o->getGroupByType()== Mage_Catalog_Model_Product_Option::OPTION_GROUP_SELECT)
846
+ {
847
+ $values = $o->getValues();
848
+ $_tmp['options']= array();
849
+ foreach ($values as $v) {
850
+ $_tmp['options'][] = $v->getData();
851
+ }
852
+ $_tmpOptions = array_merge($_tmpOptions, $_tmp);
853
+ }
854
+
855
+ if($o->getGroupByType()== Mage_Catalog_Model_Product_Option::OPTION_GROUP_FILE)
856
+ {
857
+ $_tmpTextType= array(
858
+ 'file_extension' => $o->getFileExtension(),
859
+ 'image_size_x' => $o->getImageSizeX(),
860
+ 'image_size_y' => $o->getImageSizeY(),
861
+ );
862
+ $_tmpOptions = array_merge($_tmpOptions, $_tmpTextType);
863
+ }
864
+ $options[]=$_tmpOptions;
865
+ }
866
+ return $options;
867
+ }
868
+
869
+ public function getBundleProductOptions($product)
870
+ {
871
+ $typeInstance = $product->getTypeInstance(true);
872
+ $typeInstance->setStoreFilter($product->getStoreId(), $product);
873
+ $optionCollection = $typeInstance->getOptionsCollection($product);
874
+
875
+ $selectionCollection = $typeInstance->getSelectionsCollection(
876
+ $typeInstance->getOptionsIds($product), $product
877
+ );
878
+
879
+ $attributes = $optionCollection->appendSelections($selectionCollection, false, false);
880
+
881
+ $options = array();
882
+ //$coreHelper = Mage::helper('core');
883
+ foreach ($attributes as $_attribute) {
884
+ $_tmpOptions = array (
885
+ 'option_id' => $_attribute->getId(),
886
+ 'option_title' => $_attribute->getTitle(),
887
+ 'position' => $_attribute->getPosition(),
888
+ 'required' => $_attribute->getRequired(),
889
+ 'option_type' => $_attribute->getType(),
890
+ );
891
+ $_tmp['options'] = array();
892
+ foreach ($_attribute->getSelections() as $_selection) {
893
+ $_tmp['options'][] = array (
894
+ 'option_id' => $_selection->getSelectionId(),
895
+ 'option_value' => $_selection->getName(),
896
+ 'option_selection_qty' => $_selection->getSelectionQty(),
897
+ 'option_selection_can_change_qty' => $_selection->getSelectionCanChangeQty(),
898
+ 'option_position' => $_selection->getPosition(),
899
+ 'option_is_default' => $_selection->getIsDefault(),
900
+ 'option_price' => $product->getPriceModel()->getSelectionPreFinalPrice($product, $_selection, 1),
901
+ );
902
+ }
903
+ $_tmpOptions = array_merge($_tmpOptions, $_tmp);
904
+ $options[] = $_tmpOptions;
905
+ }
906
+ return $options;
907
+ }
908
+
909
+ public function getConfigurableProductOptions($product)
910
+ {
911
+ $options = array();
912
+ $currentProduct = $product;
913
+ $attributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
914
+
915
+ if (!$this->hasAllowProducts()) {
916
+ $products = array();
917
+ $skipSaleableCheck = true;
918
+ if (version_compare(Mage::getVersion(), '1.7.0.0', '>=') === true) {
919
+ $skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck();
920
+ }
921
+ $allProducts = $product->getTypeInstance(true)
922
+ ->getUsedProducts(null, $product);
923
+ foreach ($allProducts as $_product) {
924
+ if ($_product->isSaleable() || $skipSaleableCheck) {
925
+ $products[] = $_product;
926
+ }
927
+ }
928
+ $this->setAllowProducts($products);
929
+ }
930
+ $products = $this->getData('allow_products');
931
+ //return $products;
932
+
933
+ $list_value = array();
934
+ $information = array();
935
+ foreach ($products as $_product) {
936
+ $productId = $_product->getId();
937
+ foreach ($attributes as $attribute) {
938
+ $productAttribute = $attribute->getProductAttribute();
939
+ $productAttributeId = $productAttribute->getId();
940
+ $attributeValue = $_product->getData($productAttribute->getAttributeCode());
941
+ // if (!in_array($attributeValue, $list_value))
942
+ // $list_value[] = $attributeValue;
943
+ if (!isset($options[$productAttributeId])) {
944
+ $options[$productAttributeId] = array();
945
+ }
946
+
947
+ if (!isset($options[$productAttributeId][$attributeValue])) {
948
+ $options[$productAttributeId][$attributeValue] = array();
949
+ }
950
+ $options[$productAttributeId][$attributeValue][] = $productId;
951
+ }
952
+ }
953
+
954
+ foreach ($attributes as $attribute) {
955
+ $attInfo = $attribute->getData();
956
+ $attributeId = $attribute->getProductAttribute()->getId();
957
+ if(!empty($attInfo['prices']))
958
+ {
959
+ foreach($attInfo['prices'] as $p_key => $p)
960
+ {
961
+ $productsIndex = array();
962
+ if (isset($options[$attributeId][$p['value_index']])) {
963
+ $productsIndex = $options[$attributeId][$p['value_index']];
964
+ }
965
+ $attInfo['prices'][$p_key]['dependence_option_ids'] = $productsIndex;
966
+ }
967
+ }
968
+ $information[] = $attInfo;
969
+ }
970
+ return $information;
971
+ }
972
+
973
+ public function getDownloadableLinks($product)
974
+ {
975
+ $linkArr = array();
976
+ $links = $product->getTypeInstance(true)->getLinks($product);
977
+ foreach ($links as $item) {
978
+ $tmpLinkItem = array(
979
+ 'link_id' => $item->getId(),
980
+ 'title' => $item->getTitle(),
981
+ 'price' => $item->getPrice(),
982
+ 'number_of_downloads' => $item->getNumberOfDownloads(),
983
+ 'is_shareable' => $item->getIsShareable(),
984
+ 'link_url' => $item->getLinkUrl(),
985
+ 'link_type' => $item->getLinkType(),
986
+ 'sample_file' => $item->getSampleFile(),
987
+ 'sample_url' => $item->getSampleUrl(),
988
+ 'sample_type' => $item->getSampleType(),
989
+ 'sort_order' => $item->getSortOrder()
990
+ );
991
+ $file = Mage::helper('downloadable/file')->getFilePath(
992
+ Mage_Downloadable_Model_Link::getBasePath(), $item->getLinkFile()
993
+ );
994
+
995
+ if ($item->getLinkFile() && !is_file($file)) {
996
+ Mage::helper('core/file_storage_database')->saveFileToFilesystem($file);
997
+ }
998
+
999
+ if ($item->getLinkFile() && is_file($file)) {
1000
+ $name = Mage::helper('downloadable/file')->getFileFromPathFile($item->getLinkFile());
1001
+ $tmpLinkItem['file_save'] = array(
1002
+ array(
1003
+ 'file' => $item->getLinkFile(),
1004
+ 'name' => $name,
1005
+ 'size' => filesize($file),
1006
+ 'status' => 'old'
1007
+ ));
1008
+ }
1009
+ $sampleFile = Mage::helper('downloadable/file')->getFilePath(
1010
+ Mage_Downloadable_Model_Link::getBaseSamplePath(), $item->getSampleFile()
1011
+ );
1012
+ if ($item->getSampleFile() && is_file($sampleFile)) {
1013
+ $tmpLinkItem['sample_file_save'] = array(
1014
+ array(
1015
+ 'file' => $item->getSampleFile(),
1016
+ 'name' => Mage::helper('downloadable/file')->getFileFromPathFile($item->getSampleFile()),
1017
+ 'size' => filesize($sampleFile),
1018
+ 'status' => 'old'
1019
+ ));
1020
+ }
1021
+ if ($item->getNumberOfDownloads() == '0') {
1022
+ $tmpLinkItem['is_unlimited'] = 1;
1023
+ }
1024
+ if ($product->getStoreId() && $item->getStoreTitle()) {
1025
+ $tmpLinkItem['store_title'] = $item->getStoreTitle();
1026
+ }
1027
+ /*
1028
+ if ($product->getStoreId() && Mage::helper('downloadable')->getIsPriceWebsiteScope()) {
1029
+ $tmpLinkItem['website_price'] = $item->getWebsitePrice();
1030
+ }
1031
+ */
1032
+ $linkArr[] = $tmpLinkItem;
1033
+ }
1034
+ unset($item);
1035
+ unset($tmpLinkItem);
1036
+ unset($links);
1037
+
1038
+ $samples = $product->getTypeInstance(true)->getSamples($product)->getData();
1039
+ return array('links' => $linkArr, 'samples' => $samples);
1040
+ }
1041
+
1042
+ public function getGroupedProductOptions($product)
1043
+ {
1044
+ $options = array();
1045
+ $associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
1046
+ $_minprice = NULL;
1047
+ if (count($associatedProducts)) {
1048
+ foreach ($associatedProducts as $product) {
1049
+ if ($product->isSaleable()) {
1050
+ if ($_minprice == NULL) {
1051
+ $_minprice = $product->getFinalPrice();
1052
+ } else {
1053
+ if ($_minprice > $product->getFinalPrice())
1054
+ $_minprice = $product->getFinalPrice();
1055
+ }
1056
+ $options[] = array(
1057
+ 'option_id' => $product->getId(),
1058
+ 'option_value' => $product->getName(),
1059
+ 'option_title' => $product->getName(),
1060
+ 'option_type' => 'text',
1061
+ 'option_price' => $product->getFinalPrice(),
1062
+ );
1063
+ }
1064
+ }
1065
+ }
1066
+
1067
+ return $options;
1068
+ }
1069
+
1070
+ public function getVirtualProductOptions($product)
1071
+ {
1072
+ return array();
1073
+ }
1074
+
1075
+ public function getResizedImage($url, $width, $height = null, $quality = 100)
1076
+ {
1077
+ if (!$url)
1078
+ return false;
1079
+ $imageName = substr(strrchr($url,"/"),1);
1080
+ $imageUrl = Mage::getBaseDir('media').DS."catalog".DS."category".DS.$imageName;
1081
+ if (!is_file( $imageUrl ))
1082
+ return false;
1083
+
1084
+ $imageResized = Mage::getBaseDir('media').DS."catalog".DS."category".DS."cache".DS."cat_resized".DS.$imageName;
1085
+ if (!file_exists($imageResized) && file_exists($imageUrl) || file_exists($imageUrl) && filemtime($imageUrl) > filemtime($imageResized)):
1086
+ $imageObj = new Varien_Image($imageUrl);
1087
+ $imageObj->constrainOnly(true);
1088
+ $imageObj->keepAspectRatio(false);
1089
+ $imageObj->keepFrame(false);
1090
+ $imageObj->quality($quality);
1091
+ $imageObj->resize($width, $height);
1092
+ $imageObj->save($imageResized);
1093
+ endif;
1094
+
1095
+ if(file_exists($imageResized)){
1096
+ $img_url = Mage::getBaseUrl('media' )."catalog/category/cache/cat_resized/".$imageName;
1097
+ return $img_url;
1098
+ }
1099
+ else{
1100
+ return $url;
1101
+ }
1102
+ }
1103
+
1104
+ /**
1105
+ * Added by Yash to get recently viewed products
1106
+ * @param int $data['limit']
1107
+ * 14-10-2014
1108
+ */
1109
+ public function getRecentlyViewedProducts($data = null)
1110
+ {
1111
+ $limit = isset($data['limit'])?$data['limit']:10;
1112
+ $recentlyViewedProducts = Mage::getSingleton('Mage_Reports_Block_Product_Viewed')->setPageSize($limit)->getItemsCollection();
1113
+ $recentlyViewedProductsArray = array();
1114
+ if($recentlyViewedProducts){
1115
+ foreach($recentlyViewedProducts as $row){
1116
+ $productData = $row->getData();
1117
+ $recentlyViewedProductsArray[] = array(
1118
+ "entity_id" => $productData['entity_id'],
1119
+ "entity_type_id" => $productData['entity_type_id'],
1120
+ "attribute_set_id" => $productData['attribute_set_id'],
1121
+ "type_id" => $productData['type_id'],
1122
+ "sku" => $productData['sku'],
1123
+ "price" => $productData['price'],
1124
+ "final_price" => $productData['final_price'],
1125
+ "min_price" => $productData['min_price'],
1126
+ "max_price" => $productData['max_price'],
1127
+ "special_price" => $productData['special_price'],
1128
+ "name" => $productData['name'],
1129
+ "is_salable" => $productData['is_salable'],
1130
+ "status" => $productData['status'],
1131
+ "product_thumbnail_url" => Mage::helper('catalog/image')->init($row, 'thumbnail')->resize(200)->__toString(),
1132
+ );
1133
+ }
1134
+ }
1135
+ return $recentlyViewedProductsArray;
1136
+ }
1137
+
1138
+ public function getRelatedProducts($product)
1139
+ {
1140
+ $website_id = Mage::app()->getWebsite()->getId();
1141
+ $limit = isset($data['limit'])?$data['limit']:5;
1142
+ $relatedProductIds = $product->getRelatedProductIds();
1143
+ $relatedProductsArray = array();
1144
+ if($relatedProductIds)
1145
+ {
1146
+ foreach($relatedProductIds as $id)
1147
+ {
1148
+ $productData = Mage::getModel('catalog/product')->load($id);
1149
+ //if($productData['is_salable']){
1150
+ if($productData->getIsSalable() && $productData->isVisibleInSiteVisibility() && in_array($website_id, $productData->getWebsiteIds())){
1151
+ $row = array(
1152
+ "entity_id" => $productData['entity_id'],
1153
+ "entity_type_id" => $productData['entity_type_id'],
1154
+ "attribute_set_id" => $productData['attribute_set_id'],
1155
+ "type_id" => $productData['type_id'],
1156
+ "sku" => $productData['sku'],
1157
+ "price" => $productData->getPrice(),
1158
+ "final_price" => $productData->getFinalPrice(),
1159
+ "special_price" => $productData->getFinalPrice(),
1160
+ "name" => $productData['name'],
1161
+ "is_salable" => $productData['is_salable'],
1162
+ "status" => $productData['status'],
1163
+ "product_thumbnail_url" => Mage::helper('catalog/image')->init($productData, 'thumbnail')->resize(200)->__toString(),
1164
+ );
1165
+
1166
+ $prices = $this->_productPrices($productData);
1167
+ //---- add bundle and grouped price into product info array
1168
+ if ($prices) {
1169
+ $row = array_merge($row, $prices);
1170
+ }
1171
+
1172
+ $relatedProducts[] = $row;
1173
+ }
1174
+ }
1175
+ }
1176
+
1177
+ return $relatedProducts;
1178
+ }
1179
+
1180
+ public function getAllProducts()
1181
+ {
1182
+ $storeId = $this->_getStoreId();
1183
+ $products = Mage::getModel('catalog/product')->getCollection()
1184
+ ->addAttributeToSelect('*')
1185
+ ->addAttributeToFilter('status', '1')
1186
+ ->setStoreId($storeId);
1187
+
1188
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($products);
1189
+ Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);
1190
+ $allProducts = array();
1191
+ if(!empty($products)){
1192
+ foreach ($products as $key => $value) {
1193
+ $row = $value->getData();
1194
+ $row['name'] = $value->getName();
1195
+ $allProducts[] = $row;
1196
+ }
1197
+ }
1198
+ return $allProducts;
1199
+ //return $products->getData();
1200
+ }
1201
+
1202
+ protected function _attachCategoryIcon($categories, $appcode)
1203
+ {
1204
+ $iconCategories = array();
1205
+ $iconCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
1206
+ ->addFieldToFilter('app_code', $appcode)
1207
+ ->addFieldToFilter('setting_code', 'category_icons');
1208
+ if($iconCollection->getSize()){
1209
+ foreach($iconCollection as $iconrow){
1210
+ $row = $iconrow->getData();
1211
+ $row = Mage::helper('mobiadmin')->_jsonUnserialize($row['value']);
1212
+ if(!empty($row)){
1213
+ foreach($row as $cat){
1214
+ $iconCategories[$cat['category_id']] = $cat['mobiicon'];
1215
+ }
1216
+ }
1217
+ }
1218
+ }
1219
+
1220
+ if(!empty($categories)){
1221
+ $baseurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'mobi_category_icons/';
1222
+ foreach($categories as $key => $cat){
1223
+ if(array_key_exists($cat['category_id'], $iconCategories)){
1224
+ if(!empty($iconCategories[$cat['category_id']])){
1225
+ $categories[$key]['mobiicon'] = $iconCategories[$cat['category_id']];
1226
+ $categories[$key]['mobiiconurl'] = Mage::getStoreConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL) . 'MobiSettings/category_svg.php';
1227
+ }
1228
+ else{
1229
+ $categories[$key]['mobiicon'] = null;
1230
+ $categories[$key]['mobiiconurl'] = null;
1231
+ }
1232
+ }
1233
+ else{
1234
+ $categories[$key]['mobiicon'] = null;
1235
+ $categories[$key]['mobiiconurl'] = null;
1236
+ }
1237
+ }
1238
+ }
1239
+ return $categories;
1240
+ }
1241
+ }
1242
+ ?>
app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Cms.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x3x1_Cms extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function getCmsdata($data)
6
+ {
7
+ $information = $this->successStatus();
8
+ $information['data']['CMS'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getCmsdata($data);
9
+ return $information;
10
+ }
11
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Config.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x3x1_Config extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ protected $store = FALSE;
6
+ protected function _setStoreId($data)
7
+ {
8
+ $storeCollection = Mage::getModel('mobiadmin/applications')->getCollection()
9
+ ->addFieldToFilter('app_code', $data['appcode'])
10
+ ->addFieldToFilter('app_key', $data['app_key']);
11
+ if($storeCollection->getSize()){
12
+ foreach($storeCollection as $store){
13
+ $store_id = $store['app_storeid'];
14
+ if(empty($store_id)){
15
+ $store_id = Mage::app()
16
+ ->getWebsite()
17
+ ->getDefaultGroup()
18
+ ->getDefaultStoreId();
19
+ }
20
+ $this->store = $store_id;
21
+ return $store_id;
22
+ }
23
+ }
24
+ else{
25
+ return FALSE;
26
+ }
27
+ }
28
+
29
+ public function getAllInitialData($data)
30
+ {
31
+ $information = array();
32
+ $store_id = $this->_setStoreId($data);
33
+ if($store_id === FALSE || $store_id === null)
34
+ return $this->errorStatus('Unauthorized Access');
35
+
36
+ $this->setAppStore($store_id);
37
+ $storeInfo = $this->_getStoreSettings();
38
+ $information = $this->successStatus();
39
+ $information['data'] = $storeInfo;
40
+ $information['data']['root_category_id'] = Mage::app()->getStore()->getRootCategoryId();
41
+ $information['data']['appinfo'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getAppinfo($data);
42
+ $information['data']['mobipaypal'] = Mage::helper('core')->isModuleEnabled('Mobicommerce_Mobipayments') ? Mage::getModel('mobipayments/standard')->getPaypalConfig() : null;
43
+ $information['data']['categories'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/catalog_catalog'))->_categoryTreeList($store_id, $data['appcode']);
44
+ $information['data']['homedata'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/home'))->_getHomeData($data);
45
+ $information['data']['CMS'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getCmsdata($data);
46
+ $information['data']['language'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/language'))->getLanguageData($storeInfo['store_info']['locale_identifier']);
47
+ $information['data']['push'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getPushdata($data);
48
+ $information['data']['popup'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/appsetting'))->getPopupdata($data);
49
+ $information['data']['countries'] = $this->_getCounties();
50
+ $information['data']['cart_details'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/shoppingcart_cart'))->getCartInfo($data);
51
+ //$information['data']['social'] = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/social'))->getSocialPlatforms();
52
+
53
+ $logged_user = null;
54
+ if(Mage::getSingleton('customer/session')->isLoggedIn()){
55
+ $_customer = Mage::getSingleton('customer/session')->getCustomer();
56
+ $model = Mage::getModel(Mage::getBlockSingleton('mobiservices/connector')->_getConnectorModel('mobiservices/user'));
57
+ $logged_user = $model->_getCustomerProfileData($_customer);
58
+ }
59
+ $information['data']['logged_user'] = $logged_user;
60
+ $information['data']['currentDate'] = date('Y-m-d H:i:s');
61
+ return $information;
62
+ }
63
+
64
+ public function _getStoreSettings()
65
+ {
66
+ $options = Mage::getResourceSingleton('customer/customer')->getAttribute('gender')->getSource()->getAllOptions();
67
+ $values = array();
68
+ foreach ($options as $option) {
69
+ if ($option['value']) {
70
+ $values[] = array(
71
+ 'label' => $option['label'],
72
+ 'value' => $option['value'],
73
+ );
74
+ }
75
+ }
76
+
77
+ $country_code = Mage::getStoreConfig('general/country/default');
78
+ $country = Mage::getModel('directory/country')->loadByCode($country_code);
79
+ $currencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
80
+ $info = array(
81
+ 'store_info' => array(
82
+ 'country_code' => $country->getId(),
83
+ 'country_name' => $country->getName(),
84
+ 'locale_identifier' => Mage::app()->getLocale()->getLocaleCode(),
85
+ 'currency_symbol' => Mage::app()->getLocale()->currency($currencyCode)->getSymbol(),
86
+ 'currency_code' => $currencyCode,
87
+ 'store_id' => $this->_getStoreId(),
88
+ 'store_name' => $this->_getStoreName(),
89
+ ),
90
+ 'checkout_config' => array(
91
+ 'enable_guest_checkout' => Mage::getStoreConfig('checkout/options/guest_checkout'),
92
+ 'enable_agreements' => is_null(Mage::getStoreConfig('checkout/options/enable_agreements')) ? 0 : Mage::getStoreConfig('checkout/options/enable_agreements'),
93
+ ),
94
+ );
95
+
96
+ return $info;
97
+ }
98
+
99
+ public function setAppStore($storeId)
100
+ {
101
+ if($storeId!=""){
102
+ Mage::app()->getCookie()->set(
103
+ Mage_Core_Model_Store::COOKIE_NAME, Mage::app()->getStore($storeId)->getCode(), TRUE
104
+ );
105
+ Mage::app()->setCurrentStore(
106
+ Mage::app()->getStore($storeId)->getCode()
107
+ );
108
+ Mage::getSingleton('core/locale')->emulate($storeId);
109
+ }
110
+ }
111
+
112
+ public function _getCounties()
113
+ {
114
+ $list = array();
115
+ $country_default = Mage::getStoreConfig('general/country/default');
116
+ $countries = Mage::getResourceModel('directory/country_collection')->loadByStore();
117
+ $cache = null;
118
+ foreach ($countries as $country) {
119
+ if ($country_default == $country->getId()) {
120
+ $cache = array(
121
+ 'iso2' => $country->getId(),
122
+ 'name' => $country->getName(),
123
+ 'states' => $this->_getStates(array('country_code'=>$country->getId())),
124
+ );
125
+ }
126
+ else{
127
+ $list[] = array(
128
+ 'iso2' => $country->getId(),
129
+ 'name' => $country->getName(),
130
+ 'states' => $this->_getStates(array('country_code'=>$country->getId())),
131
+ );
132
+ }
133
+ }
134
+ if(!empty($list)){
135
+ $iso2 = array();
136
+ $name = array();
137
+ foreach ($list as $key => $row) {
138
+ $iso2[$key] = $row['iso2'];
139
+ $name[$key] = $row['name'];
140
+ }
141
+ array_multisort($name, SORT_ASC, $iso2, SORT_DESC, $list);
142
+ }
143
+
144
+ if ($cache){
145
+ array_unshift($list, $cache);
146
+ }
147
+ return $list;
148
+ }
149
+
150
+ public function _getStates($data)
151
+ {
152
+ $code = $data['country_code'];
153
+ $list = array();
154
+ if ($code) {
155
+ $states = Mage::getModel('directory/country')->loadByCode($code)->getRegions();
156
+ foreach ($states as $state) {
157
+ $list[] = array(
158
+ 'region_id' => $state->getRegionId(),
159
+ 'name' => $state->getName(),
160
+ 'code' => $state->getCode(),
161
+ );
162
+ }
163
+ return $list;
164
+ } else {
165
+ return array();
166
+ }
167
+ }
168
+
169
+ public function _getAgreements()
170
+ {
171
+ if (!Mage::getStoreConfigFlag('checkout/options/enable_agreements')) {
172
+ $agreements = array();
173
+ return $agreements;
174
+ } else {
175
+ $agreements = Mage::getModel('checkout/agreement')->getCollection()
176
+ ->addStoreFilter(Mage::app()->getStore()->getId())
177
+ ->addFieldToFilter('is_active', 1);
178
+ return $agreements->getData();
179
+ }
180
+ }
181
+
182
+ public function getAgreements()
183
+ {
184
+ $info = $this->successStatus();
185
+ $info['data'] = $this->_getAgreements();
186
+ return $info;
187
+ }
188
+
189
+ public function deleteApplication($data)
190
+ {
191
+ if(!empty($data['appcode']) && !empty($data['app_key'])){
192
+ $applicationCollection = Mage::getModel('mobiadmin/applications')->getCollection()
193
+ ->addFieldToFilter('app_code', $data['appcode'])
194
+ ->addFieldToFilter('app_key', $data['app_key']);
195
+ if($applicationCollection->count() > 0){
196
+ //delete from mobicommerce_applications
197
+ foreach($applicationCollection as $application){
198
+ $application->delete();
199
+ }
200
+ //delete from mobicommerce_applications_settings
201
+ $applicationCollection = Mage::getModel('mobiadmin/appsetting')->getCollection()
202
+ ->addFieldToFilter('app_code', $data['appcode']);
203
+ if($applicationCollection->count() > 0){
204
+ foreach($applicationCollection as $application){
205
+ $application->delete();
206
+ }
207
+ }
208
+ //delete from mobicommerce_devicetokens
209
+ $applicationCollection = Mage::getModel('mobiadmin/devicetokens')->getCollection()
210
+ ->addFieldToFilter('md_appcode', $data['appcode']);
211
+ if($applicationCollection->count() > 0){
212
+ foreach($applicationCollection as $application){
213
+ $application->delete();
214
+ }
215
+ }
216
+ //delete from mobi_app_widgets
217
+ $applicationCollection = Mage::getModel('mobiadmin/appwidget')->getCollection()
218
+ ->addFieldToFilter('app_code', $data['appcode']);
219
+ if($applicationCollection->count() > 0){
220
+ foreach($applicationCollection as $application){
221
+ $application->delete();
222
+ }
223
+ }
224
+ $this->rrmdir(Mage::getBaseDir('media').DS.'mobi_commerce'.DS.$data['appcode']);
225
+ return $this->successStatus();
226
+ }
227
+ else{
228
+ return $this->errorStatus('Unauthorized Access');
229
+ }
230
+ }
231
+ else{
232
+ return $this->errorStatus('Unauthorized Access');
233
+ }
234
+ }
235
+
236
+ /* function to remove entire directory with all files in it */
237
+ protected function rrmdir($dir, $include_basedir = true)
238
+ {
239
+ if (is_dir($dir)) {
240
+ $objects = scandir($dir);
241
+ foreach ($objects as $object) {
242
+ if ($object != "." && $object != "..") {
243
+ if (filetype($dir."/".$object) == "dir") $this->rrmdir($dir."/".$object); else unlink($dir."/".$object);
244
+ }
245
+ }
246
+ reset($objects);
247
+ if($include_basedir)
248
+ rmdir($dir);
249
+ }
250
+ }
251
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/Custom.php ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x3x1_Custom extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ const REFRESH_CART_AFTER_ADD_PRODUCT = false;
6
+ const IS_SHIPPING_METHOD_CUSTOM_FIELDS = false;
7
+ const ROUNDUP_CART_VALUES = false;
8
+ const DNB_DESIGNTOOL_APPLIED = false;
9
+
10
+ public function getCustomCheckoutFields(){
11
+ $customFields = array();
12
+ $site = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
13
+
14
+ // P01
15
+ $customFields = array(
16
+ "register" => array(
17
+ array(
18
+ "code" => "taxvat",
19
+ "type" => "text",
20
+ "name" => "Codice Fiscale",
21
+ "required" => true,
22
+ "validation" => "",
23
+ "error_message" => "Questo è un campo obbligatorio.",
24
+ "registerDependent" => false
25
+ )
26
+ ),
27
+ "billing" => array(
28
+ array(
29
+ "code" => "taxvat",
30
+ "type" => "text",
31
+ "name" => "Codice Fiscale",
32
+ "required" => true,
33
+ "validation" => "",
34
+ "error_message" => "Questo è un campo obbligatorio.",
35
+ "registerDependent" => true
36
+ ),
37
+ ),
38
+ );
39
+ // F03
40
+ $customFields = array(
41
+ "shipping_method" => array(
42
+ array(
43
+ "code" => "adj[delivery_date]",
44
+ "type" => "date",
45
+ "name" => "Leveringsdatum",
46
+ "required" => true,
47
+ "validation" => "",
48
+ "error_message" => "Please enter delivery date",
49
+ "registerDependent" => false,
50
+ "params" => array(
51
+ "default_value" => "",
52
+ "description" => "",
53
+ "format" => "dd/mm/yyyy"
54
+ )
55
+ )
56
+ ),
57
+ );
58
+ $customFields = array();
59
+ return $customFields;
60
+ }
61
+
62
+ public function updateLanguageLength(){
63
+ $langCode = array('fr_FR');
64
+ $labelCode = array(
65
+ 'Home' => 8,
66
+ 'Add_To_Wishlist' => 18,
67
+ 'Logout' => 11,
68
+ );
69
+ $langCode = null;
70
+ if(!empty($langCode)){
71
+ $resource = Mage::getSingleton('core/resource');
72
+ $conn = $resource->getConnection('core_read');
73
+ $update_array = array();
74
+ foreach ($langCode as $lang) {
75
+ foreach($labelCode as $key => $value) {
76
+ $query = "UPDATE `mobicommerce_multilanguage` SET mm_maxlength = '$value' WHERE mm_language_code = '$lang' AND mm_label_code = '$key'";
77
+ $conn->query($query);
78
+ echo $query.'<br>';
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ public function updateLangLabelEnglish(){
85
+ $resource = Mage::getSingleton('core/resource');
86
+ $conn = $resource->getConnection('core_read');
87
+ $errors = array();
88
+ $en_US = $conn->query("SELECT * FROM `mobicommerce_multilanguage` WHERE mm_language_code = 'en_US'")->fetchAll();
89
+ //echo '<pre>';print_r($en_US);exit;
90
+ $en_US = null;
91
+ if(!empty($en_US)){
92
+ foreach($en_US as $en => $us){
93
+ try{
94
+ $us['mm_label'] = encodeLanguageLabels($us['mm_label']);
95
+ $conn->query("UPDATE `mobicommerce_multilanguage` SET mm_label = '".$us['mm_label']."' WHERE mm_label_code = '".$us['mm_label_code']."' AND mm_language_code != 'en_US'");
96
+ }
97
+ catch(Exception $e){
98
+ $errors[] = $e->getMessage();
99
+ }
100
+ }
101
+ }
102
+ print_r($errors);
103
+ }
104
+
105
+ public function getCustomProductDetailFields($_product, $productInfo){
106
+ $fields = array(
107
+ array(
108
+ "code" => "sku",
109
+ "type" => "text",
110
+ "relateTo" => "description",
111
+ "name" => "Codice",
112
+ "value" => "",
113
+ ),
114
+ array(
115
+ "code" => "manufacturer",
116
+ "type" => "dropdown",
117
+ "relateTo" => "description",
118
+ "name" => "Marchio",
119
+ "value" => "",
120
+ ),
121
+ array(
122
+ "code" => "consegna_time",
123
+ "type" => "text",
124
+ "relateTo" => "description",
125
+ "name" => "Tempo di Consegna",
126
+ "value" => "",
127
+ ),
128
+ array(
129
+ "code" => "generic_group",
130
+ "type" => "dropdown",
131
+ "relateTo" => "description",
132
+ "name" => "Reparto",
133
+ "value" => "",
134
+ ),
135
+ array(
136
+ "code" => "custom_stock_status",
137
+ "type" => "dropdown",
138
+ "relateTo" => "stock",
139
+ "name" => "Disponibilità",
140
+ "value" => "",
141
+ ),
142
+ );
143
+ $fields = array(
144
+ array(
145
+ "code" => "size_chart",
146
+ "type" => "text",
147
+ "relateTo" => "staticblock_identifier",
148
+ "name" => "SIZE CHART & GARMENT INFO",
149
+ "value" => "",
150
+ ),
151
+ );
152
+ // F17
153
+ $fields = array(
154
+ array(
155
+ "code" => "payuapi",
156
+ "type" => "payment_method_installments",
157
+ "relateTo" => "payment_method_installments",
158
+ "name" => "TAKSİT SEÇENEKLERİ",
159
+ "value" => null,
160
+ ),
161
+ array(
162
+ "code" => "Options",
163
+ "type" => "group_attribute",
164
+ "relateTo" => "group_attribute",
165
+ "name" => "ÖZELLİKLER",
166
+ "value" => "",
167
+ ),
168
+ array(
169
+ "code" => "returns_custom_tab_tr",
170
+ "type" => "staticblock_identifier",
171
+ "relateTo" => "staticblock_identifier",
172
+ "name" => "GARANTİ",
173
+ "value" => "",
174
+ ),
175
+ array(
176
+ "code" => "payment_custom_tab",
177
+ "type" => "staticblock_identifier",
178
+ "relateTo" => "staticblock_identifier",
179
+ "name" => "Ödeme",
180
+ "value" => "",
181
+ ),
182
+ array(
183
+ "code" => "shipping_custom_tab_tr",
184
+ "type" => "staticblock_identifier",
185
+ "relateTo" => "staticblock_identifier",
186
+ "name" => "KARGO",
187
+ "value" => "",
188
+ ),
189
+ );
190
+ // Dnb mobi
191
+ $fields = array(
192
+ array(
193
+ "code" => "is_customizable",
194
+ "type" => "dropdown",
195
+ "relateTo" => "DNBDESIGNTOOL_BUTTON",
196
+ "name" => "Personalize",
197
+ "value" => "",
198
+ ),
199
+ );
200
+ $fields = null;
201
+ $outputFields = array();
202
+ if(!empty($fields)){
203
+ foreach($fields as $field_key => $field){
204
+ try{
205
+ if(in_array($field['type'], array('text', 'dropdown'))){
206
+ if($_product->offsetExists($field['code'])){
207
+ switch ($field['type']) {
208
+ case 'text':
209
+ default:
210
+ $fields[$field_key]['value'] = $_product->getResource()->getAttribute($field['code'])->getFrontend()->getValue($_product);
211
+ break;
212
+ case 'dropdown':
213
+ if($field['code'] == 'is_customizable'){
214
+ $fields[$field_key]['value'] = strtolower($_product->getResource()->getAttribute($field['code'])->getFrontend()->getValue($_product)) == 'sí' ? 'Yes' : false;
215
+ }
216
+ else{
217
+ $fields[$field_key]['value'] = $_product->getAttributeText($field['code']);
218
+ }
219
+ break;
220
+ }
221
+ switch ($field['relateTo']) {
222
+ case 'stock':
223
+ $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
224
+ $fields[$field_key]['value'] = str_replace('{qty}', (int)$stock->getQty(), $fields[$field_key]['value']);
225
+ break;
226
+ case 'staticblock_identifier':
227
+ $fields[$field_key]['value'] = Mage::app()->getLayout()->createBlock('cms/block')->setBlockId($fields[$field_key]['value'])->toHtml();
228
+ break;
229
+ default:
230
+ break;
231
+ }
232
+ $outputFields[] = $fields[$field_key];
233
+ }
234
+ }
235
+ else if(in_array($field['type'], array('staticblock_identifier'))){
236
+ $fields[$field_key]['value'] = Mage::app()->getLayout()->createBlock('cms/block')->setBlockId($fields[$field_key]['code'])->toHtml();
237
+ $outputFields[] = $fields[$field_key];
238
+ }
239
+ else if(in_array($field['type'], array('group_attribute'))){
240
+ $groupId = Mage::getModel('eav/entity_attribute_group')->getCollection()
241
+ ->addFieldToFilter('attribute_set_id', array('eq' => $_product->getAttributeSetId()))
242
+ ->addFieldToFilter('attribute_group_name', array('eq' => $field['code']))
243
+ ->getFirstItem()->getId();
244
+
245
+ $product_attributes = array();
246
+ foreach($_product->getAttributes($groupId) as $attribute) {
247
+ $product_attributes[] = array(
248
+ 'frontend_label' => $attribute->getFrontend()->getLabel($_product),
249
+ 'store_label' => $attribute->getStoreLabel(),
250
+ 'value' => $attribute->getFrontend()->getValue($_product)
251
+ );
252
+ }
253
+ $fields[$field_key]['value'] = $product_attributes;
254
+ $outputFields[] = $fields[$field_key];
255
+ }
256
+ else if(in_array($field['type'], array('payment_method_installments'))){
257
+ $payments = Mage::getSingleton('payment/config')->getActiveMethods();
258
+ $product_price = $_product->getFinalPrice();
259
+ if($payments){
260
+ foreach ($payments as $method_code => $method) {
261
+ if($method_code == $field['code']){
262
+ switch($method_code){
263
+ case 'payuapi';
264
+ $installment_options = array();
265
+ $installment_key_pair = array(
266
+ array(
267
+ "name" => "Axess, Bonus, Maximum, Finans, World, Asya, Halkbank",
268
+ "keycode" => "V7H1993D1",
269
+ "valuecode" => "VGD8UEY31",
270
+ "is_active" => false,
271
+ "options" => array()
272
+ ),
273
+ /*
274
+ array(
275
+ "name" => "Installment - Bonus",
276
+ "keycode" => "V7H1993D2",
277
+ "valuecode" => "VGD8UEY32",
278
+ "is_active" => false,
279
+ "options" => array()
280
+ ),
281
+ array(
282
+ "name" => "Installment - Maximum",
283
+ "keycode" => "V7H1993D3",
284
+ "valuecode" => "VGD8UEY33",
285
+ "is_active" => false,
286
+ "options" => array()
287
+ ),
288
+ array(
289
+ "name" => "Installment - Finans",
290
+ "keycode" => "V7H1993D4",
291
+ "valuecode" => "VGD8UEY34",
292
+ "is_active" => false,
293
+ "options" => array()
294
+ ),
295
+ array(
296
+ "name" => "Installment - World",
297
+ "keycode" => "V7H1993D5",
298
+ "valuecode" => "VGD8UEY35",
299
+ "is_active" => false,
300
+ "options" => array()
301
+ ),
302
+ array(
303
+ "name" => "Installment - Asya",
304
+ "keycode" => "V7H1993D6",
305
+ "valuecode" => "VGD8UEY36",
306
+ "is_active" => false,
307
+ "options" => array()
308
+ ),
309
+ array(
310
+ "name" => "Installment - Halkbank",
311
+ "keycode" => "V7H1993D7",
312
+ "valuecode" => "VGD8UEY37",
313
+ "is_active" => false,
314
+ "options" => array()
315
+ )
316
+ */
317
+ );
318
+ foreach($installment_key_pair as $installment_key => $installment_pair){
319
+ if($method->getConfigData($installment_pair['keycode'])){
320
+ $installment_key_pair[$installment_key]['is_active'] = true;
321
+ $installment_key_pair[$installment_key]['options_str'] = $method->getConfigData($installment_pair['valuecode']);
322
+ $installment_key_pair[$installment_key]['options'] = $this->_processPayuapiInstallmentOptionsString($installment_key_pair[$installment_key]['options_str'], $product_price, $interest_type = 'simple', $force_yearly_interest = true);
323
+
324
+ $installment_options[] = $installment_key_pair[$installment_key];
325
+ }
326
+ }
327
+
328
+ $fields[$field_key]['value'] = $installment_options;
329
+ $outputFields[] = $fields[$field_key];
330
+ break;
331
+ default:
332
+ break;
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ catch(Exception $e){
340
+
341
+ }
342
+ }
343
+ }
344
+ if(empty($outputFields))
345
+ $outputFields = null;
346
+ //$outputFields = null;
347
+ $productInfo['customAttributes'] = $outputFields;
348
+ return $productInfo;
349
+ }
350
+
351
+ /**
352
+ * Coded by Yash
353
+ * Date: 18-12-2014
354
+ * For calculating simple and compund interest for installment options
355
+ */
356
+ public function _processPayuapiInstallmentOptionsString($str = null, $price = 0, $interest_type = 'simple', $force_yearly_interest = false){
357
+ $str = trim($str);
358
+ if(empty($str))
359
+ return null;
360
+
361
+ /**
362
+ * Formula for simple interest
363
+ * A = P(1 + rt)
364
+ * P = principal amount
365
+ * r = rate of interest
366
+ * t = time(in tems of years)
367
+ * calculating months to years
368
+ * 2 months = 2 / 12 = 0.17 years
369
+ */
370
+ $return_options = array();
371
+ $installment_options = explode(';', $str);
372
+ foreach($installment_options as $ioption){
373
+ $month_interest_pair = explode('=', $ioption);
374
+ if(count($month_interest_pair) == 2){
375
+ $month_count = $month_interest_pair[0];
376
+ $interest_rate = $month_interest_pair[1];
377
+ if($interest_type == 'simple'){
378
+ $t = 1;
379
+ if($force_yearly_interest)
380
+ $t = ceil($month_count / 12);
381
+ else
382
+ $t = round($month_count / 12, 2);
383
+
384
+ $r = $interest_rate / 100;
385
+ $total_amount = $price * (1 + ($r * $t));
386
+ $return_options[] = array(
387
+ 'month_count' => $month_count,
388
+ 'installment_amount' => round($total_amount / $month_count),
389
+ 'total_amount' => round($total_amount),
390
+ 'exact_total_amount' => round($total_amount, 2)
391
+ );
392
+ }
393
+ else if($interest_type == 'compound'){
394
+
395
+ }
396
+ }
397
+ }
398
+ return $return_options;
399
+ }
400
+ }
app/code/local/Mobicommerce/Mobiservices/Model/1x3x1/External.php ADDED
@@ -0,0 +1,2300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mobicommerce_Mobiservices_Model_1x3x1_External extends Mobicommerce_Mobiservices_Model_Abstract {
4
+
5
+ public function setApplicationSettings($data = null)
6
+ {
7
+ $this->__install102ScriptAction();
8
+ $app_code = isset($data['app_code'])?$data['app_code']:null;
9
+ $app_theme_folder_name = isset($data['app_theme_folder_name'])?$data['app_theme_folder_name']:'';
10
+ if(empty($app_code))
11
+ return false;
12
+
13
+ $this->_create_mobi_media_dir($app_code, $app_theme_folder_name);
14
+ Mage::getModel('mobiadmin/applications')->saveApplicationData($data);
15
+ }
16
+
17
+ protected function _create_mobi_media_dir($app_code = null, $app_theme_folder_name = null){
18
+ $base_dir = Mage::getBaseDir('media');
19
+ if(!(is_dir($base_dir.'/mobi_commerce') && file_exists($base_dir.'/mobi_commerce')))
20
+ mkdir($base_dir.'/mobi_commerce', 0777, true);
21
+
22
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code) && file_exists($base_dir.'/mobi_commerce/'.$app_code)))
23
+ mkdir($base_dir.'/mobi_commerce/'.$app_code, 0777, true);
24
+
25
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/home_banners') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/home_banners')))
26
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/home_banners', 0777, true);
27
+
28
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/appinfo') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/appinfo')))
29
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/appinfo', 0777, true);
30
+
31
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/certificates') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/certificates')))
32
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/certificates', 0777, true);
33
+
34
+ if(!(is_dir($base_dir.'/mobi_commerce/'.$app_code.'/personalizer') && file_exists($base_dir.'/mobi_commerce/'.$app_code.'/personalizer'))){
35
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/personalizer', 0777, true);
36
+ mkdir($base_dir.'/mobi_commerce/'.$app_code.'/personalizer/svg', 0777, true);
37
+
38
+ if(!empty($app_theme_folder_name)){
39
+ copy($base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/personalizer.xml', $base_dir . '/mobi_commerce/' . $app_code . '/personalizer/personalizer.xml');
40
+ copy($base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/personalizer.css', $base_dir . '/mobi_commerce/' . $app_code . '/personalizer/personalizer.css');
41
+ }
42
+ }
43
+
44
+ if(!empty($app_theme_folder_name)){
45
+ $dir = $base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/svg';
46
+ if(file_exists($dir)){
47
+ $scandir = scandir($dir);
48
+ foreach ($scandir as $key => $value)
49
+ {
50
+ if (!in_array($value,array(".","..")))
51
+ {
52
+ $currfile = $dir . DIRECTORY_SEPARATOR . $value;
53
+ if (!is_dir($currfile))
54
+ {
55
+ $filename = PATHINFO($value, PATHINFO_BASENAME);
56
+ if(!file_exists($base_dir . '/mobi_commerce/' . $app_code . '/personalizer/svg/' . $filename)){
57
+ copy($base_dir . '/mobi_assets/theme_files/' . $app_theme_folder_name . '/personalizer/svg/' . $filename, $base_dir . '/mobi_commerce/' . $app_code . '/personalizer/svg/' . $filename);
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ $sourcePersonalizerFolder = $base_dir.DS.'mobi_assets'.DS.'theme_files'.DS.$app_theme_folder_name.DS.'personalizer';
65
+ $destinationPersonalizerFolder = $base_dir.DS.'mobi_commerce'.DS.$app_code.DS.'personalizer';
66
+
67
+ $sourcePersonalizerXml = $sourcePersonalizerFolder.DS.'personalizer.xml';
68
+ $destinationPersonalizerXml = $destinationPersonalizerFolder.DS.'personalizer.xml';
69
+
70
+ if(file_exists ($destinationPersonalizerXml)){
71
+ $sourcePersonalizerXml = (array) simplexml_load_file($sourcePersonalizerXml);
72
+ $destinationPersonalizerXml = (array) simplexml_load_file($destinationPersonalizerXml);
73
+ $destinationPersonalizerCss = $destinationPersonalizerFolder.DS.'personalizer.css';
74
+ $cssArray = array();
75
+
76
+ $doc = new DOMDocument('1.0');
77
+ $doc->formatOutput = true;
78
+ $root = $doc->createElement('mobicommerce_personalizer');
79
+ $root = $doc->appendChild($root);
80
+
81
+ foreach($sourcePersonalizerXml as $key => $element){
82
+ $css = $element->css;
83
+ $svgFilenames = (string) $element->svg_filenames;
84
+ $defaultValue = (string) $element->default_value;
85
+ $currentValue = (string) $element->default_value;
86
+ if(isset($destinationPersonalizerXml[$key])){
87
+ $currentValue = (string) $destinationPersonalizerXml[$key]->current_value;
88
+ }
89
+ $css = implode("\r\n", explode('|', $css));
90
+ $cssArray[] = str_replace("--COLOR--", $currentValue, $css);
91
+
92
+ if(!empty($svgFilenames)){
93
+ //echo ($element->svg_filenames);exit;
94
+ $svgFilenames = explode('|', $svgFilenames);
95
+ if(!empty($svgFilenames)){
96
+ foreach($svgFilenames as $svg_filename){
97
+ if(file_exists($sourcePersonalizerFolder . DS . 'svg' . DS . $svg_filename)){
98
+ $svg_image = file_get_contents($sourcePersonalizerFolder . DS . 'svg' . DS . $svg_filename);
99
+ preg_match_all('/<style>(.*?)<\/style>/s', $svg_image, $style_tag);
100
+ $old_style_tag = $style_tag[1][0];
101
+ $property = explode('{', $style_tag[1][0]);
102
+ $property = $property[0];
103
+ preg_match_all('/{(.*?)}/s', $style_tag[1][0], $style_tag);
104
+ $param = explode(':', $style_tag[1][0]);
105
+ $param = $param[0];
106
+ $new_style_tag = $property.'{'.$param.':'.$currentValue.'!important;}';
107
+ $svg_image = str_replace($old_style_tag, $new_style_tag, $svg_image);
108
+ file_put_contents($destinationPersonalizerFolder . DS . 'svg' . DS . $svg_filename, $svg_image);
109
+ }
110
+ }
111
+ }
112
+ }
113
+
114
+ $newdoc = $root->appendChild($doc->createElement($key));
115
+ foreach($element as $optioncode => $value){
116
+ $em = $doc->createElement($optioncode);
117
+ if($optioncode == 'current_value'){
118
+ $value = $currentValue;
119
+ }
120
+ else if($optioncode == 'default_value'){
121
+ $value = $defaultValue;
122
+ }
123
+ $text = $doc->createTextNode($value);
124
+ $em->appendChild($text);
125
+ $newdoc->appendChild($em);
126
+ }
127
+ }
128
+ file_put_contents($destinationPersonalizerCss, implode($cssArray, "\r\n"));
129
+ $doc->save($destinationPersonalizerFolder.DS.'personalizer.xml');
130
+ }
131
+ }
132
+ }
133
+
134
+ protected function file_get_contents_curl($url) {
135
+ if(function_exists('file_get_contents'))
136
+ return file_get_contents($url);
137
+ else
138
+ {
139
+ $ch = curl_init();
140
+
141
+ curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
142
+ curl_setopt($ch, CURLOPT_HEADER, 0);
143
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
144
+ curl_setopt($ch, CURLOPT_URL, $url);
145
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
146
+
147
+ $data = curl_exec($ch);
148
+ curl_close($ch);
149
+
150
+ return $data;
151
+ }
152
+ }
153
+
154
+ public function __install102ScriptAction(){
155
+ try{
156
+
157
+ $resource = Mage::getSingleton('core/resource');
158
+ $conn = $resource->getConnection('core_read');
159
+
160
+ $results = $conn->query("SHOW TABLES LIKE '".Mage::getSingleton('core/resource')->getTableName('mobicommerce_category_icons')."'")->fetchAll();
161
+ if(!$results){
162
+ $conn->query("
163
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_applications')."`;
164
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_applications_settings')."`;
165
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_category_icons')."`;
166
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_devicetokens')."`;
167
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_multilanguage')."`;
168
+ DROP TABLE IF EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobi_app_widgets')."`;
169
+
170
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_applications')."` (
171
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
172
+ `app_name` varchar(255) NOT NULL DEFAULT '',
173
+ `app_code` varchar(255) DEFAULT NULL,
174
+ `app_key` varchar(255) NOT NULL DEFAULT '',
175
+ `app_logo` varchar(255) NOT NULL DEFAULT '',
176
+ `app_license_key` varchar(255) NOT NULL DEFAULT '',
177
+ `app_storeid` smallint(6) NOT NULL DEFAULT '0',
178
+ `created_time` datetime DEFAULT NULL,
179
+ `update_time` datetime DEFAULT NULL,
180
+ PRIMARY KEY (`id`)
181
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
182
+
183
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_applications_settings')."` (
184
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
185
+ `app_code` varchar(255) DEFAULT NULL,
186
+ `setting_code` varchar(255) NOT NULL DEFAULT '',
187
+ `value` longtext,
188
+ PRIMARY KEY (`id`)
189
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
190
+
191
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_category_icons')."` (
192
+ `mci_id` int(11) NOT NULL AUTO_INCREMENT,
193
+ `mci_name` varchar(100) DEFAULT NULL,
194
+ `mci_display_name` varchar(100) DEFAULT NULL,
195
+ `mci_icon_group` varchar(100) DEFAULT NULL,
196
+ `mci_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
197
+ PRIMARY KEY (`mci_id`)
198
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
199
+
200
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_devicetokens')."` (
201
+ `md_id` bigint(20) NOT NULL AUTO_INCREMENT,
202
+ `md_appcode` varchar(45) NOT NULL,
203
+ `md_devicetype` enum('android','ios') DEFAULT NULL,
204
+ `md_devicetoken` varchar(255) NOT NULL,
205
+ `md_created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
206
+ PRIMARY KEY (`md_id`)
207
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
208
+
209
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobi_app_widgets')."` (
210
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
211
+ `app_code` varchar(255) DEFAULT NULL,
212
+ `app_type` varchar(255) NOT NULL DEFAULT '',
213
+ `slider_code` varchar(255) NOT NULL DEFAULT '',
214
+ `slider_label` varchar(255) NOT NULL DEFAULT '',
215
+ `slider_status` smallint(6) DEFAULT NULL,
216
+ `slider_position` smallint(6) NOT NULL DEFAULT '0',
217
+ `slider_settings` varchar(255) NOT NULL DEFAULT '',
218
+ `slider_productIds` varchar(255) NOT NULL DEFAULT '',
219
+ `created_time` datetime DEFAULT NULL,
220
+ `update_time` datetime DEFAULT NULL,
221
+ PRIMARY KEY (`id`)
222
+ ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
223
+
224
+ CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_multilanguage')."` (
225
+ `mm_id` bigint(20) NOT NULL AUTO_INCREMENT,
226
+ `mm_language_code` varchar(20) DEFAULT NULL,
227
+ `mm_type` enum('label','message') DEFAULT NULL,
228
+ `mm_label_code` varchar(255) DEFAULT NULL,
229
+ `mm_label` varchar(255) DEFAULT NULL,
230
+ `mm_maxlength` int(11) DEFAULT NULL,
231
+ `mm_text` varchar(255) DEFAULT NULL,
232
+ `mm_help` varchar(255) DEFAULT NULL,
233
+ PRIMARY KEY (`mm_id`)
234
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
235
+
236
+ INSERT INTO `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_category_icons')."` (`mci_name`, `mci_display_name`, `mci_icon_group`) VALUES
237
+ ('baby1.svg', 'baby1', 'babies'),
238
+ ('baby105.svg', 'baby105', 'babies'),
239
+ ('baby137.svg', 'baby137', 'babies'),
240
+ ('baby23.svg', 'baby23', 'babies'),
241
+ ('baby63.svg', 'baby63', 'babies'),
242
+ ('baby67.svg', 'baby67', 'babies'),
243
+ ('baby73.svg', 'baby73', 'babies'),
244
+ ('baby77.svg', 'baby77', 'babies'),
245
+ ('bear10.svg', 'bear10', 'babies'),
246
+ ('crawling.svg', 'crawling', 'babies'),
247
+ ('feeding.svg', 'feeding', 'babies'),
248
+ ('female109.svg', 'female109', 'babies'),
249
+ ('flying1.svg', 'flying1', 'babies'),
250
+ ('medical68.svg', 'medical68', 'babies'),
251
+ ('moon19.svg', 'moon19', 'babies'),
252
+ ('mother19.svg', 'mother19', 'babies'),
253
+ ('mother20.svg', 'mother20', 'babies'),
254
+ ('pregnant.svg', 'pregnant', 'babies'),
255
+ ('security18.svg', 'security18', 'babies'),
256
+ ('sparrow.svg', 'sparrow', 'babies'),
257
+ ('book104.svg', 'book104', 'book'),
258
+ ('book122.svg', 'book122', 'book'),
259
+ ('book135.svg', 'book135', 'book'),
260
+ ('book157.svg', 'book157', 'book'),
261
+ ('book7.svg', 'book7', 'book'),
262
+ ('books30.svg', 'books30', 'book'),
263
+ ('living1.svg', 'living1', 'book'),
264
+ ('man216.svg', 'man216', 'book'),
265
+ ('online26.svg', 'online26', 'book'),
266
+ ('open161.svg', 'open161', 'book'),
267
+ ('open182.svg', 'open182', 'book'),
268
+ ('open3.svg', 'open3', 'book'),
269
+ ('talking.svg', 'talking', 'book'),
270
+ ('text87.svg', 'text87', 'book'),
271
+ ('boy17.svg', 'boy17', 'boys'),
272
+ ('boy18.svg', 'boy18', 'boys'),
273
+ ('boy31.svg', 'boy31', 'boys'),
274
+ ('boy40.svg', 'boy40', 'boys'),
275
+ ('boy43.svg', 'boy43', 'boys'),
276
+ ('boy46.svg', 'boy46', 'boys'),
277
+ ('boy52.svg', 'boy52', 'boys'),
278
+ ('child12.svg', 'child12', 'boys'),
279
+ ('male98.svg', 'male98', 'boys'),
280
+ ('man483.svg', 'man483', 'boys'),
281
+ ('audio39.svg', 'audio39', 'electronics'),
282
+ ('calculator13.svg', 'calculator13', 'electronics'),
283
+ ('camera19.svg', 'camera19', 'electronics'),
284
+ ('computer94.svg', 'computer94', 'electronics'),
285
+ ('dvd5.svg', 'dvd5', 'electronics'),
286
+ ('electric43.svg', 'electric43', 'electronics'),
287
+ ('electronic55.svg', 'electronic55', 'electronics'),
288
+ ('encyclopedia.svg', 'encyclopedia', 'electronics'),
289
+ ('games3.svg', 'games3', 'electronics'),
290
+ ('games37.svg', 'games37', 'electronics'),
291
+ ('games4.svg', 'games4', 'electronics'),
292
+ ('games6.svg', 'games6', 'electronics'),
293
+ ('headphones.svg', 'headphones', 'electronics'),
294
+ ('home115.svg', 'home115', 'electronics'),
295
+ ('keyboard10.svg', 'keyboard10', 'electronics'),
296
+ ('kitchen48.svg', 'kitchen48', 'electronics'),
297
+ ('kitchen51.svg', 'kitchen51', 'electronics'),
298
+ ('lamp15.svg', 'lamp15', 'electronics'),
299
+ ('laptop1.svg', 'laptop1', 'electronics'),
300
+ ('laptop12.svg', 'laptop12', 'electronics'),
301
+ ('memory.svg', 'memory', 'electronics'),
302
+ ('microwave3.svg', 'microwave3', 'electronics'),
303
+ ('midi.svg', 'midi', 'electronics'),
304
+ ('mixer8.svg', 'mixer8', 'electronics'),
305
+ ('mobile14.svg', 'mobile14', 'electronics'),
306
+ ('mobile15.svg', 'mobile15', 'electronics'),
307
+ ('mobile20.svg', 'mobile20', 'electronics'),
308
+ ('mobile26.svg', 'mobile26', 'electronics'),
309
+ ('mouse10.svg', 'mouse10', 'electronics'),
310
+ ('on.svg', 'on', 'electronics'),
311
+ ('pc.svg', 'pc', 'electronics'),
312
+ ('pc6.svg', 'pc6', 'electronics'),
313
+ ('photo33.svg', 'photo33', 'electronics'),
314
+ ('print5.svg', 'print5', 'electronics'),
315
+ ('printer70.svg', 'printer70', 'electronics'),
316
+ ('shopping30.svg', 'shopping30', 'electronics'),
317
+ ('smartphone13.svg', 'smartphone13', 'electronics'),
318
+ ('telephone79.svg', 'telephone79', 'electronics'),
319
+ ('tool6.svg', 'tool6', 'electronics'),
320
+ ('usb24.svg', 'usb24', 'electronics'),
321
+ ('vacuum6.svg', 'vacuum6', 'electronics'),
322
+ ('washing11.svg', 'washing11', 'electronics'),
323
+ ('wireless30.svg', 'wireless30', 'electronics'),
324
+ ('workplace.svg', 'workplace', 'electronics'),
325
+ ('ankle3.svg', 'ankle3', 'fashion'),
326
+ ('apron.svg', 'apron', 'fashion'),
327
+ ('baseball1.svg', 'baseball1', 'fashion'),
328
+ ('baseball24.svg', 'baseball24', 'fashion'),
329
+ ('beret.svg', 'beret', 'fashion'),
330
+ ('bikini4.svg', 'bikini4', 'fashion'),
331
+ ('black170.svg', 'black170', 'fashion'),
332
+ ('black276.svg', 'black276', 'fashion'),
333
+ ('black280.svg', 'black280', 'fashion'),
334
+ ('boot2.svg', 'boot2', 'fashion'),
335
+ ('bow2.svg', 'bow2', 'fashion'),
336
+ ('bow3.svg', 'bow3', 'fashion'),
337
+ ('cat10.svg', 'cat10', 'fashion'),
338
+ ('childish.svg', 'childish', 'fashion'),
339
+ ('christmas266.svg', 'christmas266', 'fashion'),
340
+ ('coin9.svg', 'coin9', 'fashion'),
341
+ ('diamond10.svg', 'diamond10', 'fashion'),
342
+ ('diamond12.svg', 'diamond12', 'fashion'),
343
+ ('diamond13.svg', 'diamond13', 'fashion'),
344
+ ('diamond22.svg', 'diamond22', 'fashion'),
345
+ ('diamond27.svg', 'diamond27', 'fashion'),
346
+ ('diamond3.svg', 'diamond3', 'fashion'),
347
+ ('dress2.svg', 'dress2', 'fashion'),
348
+ ('dress6.svg', 'dress6', 'fashion'),
349
+ ('dress9.svg', 'dress9', 'fashion'),
350
+ ('excentric.svg', 'excentric', 'fashion'),
351
+ ('fairy1.svg', 'fairy1', 'fashion'),
352
+ ('female145.svg', 'female145', 'fashion'),
353
+ ('female209.svg', 'female209', 'fashion'),
354
+ ('female90.svg', 'female90', 'fashion'),
355
+ ('female94.svg', 'female94', 'fashion'),
356
+ ('flip.svg', 'flip', 'fashion'),
357
+ ('flip5.svg', 'flip5', 'fashion'),
358
+ ('glove8.svg', 'glove8', 'fashion'),
359
+ ('handbag7.svg', 'handbag7', 'fashion'),
360
+ ('hanger22.svg', 'hanger22', 'fashion'),
361
+ ('hat19.svg', 'hat19', 'fashion'),
362
+ ('high12.svg', 'high12', 'fashion'),
363
+ ('jacket2.svg', 'jacket2', 'fashion'),
364
+ ('lipstick1.svg', 'lipstick1', 'fashion'),
365
+ ('make.svg', 'make', 'fashion'),
366
+ ('mannequin.svg', 'mannequin', 'fashion'),
367
+ ('mascara.svg', 'mascara', 'fashion'),
368
+ ('mascara1.svg', 'mascara1', 'fashion'),
369
+ ('necktie1.svg', 'necktie1', 'fashion'),
370
+ ('perfume1.svg', 'perfume1', 'fashion'),
371
+ ('portfolio3.svg', 'portfolio3', 'fashion'),
372
+ ('rectangular27.svg', 'rectangular27', 'fashion'),
373
+ ('ribbon10.svg', 'ribbon10', 'fashion'),
374
+ ('ring5.svg', 'ring5', 'fashion'),
375
+ ('rounded62.svg', 'rounded62', 'fashion'),
376
+ ('rubber4.svg', 'rubber4', 'fashion'),
377
+ ('rubber5.svg', 'rubber5', 'fashion'),
378
+ ('safety8.svg', 'safety8', 'fashion'),
379
+ ('sandals2.svg', 'sandals2', 'fashion'),
380
+ ('sewing1.svg', 'sewing1', 'fashion'),
381
+ ('shoulder1.svg', 'shoulder1', 'fashion'),
382
+ ('simple29.svg', 'simple29', 'fashion'),
383
+ ('skirt.svg', 'skirt', 'fashion'),
384
+ ('skirt1.svg', 'skirt1', 'fashion'),
385
+ ('slip.svg', 'slip', 'fashion'),
386
+ ('sneaker.svg', 'sneaker', 'fashion'),
387
+ ('strap.svg', 'strap', 'fashion'),
388
+ ('strapless.svg', 'strapless', 'fashion'),
389
+ ('strapped1.svg', 'strapped1', 'fashion'),
390
+ ('stylish12.svg', 'stylish12', 'fashion'),
391
+ ('stylish2.svg', 'stylish2', 'fashion'),
392
+ ('stylish5.svg', 'stylish5', 'fashion'),
393
+ ('sun.svg', 'sun', 'fashion'),
394
+ ('t-shirt1.svg', 't-shirt1', 'fashion'),
395
+ ('tie.svg', 'tie', 'fashion'),
396
+ ('tie2.svg', 'tie2', 'fashion'),
397
+ ('tie5.svg', 'tie5', 'fashion'),
398
+ ('tshirt18.svg', 'tshirt18', 'fashion'),
399
+ ('girl19.svg', 'girl19', 'girls'),
400
+ ('girl37.svg', 'girl37', 'girls'),
401
+ ('girl39.svg', 'girl39', 'girls'),
402
+ ('girl40.svg', 'girl40', 'girls'),
403
+ ('girl42.svg', 'girl42', 'girls'),
404
+ ('princess.svg', 'princess', 'girls'),
405
+ ('woman132.svg', 'woman132', 'girls'),
406
+ ('woman133.svg', 'woman133', 'girls'),
407
+ ('woman136.svg', 'woman136', 'girls'),
408
+ ('woman3.svg', 'woman3', 'girls'),
409
+ ('chef15.svg', 'chef15', 'kitchen'),
410
+ ('chef18.svg', 'chef18', 'kitchen'),
411
+ ('chef21.svg', 'chef21', 'kitchen'),
412
+ ('coffee10.svg', 'coffee10', 'kitchen'),
413
+ ('cooking15.svg', 'cooking15', 'kitchen'),
414
+ ('covered16.svg', 'covered16', 'kitchen'),
415
+ ('cutlery6.svg', 'cutlery6', 'kitchen'),
416
+ ('fork.svg', 'fork', 'kitchen'),
417
+ ('fork27.svg', 'fork27', 'kitchen'),
418
+ ('fork28.svg', 'fork28', 'kitchen'),
419
+ ('glass35.svg', 'glass35', 'kitchen'),
420
+ ('glass40.svg', 'glass40', 'kitchen'),
421
+ ('hot55.svg', 'hot55', 'kitchen'),
422
+ ('hot56.svg', 'hot56', 'kitchen'),
423
+ ('ice52.svg', 'ice52', 'kitchen'),
424
+ ('kitchen26.svg', 'kitchen26', 'kitchen'),
425
+ ('restaurant26.svg', 'restaurant26', 'kitchen'),
426
+ ('restaurant29.svg', 'restaurant29', 'kitchen'),
427
+ ('serving.svg', 'serving', 'kitchen'),
428
+ ('thigh.svg', 'thigh', 'kitchen'),
429
+ ('magento_icon.svg', 'magento_icon', 'magento'),
430
+ ('acoustic2.svg', 'acoustic2', 'music'),
431
+ ('acoustic3.svg', 'acoustic3', 'music'),
432
+ ('acoustic4.svg', 'acoustic4', 'music'),
433
+ ('alto.svg', 'alto', 'music'),
434
+ ('audio49.svg', 'audio49', 'music'),
435
+ ('circular263.svg', 'circular263', 'music'),
436
+ ('dancer5.svg', 'dancer5', 'music'),
437
+ ('drummer.svg', 'drummer', 'music'),
438
+ ('eighth4.svg', 'eighth4', 'music'),
439
+ ('man282.svg', 'man282', 'music'),
440
+ ('microphone52.svg', 'microphone52', 'music'),
441
+ ('music170.svg', 'music170', 'music'),
442
+ ('music200.svg', 'music200', 'music'),
443
+ ('musical.svg', 'musical', 'music'),
444
+ ('musical7.svg', 'musical7', 'music'),
445
+ ('notifications.svg', 'notifications', 'music'),
446
+ ('play43.svg', 'play43', 'music'),
447
+ ('radio42.svg', 'radio42', 'music'),
448
+ ('treble1.svg', 'treble1', 'music'),
449
+ ('turn20.svg', 'turn20', 'music'),
450
+ ('americanfootball1.svg', 'americanfootball1', 'sports'),
451
+ ('barbell.svg', 'barbell', 'sports'),
452
+ ('biceps.svg', 'biceps', 'sports'),
453
+ ('first33.svg', 'first33', 'sports'),
454
+ ('fishing11.svg', 'fishing11', 'sports'),
455
+ ('man271.svg', 'man271', 'sports'),
456
+ ('man459.svg', 'man459', 'sports'),
457
+ ('objective.svg', 'objective', 'sports'),
458
+ ('ping3.svg', 'ping3', 'sports'),
459
+ ('recognition6.svg', 'recognition6', 'sports'),
460
+ ('regular2.svg', 'regular2', 'sports'),
461
+ ('runer.svg', 'runer', 'sports'),
462
+ ('runner5.svg', 'runner5', 'sports'),
463
+ ('silhouette66.svg', 'silhouette66', 'sports'),
464
+ ('soccer38.svg', 'soccer38', 'sports'),
465
+ ('soccer43.svg', 'soccer43', 'sports'),
466
+ ('soccer44.svg', 'soccer44', 'sports'),
467
+ ('tennis18.svg', 'tennis18', 'sports'),
468
+ ('trophy71.svg', 'trophy71', 'sports'),
469
+ ('volleyball4.svg', 'volleyball4', 'sports'),
470
+ ('air6.svg', 'air6', 'travel'),
471
+ ('airplane67.svg', 'airplane67', 'travel'),
472
+ ('airplane68.svg', 'airplane68', 'travel'),
473
+ ('black186.svg', 'black186', 'travel'),
474
+ ('black187.svg', 'black187', 'travel'),
475
+ ('black401.svg', 'black401', 'travel'),
476
+ ('car80.svg', 'car80', 'travel'),
477
+ ('car95.svg', 'car95', 'travel'),
478
+ ('location38.svg', 'location38', 'travel'),
479
+ ('luggage5.svg', 'luggage5', 'travel'),
480
+ ('map30.svg', 'map30', 'travel'),
481
+ ('ocean3.svg', 'ocean3', 'travel'),
482
+ ('person209.svg', 'person209', 'travel'),
483
+ ('photo147.svg', 'photo147', 'travel'),
484
+ ('scooter7.svg', 'scooter7', 'travel'),
485
+ ('sea8.svg', 'sea8', 'travel'),
486
+ ('sedan3.svg', 'sedan3', 'travel'),
487
+ ('suv.svg', 'suv', 'travel'),
488
+ ('taxi1.svg', 'taxi1', 'travel'),
489
+ ('train20.svg', 'train20', 'travel');
490
+
491
+ INSERT INTO `".Mage::getSingleton('core/resource')->getTableName('mobicommerce_multilanguage')."` (`mm_language_code`, `mm_type`, `mm_label_code`, `mm_label`, `mm_maxlength`, `mm_text`, `mm_help`) VALUES
492
+ ('en_US', 'message', 'Please_wait', 'Please wait', '100', 'Please wait', 'Error: When user trigger new action while previous one is still processsing.'),
493
+ ('en_US', 'label', 'or', 'or', '25', 'or', 'Label: Display to show 2 action options.'),
494
+ ('en_US', 'label', 'Home', 'Home', '8', 'Home', 'Label: Home page title and button title.'),
495
+ ('en_US', 'message', 'No_internet_connection', 'No internet connection', '100', 'No internet connection', 'Message:No internet connection'),
496
+ ('en_US', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Shopping Category', 'Label: Shopping Category'),
497
+ ('en_US', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', 'Oops! There are no categories to display.', 'Text: When no category found.'),
498
+ ('en_US', 'label', 'Shop_by_category', 'Shop by category', '25', 'Shop by category', 'Label: Title to show above category names.'),
499
+ ('en_US', 'label', 'Categories', 'Categories', '20', 'Categories', 'Label: Title to show on homepage, above the category.'),
500
+ ('en_US', 'label', 'All_Products', 'All Products', '20', 'All Products', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
501
+ ('en_US', 'label', 'Profile', 'Profile', '10', 'Profile', 'Label: Profile page title and button title.'),
502
+ ('en_US', 'label', 'List_Page', 'List Page', '15', 'List Page', 'Label: Page title'),
503
+ ('en_US', 'label', 'Product_List', 'Product List', '15', 'Product List', 'Label: Product List page title '),
504
+ ('en_US', 'label', 'products_found', 'products found', '20', 'products found', 'Label: Label displayed on product listing page to show No. of products found. '),
505
+ ('en_US', 'label', 'Product_Detail', 'Product Detail', '15', 'Product Detail', 'Label: Product Detail page title'),
506
+ ('en_US', 'label', 'Details', 'Details', '10', 'Details', 'Label: Label displayed above the product detail on product detail page.'),
507
+ ('en_US', 'label', 'Buy_Now', 'Buy Now', '10', 'Buy Now', 'Label: Buy Now button title.'),
508
+ ('en_US', 'label', 'Choose_an_option', 'Choose an option', '20', 'Choose an option', 'Label: First option for product options.'),
509
+ ('en_US', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'Item added successfully', 'Message: When the Item added successfully into the cart. '),
510
+ ('en_US', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'No products found.', 'Text: When no products found for selected search criteria or category.'),
511
+ ('en_US', 'label', 'Load_More', 'Load More', '10', 'Load More', 'Label: Load More button title, displayed on product listing pages.'),
512
+ ('en_US', 'label', 'Viewers', 'Viewers', '10', 'Viewers', 'Label: Viewers Label.'),
513
+ ('en_US', 'label', 'Add_to_cart', 'Add to cart', '15', 'Add to cart', 'Label: Add to cart button title.'),
514
+ ('en_US', 'label', 'Downloadable_link', 'Downloadable link', '20', 'Downloadable link', 'Label: Downloadable link title. '),
515
+ ('en_US', 'label', 'Review', 'Review', '10', 'Review', 'Label: Review text and button title.'),
516
+ ('en_US', 'message', 'No_reviews_found', 'No reviews found', '100', 'No reviews found', 'Text: When no reviews found for selected product.'),
517
+ ('en_US', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'Shopping Cart', 'Label: Shopping Cart button title.'),
518
+ ('en_US', 'label', 'QTY', 'QTY', '5', 'QTY', 'Label: Label for product Quantity.'),
519
+ ('en_US', 'label', 'TOTAL', 'TOTAL', '15', 'TOTAL', 'Label: Label for cart &amp; order total. '),
520
+ ('en_US', 'label', 'Subtotal', 'Subtotal', '15', 'Subtotal', 'Label: Label for cart &amp; order subtotal.'),
521
+ ('en_US', 'label', 'Tax', 'Tax', '5', 'Tax', 'Label: Label for cart &amp; order Tax.'),
522
+ ('en_US', 'label', 'Discount', 'Discount', '15', 'Discount', 'Label: Label for cart &amp; order discount. '),
523
+ ('en_US', 'label', 'Grand_Total', 'Grand Total', '15', 'Grand Total', 'Label: Label for cart &amp; order grand total.'),
524
+ ('en_US', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'The shopping cart is empty.', 'Error: When the shopping cart is empty.'),
525
+ ('en_US', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Cart updated successfully', 'Message: When the cart updated successfully.'),
526
+ ('en_US', 'label', 'Update_Cart', 'Update Cart', '15', 'Update Cart', 'Label: Update Cart button title. '),
527
+ ('en_US', 'label', 'Checkout', 'Checkout', '10', 'Checkout', 'Label: Checkout button title.'),
528
+ ('en_US', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'Cart is empty', 'Text: When the cart is empty. '),
529
+ ('en_US', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'One of your cart item is having problem', 'Text: When one of the cart item is having error such as not available or so.'),
530
+ ('en_US', 'label', 'Login', 'Login', '7', 'Login', 'Label: Login button title.'),
531
+ ('en_US', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'Enter your username password to get access.', 'Error: When requested action required login.'),
532
+ ('en_US', 'label', 'Username', 'Username', '20', 'Username', 'Label: Label for Username field.'),
533
+ ('en_US', 'label', 'Password', 'Password', '20', 'Password', 'Label: Label for password field.'),
534
+ ('en_US', 'label', 'Sign_Up', 'Sign Up', '10', 'Sign Up', 'Label: Sign Up button title.'),
535
+ ('en_US', 'message', 'Enter_username', 'Enter username', '100', 'Enter username', 'Error: When username is empty.'),
536
+ ('en_US', 'message', 'Enter_password', 'Enter password', '100', 'Enter password', 'Error: When password is empty. '),
537
+ ('en_US', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Invalid username or password', 'Error: When Invalid username or password entered.'),
538
+ ('en_US', 'label', 'First_name', 'First name', '20', 'First name', 'Label: Label for firstname field.'),
539
+ ('en_US', 'label', 'Last_name', 'Last name', '20', 'Last name', 'Label: Label for lastname field.'),
540
+ ('en_US', 'label', 'Your_Email', 'Your Email', '20', 'Your Email', 'Label: Label for email address field.'),
541
+ ('en_US', 'label', 'Submit', 'Submit', '10', 'Submit', 'Label: Submit button title.'),
542
+ ('en_US', 'label', 'Signup_Form', 'Signup Form', '15', 'Signup Form', 'Label: Signup Form page title.'),
543
+ ('en_US', 'label', 'Signup', 'Signup', '10', 'Signup', 'Label: Signup button title.'),
544
+ ('en_US', 'message', 'Enter_firstname', 'Enter firstname', '100', 'Enter firstname', 'Error: When firstname is empty. '),
545
+ ('en_US', 'message', 'Enter_lastname', 'Enter lastname', '100', 'Enter lastname', 'Error: When lastname is empty.'),
546
+ ('en_US', 'message', 'Enter_email', 'Enter email', '100', 'Enter email address', 'Error: When email address is empty.'),
547
+ ('en_US', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Please enter valid email address', 'Error: When email address is invalid.'),
548
+ ('en_US', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', 'Congratulation! You are successfully registered ', 'Message: When successfully registration has been done. '),
549
+ ('en_US', 'message', 'Please_check_your_email', 'Please check your email', '100', 'Please check your email', 'Message: When user reset their password. '),
550
+ ('en_US', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Forgot Password', 'Label: Forgot Password button title.'),
551
+ ('en_US', 'label', 'Shipping', 'Shipping', '20', 'Shipping', 'Label: Label for Shipping. '),
552
+ ('en_US', 'label', 'Billing', 'Billing', '20', 'Billing', 'Label: Label for Billing'),
553
+ ('en_US', 'label', 'Address', 'Address', '20', 'Address', 'Label: Label for address field, available on payment page. '),
554
+ ('en_US', 'label', 'Payment', 'Payment', '20', 'Payment', 'Label: Label for payment field, available on payment page.'),
555
+ ('en_US', 'label', 'Continue', 'Continue', '20', 'Continue', 'Label: Continue button title. '),
556
+ ('en_US', 'label', 'Billing_Address', 'Billing Address', '20', 'Billing Address', 'Label: Label for Billing Address.'),
557
+ ('en_US', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Select a billing address from your address book or enter a new address.', 'Label: Title available on billing addresses drop down.'),
558
+ ('en_US', 'label', 'New_Address', 'New Address', '20', 'New Address', 'Label: Title for New Billing Address form.'),
559
+ ('en_US', 'label', 'Company', 'Company', '20', 'Company', 'Label: Label for company field, available on address page. '),
560
+ ('en_US', 'label', 'City', 'City', '20', 'City', 'Label: Label for city field, available on address page. '),
561
+ ('en_US', 'label', 'State', 'State', '20', 'State', 'Label: Label for state field, available on address page. '),
562
+ ('en_US', 'label', 'Country', 'Country', '20', 'Country', 'Label: Label for country field, available on address page. '),
563
+ ('en_US', 'label', 'select', 'select', '20', 'select', 'Label: Label for drop downs. '),
564
+ ('en_US', 'label', 'Billing_street', 'Billing street', '20', 'Billing street', 'Label: Label for billing street field, available on address page. '),
565
+ ('en_US', 'label', 'Postcode', 'Postcode', '20', 'Postcode', 'Label: Label for postcode field, available on address page. '),
566
+ ('en_US', 'label', 'Telephone', 'Telephone', '20', 'Telephone', 'Label: Label for telephone field, available on address page. '),
567
+ ('en_US', 'label', 'Same_as_billing', 'Same as billing', '25', 'Same as billing', 'Label: Label for Same as billing option. '),
568
+ ('en_US', 'label', 'Shipping_Address', 'Shipping Address', '25', 'Shipping Address', 'Label: Title for Shipping Address form.'),
569
+ ('en_US', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Select a shipping address from your address book or enter a new address.', 'Label: Title available on shipping addresses drop down.'),
570
+ ('en_US', 'label', 'Shipping_street', 'Shipping street', '25', 'Shipping street', 'Label: Label for shipping street field, available on address page. '),
571
+ ('en_US', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Enter billing firstname', 'Error: When billing firstname is empty.'),
572
+ ('en_US', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Enter billing lastname', 'Error: When billing lastname is empty.'),
573
+ ('en_US', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Enter billing city', 'Error: When billing city is empty.'),
574
+ ('en_US', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Enter billing state', 'Error: When billing state is empty.'),
575
+ ('en_US', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Enter billing country', 'Error: When billing country is empty.'),
576
+ ('en_US', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Enter billing street', 'Error: When billing street is empty.'),
577
+ ('en_US', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Enter billing postcode', 'Error: When billing postcode is empty.'),
578
+ ('en_US', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Enter billing telephone', 'Error: When billing telephone is empty.'),
579
+ ('en_US', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'Enter shipping firstname', 'Error: When shipping firstname is empty.'),
580
+ ('en_US', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Enter shipping lastname', 'Error: When shipping lastname is empty.'),
581
+ ('en_US', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Enter shipping city', 'Error: When shipping city is empty.'),
582
+ ('en_US', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Enter shipping state', 'Error: When shipping state is empty.'),
583
+ ('en_US', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Enter shipping country', 'Error: When shipping country is empty.'),
584
+ ('en_US', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Enter shipping street', 'Error: When shipping street is empty.'),
585
+ ('en_US', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Enter shipping postcode', 'Error: When shipping postcode is empty.'),
586
+ ('en_US', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Enter shipping telephone', 'Error: When shipping telephone is empty.'),
587
+ ('en_US', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Shipping Method', 'Label: Shipping Method page title. '),
588
+ ('en_US', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Select shipping method', 'Label: Label for Select shipping method options.'),
589
+ ('en_US', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Select shipment method', 'Error: When shipment method is not selected.'),
590
+ ('en_US', 'label', 'Payment_Method', 'Payment Method', '25', 'Payment Method', 'Label: Payment Method page title. '),
591
+ ('en_US', 'label', 'Select_payment_method', 'Select payment method', '25', 'Select payment method', 'Label: Label for Select payment method options.'),
592
+ ('en_US', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Select payment method', 'Error: When payment method is not selected.'),
593
+ ('en_US', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Oops, something wrong happened', 'Error: When magento return unexpected error.'),
594
+ ('en_US', 'label', 'Credit_Card', 'Credit Card', '25', 'Credit Card', 'Label: Label for credit card field, available on payment page. '),
595
+ ('en_US', 'label', 'Name_on_card', 'Name on card', '25', 'Name on card', 'Label: Label for name of card field, available on payment page. '),
596
+ ('en_US', 'label', 'Credit_card_type', 'Credit card type', '25', 'Credit card type', 'Label: Label for CC type field, available on payment page. '),
597
+ ('en_US', 'label', 'Credit_card_number', 'Credit card number', '25', 'Credit card number', 'Label: Label for CC number field, available on payment page. '),
598
+ ('en_US', 'label', 'Expiration_Date', 'Expiration Date', '25', 'Expiration Date', 'Label: Label for CC expiry date field, available on payment page. '),
599
+ ('en_US', 'label', 'Month', 'Month', '25', 'Month', 'Label: Label for CC expiry month field, available on payment page. '),
600
+ ('en_US', 'label', 'Year', 'Year', '25', 'Year', 'Label: Label for CC expiry year field, available on payment page. '),
601
+ ('en_US', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Card Verification Number', 'Label: Label for CC verification number field, available on payment page. '),
602
+ ('en_US', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Enter name on card', 'Error: When name on card is empty.'),
603
+ ('en_US', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Select credit card type', 'Error: When credit card type is not selected.'),
604
+ ('en_US', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Enter credit card number', 'Error: When credit card number is empty.'),
605
+ ('en_US', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Set expiry month', 'Error: When expiry month is empty.'),
606
+ ('en_US', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Set expiry year', 'Error: When expiry year is empty.'),
607
+ ('en_US', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Set card verification number', 'Error: When card verification number is empty.'),
608
+ ('en_US', 'label', 'Order_Review', 'Order Review', '15', 'Order Review', 'Label: Order Review page title. '),
609
+ ('en_US', 'label', 'Agreements', 'Agreements', '25', 'Agreements', 'Label: Label for Agreements, available on oprder review screen.'),
610
+ ('en_US', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Accept terms and condition', 'Error: When user did not agreed on sign up terms.'),
611
+ ('en_US', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Shipping &amp; Handling', 'Label: Label for Shipping &amp; Handling.'),
612
+ ('en_US', 'label', 'Place_Order', 'Place Order', '25', 'Place Order', 'Label: Place Order button title.'),
613
+ ('en_US', 'label', 'Order_Success', 'Order Success', '15', 'Order Success', 'Label: Order Success page title. '),
614
+ ('en_US', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Thank you for your purchase!', 'Message: When order successfully placed. '),
615
+ ('en_US', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'You will receive an order confirmation email with details of your order and a link to track its progress.', 'Text: When order successfully placed '),
616
+ ('en_US', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'Continue Shopping', 'LabeL: Continue Shopping button title. '),
617
+ ('en_US', 'label', 'Error', 'Error', '15', 'Error', 'Label: Error '),
618
+ ('en_US', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'Item successfully added into wishlist', 'Message: When item added into Wishlist.'),
619
+ ('en_US', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Item removed from wishlist', 'Message: When Item removed from wishlist.'),
620
+ ('en_US', 'label', 'Wishlist', 'Wishlist', '15', 'Wishlist', 'Label: Wishlist page title. '),
621
+ ('en_US', 'label', 'Remove', 'Remove', '10', 'Remove', 'Label: Remove button title.'),
622
+ ('en_US', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'No wishlist items found', 'Text: When No wishlist items found.'),
623
+ ('en_US', 'label', 'Orders', 'Orders', '15', 'Orders', 'Label: Orders history page title.'),
624
+ ('en_US', 'label', 'Order_History', 'Order History', '20', 'Order History', 'Label: Order History button title. '),
625
+ ('en_US', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'No orders found', 'Text: When no order history found. '),
626
+ ('en_US', 'label', 'Order_Detail', 'Order Detail', '15', 'Order Detail', 'Label: Order Detail page title. '),
627
+ ('en_US', 'label', 'Ordered_Items', 'Ordered Items', '25', 'Ordered Items', 'Label: Ordered Items block heading or title. '),
628
+ ('en_US', 'label', 'Order_Number', 'Order Number', '20', 'Order Number', 'Label: Label for Order Number.'),
629
+ ('en_US', 'label', 'Order_Date', 'Order Date', '20', 'Order Date', 'Label: Label for Order Date.'),
630
+ ('en_US', 'label', 'User', 'User', '10', 'User', 'Label: Label for User.'),
631
+ ('en_US', 'label', 'Info', 'Info', '15', 'About', 'Label: About page title (CMS/about module)'),
632
+ ('en_US', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'Add To Wishlist', 'Label: Add To Wishlist button title.'),
633
+ ('en_US', 'label', 'Logout', 'Logout', '10', 'Logout', 'Label: Logout button title.'),
634
+ ('en_US', 'label', 'Search_Product', 'Search Product', '50', 'Search Product', 'Label: Search Product.'),
635
+ ('en_US', 'label', 'Apply', 'Apply', '8', 'Apply', 'Label: Apply button title (to apply discount)'),
636
+ ('en_US', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Coupon code applied Successfully', 'Message: When coupon code is applied.'),
637
+ ('en_US', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Coupon code removed Successfully', 'Message: When coupon code is removed. '),
638
+ ('en_US', 'label', 'Discount_Code', 'Discount Code', '25', 'Discount Code', 'Label: Label for Discount Code.'),
639
+ ('en_US', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'Update Wishlist', 'Label: Update Wishlist button title.'),
640
+ ('en_US', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'Item updated successfully', 'Message: When wishlist updated successfully.'),
641
+ ('en_US', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Cant Load Wishlist Item', 'Error: When requested wishlist item Can not Load. '),
642
+ ('en_US', 'message', 'Please_Select', 'Please select ', '25', 'Please select', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
643
+ ('en_US', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'Product Downloadable Links', 'Label: Label for Product Downloadable Links.'),
644
+ ('en_US', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Invalid coupon code', 'Error: When coupon code is invalid.'),
645
+ ('en_US', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Please login to continue', 'Error: When action required login '),
646
+ ('en_US', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'Enter firstname', 'Error: When firstname is empty in signup form. '),
647
+ ('en_US', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'Enter lastname', 'Error: When lastname is empty in signup form. '),
648
+ ('en_US', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'Enter email address', 'Error: When email address is empty in signup form. '),
649
+ ('en_US', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'Enter password', 'Error: When password is empty in signup form. '),
650
+ ('en_US', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Account already exists', 'Error: When email address already exists.'),
651
+ ('en_US', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'Can\'t save customer address', 'Error: When error occure while saving customer Address.'),
652
+ ('en_US', 'message', 'No_Data_Found', 'No Data Found', '100', 'No data found', 'Error: When no data found for requested page.'),
653
+ ('en_US', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Product no longer available', 'Error: When requested product is no londer available.'),
654
+ ('en_US', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'Requested item not found', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
655
+ ('en_US', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'Requested item not found', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
656
+ ('en_US', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Opps! Item can\'t load', 'Error: When wishlist can\'t load because of unexpected error.'),
657
+ ('en_US', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'Requested item not found', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
658
+ ('en_US', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'Requested item not found', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
659
+ ('en_US', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'Requested item not found', 'Error: When system can not load wishlist Item.'),
660
+ ('en_US', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Requested item no longer available', 'Error: When requested product is no longer available.'),
661
+ ('en_US', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'Item has been deleted from cart', 'Error: When Item has been deleted from cart.'),
662
+ ('en_US', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'Not all products are available in the requested auantity', 'Error: When any of the product from cart is no longer available.'),
663
+ ('en_US', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'Accept all terms and conditions before placing the order', 'Error: When user did not agree on all required addreement while placing order.'),
664
+ ('en_US', 'label', 'Filter', 'Filter', '10', 'Filter', 'Label: Label for Filters.'),
665
+ ('en_US', 'label', 'Reset_Filter', 'Reset Filter', '15', 'Reset Filter', 'Label: Reset Filter link title.'),
666
+ ('en_US', 'label', 'Reset', 'Reset', '10', 'Reset', 'Label: Reset button title.'),
667
+ ('en_US', 'label', 'Popularity', 'Popularity', '25', 'Popularity', 'Label: Label for filter: Popularity option. '),
668
+ ('en_US', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', 'Price: High To Low', 'Label: Label for filter: Price-High To Low option. '),
669
+ ('en_US', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', 'Price: Low To High', 'Label: Label for filter: Price-Low To High option.'),
670
+ ('en_US', 'label', 'Rating', 'Rating', '25', 'Rating', 'Label: Label for filter: Rating option '),
671
+ ('en_US', 'label', 'Name-A_To_Z', 'Name-A To Z', '25', 'Name: A To Z', 'Label: Label for filter: Name-A To Z option.'),
672
+ ('en_US', 'label', 'Name-Z_To_A', 'Name-Z To A', '25', 'Name: Z To A', 'Label: Label for filter: Name-Z To A option.'),
673
+ ('en_US', 'label', 'Newest', 'Newest', '25', 'Newest', 'Label: Label for filter: Newest option.'),
674
+ ('en_US', 'label', 'Submit_Review', 'Submit Review', '25', 'Submit Review', 'Label: Submit Review button title.'),
675
+ ('en_US', 'label', 'User_Reviews', 'User Reviews', '25', 'User Reviews', 'Label: User Reviews page title. '),
676
+ ('en_US', 'label', 'No_Reviews_Found', 'No Reviews Found', '25', 'No Reviews Found', 'Label: Text as No Reviews Found'),
677
+ ('en_US', 'label', 'Average_User_Rating', 'Average User Rating', '25', 'Average User Rating', 'Label: Label for Average User Rating.'),
678
+ ('en_US', 'label', 'Reviews', 'Reviews', '25', 'Reviews', 'Label: Label for Reviews.'),
679
+ ('en_US', 'label', 'Nickename', 'Nickename', '25', 'Nickename', 'Label: Label for Nickename field, available on submit review form.'),
680
+ ('en_US', 'label', 'Summary_Of_Your_Review', 'Summary Of Your Review', '25', 'Summary Of Your Review', 'Label: Label for review summary field, available on submit review form.'),
681
+ ('en_US', 'label', 'Comments', 'Comments', '25', 'Comments', 'Label: Label for comments field, available on submit review form.'),
682
+ ('en_US', 'label', 'You_May_Also_Like', 'You May Also Like', '25', 'You May Also Like', 'Label: Label for related product slider on product detail page.'),
683
+ ('en_US', 'message', 'Please_Select_One_Of_Each_Of_The_Ratings', 'Please Select One Of Each Of The Ratings', '100', 'Select one of each of the ratings', 'Error: When feedback ratings is not selected for the product.'),
684
+ ('en_US', 'message', 'Please_Enter_Nickename', 'Please Enter Nickename', '100', 'Enter your nickename', 'Error: When feedback nickename is empty.'),
685
+ ('en_US', 'message', 'Please_Enter_Summary', 'Please Enter Summary', '100', 'Enter overall feedback', 'Error: When feedback summary is empty.'),
686
+ ('en_US', 'message', 'Please_Enter_Comments', 'Please Enter Comments', '100', 'Enter your comments', 'Error: When feedback comments is empty.'),
687
+ ('en_US', 'label', 'Recently_Viewed', 'Recently Viewed', '25', 'Recently Viewed', 'Label: Recently Viewed'),
688
+ ('en_US', 'message', 'Plugin_Not_Supported', 'Plugin Not Supported', '100', 'This action can\'t be performed on this device. Required support is not available on this device.', 'Error: When the device is not supported for requested action such as share functionality.'),
689
+ ('en_US', 'label', 'Share', 'Share', '7', 'Share', 'Label:Share button title.'),
690
+ ('en_US', 'label', 'Shopping_Products', 'Shopping Products', '20', 'Products', 'Label:Label for Shopping Products, available on left panel on product detail page.'),
691
+ ('en_US', 'label', 'Edit', 'Edit', '6', 'Edit', 'Label:Edit button title, available on wishlist page. '),
692
+ ('en_US', 'label', 'More_Information', 'More Information', '25', 'More Information', 'Label:More information about product'),
693
+ ('en_US', 'label', 'Share_App', 'Share App', '12', 'Share App', 'Label:Share app on CMS page'),
694
+ ('en_US', 'label', 'Sample_Links', 'Sample Links', '20', 'Sample Links', 'Label:Sample Links on product detail page'),
695
+ ('en_US', 'label', 'Maximum_Number_Of_Characters', 'Maximum number of characters', '50', 'Maximum number of characters', 'Label:Maximum number of characters for configurable product'),
696
+ ('en_US', 'message', 'Payment_Cancelled', 'Payment Cancelled', '50', 'Payment Cancelled', 'Message:Payment cancelled when user cancel payment'),
697
+ ('en_US', 'label', 'Tracking_Numbers', 'Tracking Numbers', '50', 'Tracking Numbers', 'Label:Tracking Numbers on order detail page'),
698
+ ('en_US', 'label', 'Track', 'Track', '15', 'Track', 'Label:Button on order detail page'),
699
+ ('en_US', 'label', 'Installment', 'Installment', '15', 'Installment', 'Label:On product detail page'),
700
+ ('en_US', 'label', 'Installment_Amount', 'Installment Amount', '20', 'Installment Amount', 'Label:On product detail page'),
701
+ ('en_US', 'label', 'Total_Amount', 'Total Amount', '15', 'Total Amount', 'Label:On product detail page'),
702
+ ('en_US', 'label', 'Single_Shot', 'Single Shot', '15', 'Single Shot', 'Label:For payuapi gateway on credit card page'),
703
+ ('en_US', 'message', 'Please_select_installment_option', 'Please Select Installment Option', '100', 'Please Select Installment Option', 'Message:On credit card page where installment option is required'),
704
+ ('en_US', 'label', 'January', 'January', '50', 'January', 'Label:Month name on credit card page'),
705
+ ('en_US', 'label', 'February', 'February', '50', 'February', 'Label:Month name on credit card page'),
706
+ ('en_US', 'label', 'March', 'March', '50', 'March', 'Label:Month name on credit card page'),
707
+ ('en_US', 'label', 'April', 'April', '50', 'April', 'Label:Month name on credit card page'),
708
+ ('en_US', 'label', 'May', 'May', '50', 'May', 'Label:Month name on credit card page'),
709
+ ('en_US', 'label', 'June', 'June', '50', 'June', 'Label:Month name on credit card page'),
710
+ ('en_US', 'label', 'July', 'July', '50', 'July', 'Label:Month name on credit card page'),
711
+ ('en_US', 'label', 'August', 'August', '50', 'August', 'Label:Month name on credit card page'),
712
+ ('en_US', 'label', 'September', 'September', '50', 'September', 'Label:Month name on credit card page'),
713
+ ('en_US', 'label', 'October', 'October', '50', 'October', 'Label:Month name on credit card page'),
714
+ ('en_US', 'label', 'November', 'November', '50', 'November', 'Label:Month name on credit card page'),
715
+ ('en_US', 'label', 'December', 'December', '50', 'December', 'Label:Month name on credit card page'),
716
+ ('es_ES', 'message', 'Please_wait', 'Please wait', '100', 'por favor espera', 'Error: When user trigger new action while previous one is still processsing.'),
717
+ ('es_ES', 'label', 'or', 'or', '25', 'o', 'Label: Display to show 2 action options.'),
718
+ ('es_ES', 'label', 'Home', 'Home', '8', 'casa', 'Label: Home page title and button title.'),
719
+ ('es_ES', 'message', 'No_internet_connection', 'No internet connection', '100', 'No hay conexión a internet', 'Message:No internet connection'),
720
+ ('es_ES', 'label', 'Shopping_Category', 'Shopping Category', '20', 'Compras Categoría', 'Label: Shopping Category'),
721
+ ('es_ES', 'message', 'Oops_There_are_no_categories_to_display', 'Oops! There are no categories to display.', '100', '¡Huy! No hay categorías para mostrar.', 'Text: When no category found.'),
722
+ ('es_ES', 'label', 'Shop_by_category', 'Shop by category', '25', 'Comprar por categoría', 'Label: Title to show above category names.'),
723
+ ('es_ES', 'label', 'Categories', 'Categories', '20', 'Categorías', 'Label: Title to show on homepage, above the category.'),
724
+ ('es_ES', 'label', 'All_Products', 'All Products', '20', 'todos los productos', 'Label: Link title, available on top of sub categories, to give option to user to browse all products for selected category. '),
725
+ ('es_ES', 'label', 'Profile', 'Profile', '10', 'perfil', 'Label: Profile page title and button title.'),
726
+ ('es_ES', 'label', 'List_Page', 'List Page', '15', 'Lista de páginas', 'Label: Page title'),
727
+ ('es_ES', 'label', 'Product_List', 'Product List', '15', 'Lista de Productos', 'Label: Product List page title '),
728
+ ('es_ES', 'label', 'products_found', 'products found', '20', 'Se han encontrado productos', 'Label: Label displayed on product listing page to show No. of products found. '),
729
+ ('es_ES', 'label', 'Product_Detail', 'Product Detail', '15', 'Detalles del producto', 'Label: Product Detail page title'),
730
+ ('es_ES', 'label', 'Details', 'Details', '10', 'Detalles', 'Label: Label displayed above the product detail on product detail page.'),
731
+ ('es_ES', 'label', 'Buy_Now', 'Buy Now', '10', 'comprar ahora', 'Label: Buy Now button title.'),
732
+ ('es_ES', 'label', 'Choose_an_option', 'Choose an option', '20', 'Elija una opción', 'Label: First option for product options.'),
733
+ ('es_ES', 'message', 'Item_added_successfully', 'Item added successfully', '100', 'Artículo agregado con éxito', 'Message: When the Item added successfully into the cart. '),
734
+ ('es_ES', 'message', 'We_are_sorry_No_products_found', 'We are sorry. No products found.', '100', 'No hay productos encontrados.', 'Text: When no products found for selected search criteria or category.'),
735
+ ('es_ES', 'label', 'Load_More', 'Load More', '10', 'cargar más', 'Label: Load More button title, displayed on product listing pages.'),
736
+ ('es_ES', 'label', 'Viewers', 'Viewers', '10', 'Los espectadores', 'Label: Viewers Label.'),
737
+ ('es_ES', 'label', 'Add_to_cart', 'Add to cart', '15', 'Añadir a la cesta', 'Label: Add to cart button title.'),
738
+ ('es_ES', 'label', 'Downloadable_link', 'Downloadable link', '20', 'enlace offline', 'Label: Downloadable link title. '),
739
+ ('es_ES', 'label', 'Review', 'Review', '10', 'revisión', 'Label: Review text and button title.'),
740
+ ('es_ES', 'message', 'No_reviews_found', 'No reviews found', '100', 'No hay comentarios encontrados', 'Text: When no reviews found for selected product.'),
741
+ ('es_ES', 'label', 'Shopping_Cart', 'Shopping Cart', '20', 'carro de la compra', 'Label: Shopping Cart button title.'),
742
+ ('es_ES', 'label', 'QTY', 'QTY', '5', 'CANT', 'Label: Label for product Quantity.'),
743
+ ('es_ES', 'label', 'TOTAL', 'TOTAL', '15', 'Total', 'Label: Label for cart &amp; order total. '),
744
+ ('es_ES', 'label', 'Subtotal', 'Subtotal', '15', 'total parcial', 'Label: Label for cart &amp; order subtotal.'),
745
+ ('es_ES', 'label', 'Tax', 'Tax', '5', 'impuesto', 'Label: Label for cart &amp; order Tax.'),
746
+ ('es_ES', 'label', 'Discount', 'Discount', '15', 'descuento', 'Label: Label for cart &amp; order discount. '),
747
+ ('es_ES', 'label', 'Grand_Total', 'Grand Total', '15', 'gran total', 'Label: Label for cart &amp; order grand total.'),
748
+ ('es_ES', 'message', 'The_shopping_cart_is_empty', 'The shopping cart is empty.', '100', 'La cesta de la compra está vacía.', 'Error: When the shopping cart is empty.'),
749
+ ('es_ES', 'message', 'Cart_updated_successfully', 'Cart updated successfully', '100', 'Carrito actualizado correctamente', 'Message: When the cart updated successfully.'),
750
+ ('es_ES', 'label', 'Update_Cart', 'Update Cart', '15', 'Actualizar Cesta', 'Label: Update Cart button title. '),
751
+ ('es_ES', 'label', 'Checkout', 'Checkout', '10', 'caja', 'Label: Checkout button title.'),
752
+ ('es_ES', 'message', 'Cart_is_empty', 'Cart is empty', '100', 'El carrito esta vacío', 'Text: When the cart is empty. '),
753
+ ('es_ES', 'message', 'One_of_your_cart_item_is_having_error', 'One of your cart item is having error', '100', 'Uno de sus artículos de la compra está teniendo problema', 'Text: When one of the cart item is having error such as not available or so.'),
754
+ ('es_ES', 'label', 'Login', 'Login', '7', 'login', 'Label: Login button title.'),
755
+ ('es_ES', 'message', 'Enter_your_username_password_to_get_access', 'Enter your username password to get access.', '50', 'Ingrese su contraseña nombre de usuario para obtener acceso.', 'Error: When requested action required login.'),
756
+ ('es_ES', 'label', 'Username', 'Username', '20', 'Nombre de usuario', 'Label: Label for Username field.'),
757
+ ('es_ES', 'label', 'Password', 'Password', '20', 'contraseña', 'Label: Label for password field.'),
758
+ ('es_ES', 'label', 'Sign_Up', 'Sign Up', '10', 'contratar', 'Label: Sign Up button title.'),
759
+ ('es_ES', 'message', 'Enter_username', 'Enter username', '100', 'Introduzca nombre de usuario', 'Error: When username is empty.'),
760
+ ('es_ES', 'message', 'Enter_password', 'Enter password', '100', 'Introduzca la contraseña', 'Error: When password is empty. '),
761
+ ('es_ES', 'message', 'Invalid_username_or_password', 'Invalid username or password', '100', 'Nombre de usuario o contraseña no válidos', 'Error: When Invalid username or password entered.'),
762
+ ('es_ES', 'label', 'First_name', 'First name', '20', 'nombre de pila', 'Label: Label for firstname field.'),
763
+ ('es_ES', 'label', 'Last_name', 'Last name', '20', 'apellido', 'Label: Label for lastname field.'),
764
+ ('es_ES', 'label', 'Your_Email', 'Your Email', '20', 'Su correo electrónico', 'Label: Label for email address field.'),
765
+ ('es_ES', 'label', 'Submit', 'Submit', '10', 'presentar', 'Label: Submit button title.'),
766
+ ('es_ES', 'label', 'Signup_Form', 'Signup Form', '15', 'Formulario de Inscripción', 'Label: Signup Form page title.'),
767
+ ('es_ES', 'label', 'Signup', 'Signup', '10', 'Inscripción', 'Label: Signup button title.'),
768
+ ('es_ES', 'message', 'Enter_firstname', 'Enter firstname', '100', 'Introduzca apellido', 'Error: When firstname is empty. '),
769
+ ('es_ES', 'message', 'Enter_lastname', 'Enter lastname', '100', 'Introduzca apellido', 'Error: When lastname is empty.'),
770
+ ('es_ES', 'message', 'Enter_email', 'Enter email', '100', 'Introduzca el correo electrónico', 'Error: When email address is empty.'),
771
+ ('es_ES', 'message', 'Please_enter_valid_email', 'Please enter valid email', '100', 'Por favor, introduzca la dirección de correo electrónico válida', 'Error: When email address is invalid.'),
772
+ ('es_ES', 'message', 'Registration_done_successfully', 'Registration done successfully', '100', '¡Enhorabuena! Usted está registrado con éxito', 'Message: When successfully registration has been done. '),
773
+ ('es_ES', 'message', 'Please_check_your_email', 'Please check your email', '100', 'Por favor revise su correo electrónico', 'Message: When user reset their password. '),
774
+ ('es_ES', 'label', 'Forgot_Password', 'Forgot Password', '20', 'Olvidé mi contraseña', 'Label: Forgot Password button title.'),
775
+ ('es_ES', 'label', 'Shipping', 'Shipping', '20', 'envío', 'Label: Label for Shipping. '),
776
+ ('es_ES', 'label', 'Billing', 'Billing', '20', 'facturación', 'Label: Label for Billing'),
777
+ ('es_ES', 'label', 'Address', 'Address', '20', 'dirección', 'Label: Label for address field, available on payment page. '),
778
+ ('es_ES', 'label', 'Payment', 'Payment', '20', 'pago', 'Label: Label for payment field, available on payment page.'),
779
+ ('es_ES', 'label', 'Continue', 'Continue', '20', 'continuar', 'Label: Continue button title. '),
780
+ ('es_ES', 'label', 'Billing_Address', 'Billing Address', '20', 'Dirección de Envio', 'Label: Label for Billing Address.'),
781
+ ('es_ES', 'label', 'Select_a_billing_address_from_your_address_book_or_enter_a_new_address', 'Select a billing address from your address book or enter a new address.', '100', 'Seleccione una dirección de facturación de su libreta de direcciones o introduzca una nueva dirección.', 'Label: Title available on billing addresses drop down.'),
782
+ ('es_ES', 'label', 'New_Address', 'New Address', '20', 'nueva dirección', 'Label: Title for New Billing Address form.'),
783
+ ('es_ES', 'label', 'Company', 'Company', '20', 'empresa', 'Label: Label for company field, available on address page. '),
784
+ ('es_ES', 'label', 'City', 'City', '20', 'ciudad', 'Label: Label for city field, available on address page. '),
785
+ ('es_ES', 'label', 'State', 'State', '20', 'estado', 'Label: Label for state field, available on address page. '),
786
+ ('es_ES', 'label', 'Country', 'Country', '20', 'país', 'Label: Label for country field, available on address page. '),
787
+ ('es_ES', 'label', 'select', 'select', '20', 'seleccionar', 'Label: Label for drop downs. '),
788
+ ('es_ES', 'label', 'Billing_street', 'Billing street', '20', 'calle de facturación', 'Label: Label for billing street field, available on address page. '),
789
+ ('es_ES', 'label', 'Postcode', 'Postcode', '20', 'código postal', 'Label: Label for postcode field, available on address page. '),
790
+ ('es_ES', 'label', 'Telephone', 'Telephone', '20', 'teléfono', 'Label: Label for telephone field, available on address page. '),
791
+ ('es_ES', 'label', 'Same_as_billing', 'Same as billing', '25', 'Igual que la facturación', 'Label: Label for Same as billing option. '),
792
+ ('es_ES', 'label', 'Shipping_Address', 'Shipping Address', '25', 'Dirección de envío', 'Label: Title for Shipping Address form.'),
793
+ ('es_ES', 'label', 'Select_a_shipping_address_from_your_address_book_or_enter_a_new_address', 'Select a shipping address from your address book or enter a new address.', '100', 'Seleccione una dirección de envío de su libreta de direcciones o introduzca una nueva dirección.', 'Label: Title available on shipping addresses drop down.'),
794
+ ('es_ES', 'label', 'Shipping_street', 'Shipping street', '25', 'calle del envío', 'Label: Label for shipping street field, available on address page. '),
795
+ ('es_ES', 'message', 'Enter_billing_firstname', 'Enter billing firstname', '100', 'Introduzca apellido de facturación', 'Error: When billing firstname is empty.'),
796
+ ('es_ES', 'message', 'Enter_billing_lastname', 'Enter billing lastname', '100', 'Introduzca apellido de facturación', 'Error: When billing lastname is empty.'),
797
+ ('es_ES', 'message', 'Enter_billing_city', 'Enter billing city', '100', 'Introduzca ciudad facturación', 'Error: When billing city is empty.'),
798
+ ('es_ES', 'message', 'Enter_billing_state', 'Enter billing state', '100', 'Introduzca estado de facturación', 'Error: When billing state is empty.'),
799
+ ('es_ES', 'message', 'Enter_billing_country', 'Enter billing country', '100', 'Introduzca el país de facturación', 'Error: When billing country is empty.'),
800
+ ('es_ES', 'message', 'Enter_billing_street', 'Enter billing street', '100', 'Introduzca facturación calle', 'Error: When billing street is empty.'),
801
+ ('es_ES', 'message', 'Enter_billing_postcode', 'Enter billing postcode', '100', 'Ingrese el código postal de facturación', 'Error: When billing postcode is empty.'),
802
+ ('es_ES', 'message', 'Enter_billing_telephone', 'Enter billing telephone', '100', 'Introduzca telefónico de facturación', 'Error: When billing telephone is empty.'),
803
+ ('es_ES', 'message', 'Enter_shipping_firstname', 'Enter shipping firstname', '100', 'Introduzca apellido envío', 'Error: When shipping firstname is empty.'),
804
+ ('es_ES', 'message', 'Enter_shipping_lastname', 'Enter shipping lastname', '100', 'Introduzca apellido envío', 'Error: When shipping lastname is empty.'),
805
+ ('es_ES', 'message', 'Enter_shipping_city', 'Enter shipping city', '100', 'Introduzca ciudad envío', 'Error: When shipping city is empty.'),
806
+ ('es_ES', 'message', 'Enter_shipping_state', 'Enter shipping state', '100', 'Introduzca estado del envío', 'Error: When shipping state is empty.'),
807
+ ('es_ES', 'message', 'Enter_shipping_country', 'Enter shipping country', '100', 'Introduzca el país de envío', 'Error: When shipping country is empty.'),
808
+ ('es_ES', 'message', 'Enter_shipping_street', 'Enter shipping street', '100', 'Introduzca calle envío', 'Error: When shipping street is empty.'),
809
+ ('es_ES', 'message', 'Enter_shipping_postcode', 'Enter shipping postcode', '100', 'Ingrese el código postal de envío', 'Error: When shipping postcode is empty.'),
810
+ ('es_ES', 'message', 'Enter_shipping_telephone', 'Enter shipping telephone', '100', 'Introduzca teléfono envío', 'Error: When shipping telephone is empty.'),
811
+ ('es_ES', 'label', 'Shipping_Method', 'Shipping Method', '25', 'Método de envío', 'Label: Shipping Method page title. '),
812
+ ('es_ES', 'label', 'Select_shipping_method', 'Select shipping method', '25', 'Seleccione el método de envío', 'Label: Label for Select shipping method options.'),
813
+ ('es_ES', 'message', 'Please_select_shipment_method', 'Please select shipment method', '100', 'Elija un método para el envío', 'Error: When shipment method is not selected.'),
814
+ ('es_ES', 'label', 'Payment_Method', 'Payment Method', '25', 'método de pago', 'Label: Payment Method page title. '),
815
+ ('es_ES', 'label', 'Select_payment_method', 'Select payment method', '25', 'Seleccione forma de pago', 'Label: Label for Select payment method options.'),
816
+ ('es_ES', 'message', 'Please_select_payment_method', 'Please select payment method', '100', 'Seleccione forma de pago', 'Error: When payment method is not selected.'),
817
+ ('es_ES', 'message', 'Oops_something_wrong_happened', 'Oops, something wrong happened', '50', 'Vaya, algo malo sucedió', 'Error: When magento return unexpected error.'),
818
+ ('es_ES', 'label', 'Credit_Card', 'Credit Card', '25', 'tarjeta de crédito', 'Label: Label for credit card field, available on payment page. '),
819
+ ('es_ES', 'label', 'Name_on_card', 'Name on card', '25', 'Nombre en la tarjeta', 'Label: Label for name of card field, available on payment page. '),
820
+ ('es_ES', 'label', 'Credit_card_type', 'Credit card type', '25', 'Tipo de la tarjeta de crédito', 'Label: Label for CC type field, available on payment page. '),
821
+ ('es_ES', 'label', 'Credit_card_number', 'Credit card number', '25', 'Número de Tarjeta de Crédito', 'Label: Label for CC number field, available on payment page. '),
822
+ ('es_ES', 'label', 'Expiration_Date', 'Expiration Date', '25', 'fecha de expiración', 'Label: Label for CC expiry date field, available on payment page. '),
823
+ ('es_ES', 'label', 'Month', 'Month', '25', 'mes', 'Label: Label for CC expiry month field, available on payment page. '),
824
+ ('es_ES', 'label', 'Year', 'Year', '25', 'año', 'Label: Label for CC expiry year field, available on payment page. '),
825
+ ('es_ES', 'label', 'Card_Verification_Number', 'Card Verification Number', '25', 'Tarjeta del número de Verificación', 'Label: Label for CC verification number field, available on payment page. '),
826
+ ('es_ES', 'message', 'Please_enter_name_on_card_field', 'Please enter name on card field', '100', 'Ingrese nombre en la tarjeta', 'Error: When name on card is empty.'),
827
+ ('es_ES', 'message', 'Please_select_credit_card_type_field', 'Please select credit card type field', '100', 'Seleccione el tipo de tarjeta de crédito', 'Error: When credit card type is not selected.'),
828
+ ('es_ES', 'message', 'Please_select_credit_card_number_field', 'Please select credit card number field', '100', 'Introduzca el número de tarjeta de crédito', 'Error: When credit card number is empty.'),
829
+ ('es_ES', 'message', 'Please_set_expiry_month_field', 'Please set expiry month field', '100', 'Establecer meses de caducidad', 'Error: When expiry month is empty.'),
830
+ ('es_ES', 'message', 'Please_set_expiry_year_field', 'Please set expiry year field', '100', 'Establecer años de caducidad', 'Error: When expiry year is empty.'),
831
+ ('es_ES', 'message', 'Please_set_card_verification_number', 'Please set card verification number', '100', 'Número de verificación de tarjeta de Ajuste', 'Error: When card verification number is empty.'),
832
+ ('es_ES', 'label', 'Order_Review', 'Order Review', '15', 'Revisión del pedido', 'Label: Order Review page title. '),
833
+ ('es_ES', 'label', 'Agreements', 'Agreements', '25', 'Acuerdos', 'Label: Label for Agreements, available on oprder review screen.'),
834
+ ('es_ES', 'message', 'Please_select_all_agreements', 'Please select all agreements', '100', 'Acepta términos y condiciones', 'Error: When user did not agreed on sign up terms.'),
835
+ ('es_ES', 'label', 'Shipping_and_Handling', 'Shipping & Handling', '25', 'Envío y dirección', 'Label: Label for Shipping &amp; Handling.'),
836
+ ('es_ES', 'label', 'Place_Order', 'Place Order', '25', 'Ponga la orden', 'Label: Place Order button title.'),
837
+ ('es_ES', 'label', 'Order_Success', 'Order Success', '15', 'Solicitar éxito', 'Label: Order Success page title. '),
838
+ ('es_ES', 'message', 'Thank_you_for_your_purchase', 'Thank you for your purchase!', '100', 'Gracias por su compra!', 'Message: When order successfully placed. '),
839
+ ('es_ES', 'message', 'You_will_receive_an_order_confirmation_email_with_details_of_your_order_and_a_link_to_track_its_progress', 'You will receive an order confirmation email with details of your order and a link to track its progress.', '200', 'Usted recibirá un correo electrónico de confirmación de pedido con los detalles de su pedido y un enlace para el seguimiento de su progreso.', 'Text: When order successfully placed '),
840
+ ('es_ES', 'label', 'Continue_Shopping', 'Continue Shopping', '20', 'continuar Compras', 'LabeL: Continue Shopping button title. '),
841
+ ('es_ES', 'label', 'Error', 'Error', '15', 'error', 'Label: Error '),
842
+ ('es_ES', 'message', 'Wishlist_added_successfully', 'Wishlist added successfully', '100', 'Artículo agregado con éxito en la lista de deseos', 'Message: When item added into Wishlist.'),
843
+ ('es_ES', 'message', 'Item_removed_successfully', 'Item removed successfully', '100', 'Artículo removido de la lista de deseos', 'Message: When Item removed from wishlist.'),
844
+ ('es_ES', 'label', 'Wishlist', 'Wishlist', '15', 'lista', 'Label: Wishlist page title. '),
845
+ ('es_ES', 'label', 'Remove', 'Remove', '10', 'quitar', 'Label: Remove button title.'),
846
+ ('es_ES', 'message', 'No_wishlist_items_found', 'No wishlist items found', '25', 'No hay artículos en su lista encontrados', 'Text: When No wishlist items found.'),
847
+ ('es_ES', 'label', 'Orders', 'Orders', '15', 'órdenes', 'Label: Orders history page title.'),
848
+ ('es_ES', 'label', 'Order_History', 'Order History', '20', 'Historial de pedidos', 'Label: Order History button title. '),
849
+ ('es_ES', 'message', 'We_are_sorry_No_orders_found', 'We are sorry. No orders found', '25', 'No hay pedidos encontrados', 'Text: When no order history found. '),
850
+ ('es_ES', 'label', 'Order_Detail', 'Order Detail', '15', 'Detalle de la orden', 'Label: Order Detail page title. '),
851
+ ('es_ES', 'label', 'Ordered_Items', 'Ordered Items', '25', 'Los artículos pedidos', 'Label: Ordered Items block heading or title. '),
852
+ ('es_ES', 'label', 'Order_Number', 'Order Number', '20', 'número de orden', 'Label: Label for Order Number.'),
853
+ ('es_ES', 'label', 'Order_Date', 'Order Date', '20', 'Fecha del pedido', 'Label: Label for Order Date.'),
854
+ ('es_ES', 'label', 'User', 'User', '10', 'usuario', 'Label: Label for User.'),
855
+ ('es_ES', 'label', 'Info', 'Info', '15', 'acerca de', 'Label: About page title (CMS/about module)'),
856
+ ('es_ES', 'label', 'Add_To_Wishlist', 'Add To Wishlist', '15', 'Agregar a la lista', 'Label: Add To Wishlist button title.'),
857
+ ('es_ES', 'label', 'Logout', 'Logout', '10', 'Cerrar sesión', 'Label: Logout button title.'),
858
+ ('es_ES', 'label', 'Search_Product', 'Search Product', '50', 'Buscar Producto', 'Label: Search Product.'),
859
+ ('es_ES', 'label', 'Apply', 'Apply', '8', 'aplicar', 'Label: Apply button title (to apply discount)'),
860
+ ('es_ES', 'message', 'Couponcode_Applied_Successfully', 'Couponcode Applied Successfully', '100', 'Código de descuento aplicado con éxito', 'Message: When coupon code is applied.'),
861
+ ('es_ES', 'message', 'Couponcode_Removed_Successfully', 'Couponcode Removed Successfully', '100', 'Código de descuento Suprimido correctamente', 'Message: When coupon code is removed. '),
862
+ ('es_ES', 'label', 'Discount_Code', 'Discount Code', '25', 'Código de Descuento', 'Label: Label for Discount Code.'),
863
+ ('es_ES', 'label', 'Update_Wishlist', 'Update Wishlist', '20', 'actualización lista de Deseos', 'Label: Update Wishlist button title.'),
864
+ ('es_ES', 'message', 'Item_updated_successfully', 'Item updated successfully', '100', 'Artículo actualizado correctamente', 'Message: When wishlist updated successfully.'),
865
+ ('es_ES', 'message', 'Cant_Load_Wishlist_Item', 'Cant Load Wishlist Item', '100', 'Cargar Cant Lista de artículos', 'Error: When requested wishlist item Can not Load. '),
866
+ ('es_ES', 'message', 'Please_Select', 'Please select ', '25', 'Por favor, seleccione', 'Error: To show error message for required product option, please note that title of the custom field will be added after this text such as &quot;Please select colors&quot;'),
867
+ ('es_ES', 'label', 'product_downloadable_links', 'Product Downloadable Links', '25', 'Productos Enlaces descargables', 'Label: Label for Product Downloadable Links.'),
868
+ ('es_ES', 'message', 'Please_enter_coupon_code', 'Please Enter Coupon Code', '100', 'Código promocional no válido', 'Error: When coupon code is invalid.'),
869
+ ('es_ES', 'message', 'Please_Login_To_Continue', 'Please Login To Continue', '100', 'Inicia sesión para continuar', 'Error: When action required login '),
870
+ ('es_ES', 'message', 'Customer_First_Name_Is_Required', 'Customer First Name Is Required', '100', 'Introduzca apellido', 'Error: When firstname is empty in signup form. '),
871
+ ('es_ES', 'message', 'Customer_Last_Name_Is_Required', 'Customer Last Name Is Required', '100', 'Introduzca apellido', 'Error: When lastname is empty in signup form. '),
872
+ ('es_ES', 'message', 'Customer_Email_Is_Required', 'Customer Email Is Required', '100', 'Introduzca el correo electrónico', 'Error: When email address is empty in signup form. '),
873
+ ('es_ES', 'message', 'Customer_Password_Is_Required', 'Customer Password Is Required', '100', 'Introduzca la contraseña', 'Error: When password is empty in signup form. '),
874
+ ('es_ES', 'message', 'Account_Already_Exists', 'Account Already Exists', '100', 'Ya existe Cuenta', 'Error: When email address already exists.'),
875
+ ('es_ES', 'message', 'Cannot_Save_Customer_Address', 'Cannot Save Customer Address', '100', 'No se puede guardar la dirección del cliente', 'Error: When error occure while saving customer Address.'),
876
+ ('es_ES', 'message', 'No_Data_Found', 'No Data Found', '100', 'No se encontraron datos', 'Error: When no data found for requested page.'),
877
+ ('es_ES', 'message', 'Product_Does_Not_Exists', 'Product Does Not Exists', '100', 'Ya no está disponible Producto', 'Error: When requested product is no londer available.'),
878
+ ('es_ES', 'message', 'Cannot_Specify_Product', 'Cannot Specify Product', '100', 'Artículo solicitado no encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
879
+ ('es_ES', 'message', 'Please_Pass_Item_Id', 'Please Pass Item Id', '100', 'Artículo solicitado no encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
880
+ ('es_ES', 'message', 'Wishlist_Does_Not_Exists', 'Wishlist Does Not Exists', '100', 'Opps! El artículo no se puede cargar', 'Error: When wishlist can\'t load because of unexpected error.'),
881
+ ('es_ES', 'message', 'Item_Does_Not_Exists', 'Item Does Not Exists', '100', 'Artículo solicitado no encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
882
+ ('es_ES', 'message', 'Please_Pass_Product_Id', 'Please Pass Product Id', '100', 'Artículo solicitado no encontrado', 'Error: When requested product is not exist or available or product id is not passed in proper format.'),
883
+ ('es_ES', 'message', 'Cannot_Load_Wishlist_Item', 'Cannot Load Wishlist Item', '100', 'Artículo solicitado no encontrado', 'Error: When system can not load wishlist Item.'),
884
+ ('es_ES', 'message', 'Product_Is_Unavailable', 'Product Is Unavailable', '100', 'Artículo solicitado ya no está disponible', 'Error: When requested product is no longer available.'),
885
+ ('es_ES', 'message', 'Item_Has_Been_Deleted_From_Cart', 'Item Has Been Deleted From Cart', '100', 'Artículo ha sido borrado de la compra', 'Error: When Item has been deleted from cart.'),
886
+ ('es_ES', 'message', 'Not_All_Products_Are_Available_In_The_Requested_Quantity', 'Not All Products Are Available In The Requested Quantity', '100', 'No todos los productos están disponibles en el auantity solicitado', 'Error: When any of the product from cart is no longer available.'),
887
+ ('es_ES', 'message', 'Please_Agree_To_All_The_Terms_And_Conditions_Before__Placing_The_Order', 'Please Agree To All The Terms And Conditions Before Placing The Order', '100', 'Acepte todos los términos y condiciones antes de realizar el pedido', 'Error: When user did not agree on all required addreement while placing order.'),
888
+ ('es_ES', 'label', 'Filter', 'Filter', '10', 'filtro', 'Label: Label for Filters.'),
889
+ ('es_ES', 'label', 'Reset_Filter', 'Reset Filter', '15', 'Reajuste del filtro', 'Label: Reset Filter link title.'),
890
+ ('es_ES', 'label', 'Reset', 'Reset', '10', 'reajustar', 'Label: Reset button title.'),
891
+ ('es_ES', 'label', 'Popularity', 'Popularity', '25', 'popularidad', 'Label: Label for filter: Popularity option. '),
892
+ ('es_ES', 'label', 'Price-High_To_Low', 'Price-High To Low', '25', 'Precio De Mayor a Menor', 'Label: Label for filter: Price-High To Low option. '),
893
+ ('es_ES', 'label', 'Price-Low_To_High', 'Price-Low To High', '25', 'Precio menor