KANCART_MobileAPI - Version 2.1.2.1

Version Notes

Kancart supports guest checkout now;
We developed a promotion mechanism, you can add promotion rules for mobile user;
More details of improvements can be found on www.kancart.com

Download this release

Release Info

Developer Kancart.com
Extension KANCART_MobileAPI
Version 2.1.2.1
Comparing to
See all releases


Code changes from version 2.1.2 to 2.1.2.1

app/code/community/Kancart/MobileApi/Model/Store.php CHANGED
@@ -146,12 +146,17 @@ class Kancart_MobileApi_Model_Store extends Kancart_MobileApi_Model_Abstract {
146
 
147
  public function getLanguages() {
148
  $languages = array();
 
149
  $stores = Mage::app()->getStores(false, true);
150
  $allowspecific = Kancart::helper('Data')->getFrontConfig('allowspecific') > 0;
151
  $annlowStores = explode(',', Kancart::helper('Data')->getFrontConfig('stores'));
152
  foreach ($stores as $store) {
153
  if ($store->getIsActive()) {
154
- $allow = !$allowspecific && $store->getWebsite()->getIsDefault() && $store->getGroup()->getId() == $store->getWebsite()->getDefaultGroupId();
 
 
 
 
155
  if ($allow || ($allowspecific && in_array($store->getCode(), $annlowStores))) {
156
  $languages[] = array(
157
  'language_id' => $store->getCode(),
146
 
147
  public function getLanguages() {
148
  $languages = array();
149
+ $params = Mage::registry('application_params');
150
  $stores = Mage::app()->getStores(false, true);
151
  $allowspecific = Kancart::helper('Data')->getFrontConfig('allowspecific') > 0;
152
  $annlowStores = explode(',', Kancart::helper('Data')->getFrontConfig('stores'));
153
  foreach ($stores as $store) {
154
  if ($store->getIsActive()) {
155
+ if (isset($params['scope_type']) && $params['scope_type'] == 'website' && isset($params['scope_code'])) {
156
+ $allow = !$allowspecific && $store->getWebsite()->getCode() == $params['scope_code'];
157
+ } else {
158
+ $allow = !$allowspecific && $store->getWebsite()->getIsDefault();
159
+ }
160
  if ($allow || ($allowspecific && in_array($store->getCode(), $annlowStores))) {
161
  $languages[] = array(
162
  'language_id' => $store->getCode(),
app/code/community/Kancart/MobileApi/controllers/IndexController.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  error_reporting(E_ALL ^ E_NOTICE);
4
- define('KANCART_PLUGIN_VERSION', '2.1.2');
5
  define('KANCART_APP_KEY', Mage::getStoreConfig('Kancart/Kancart_group/Kancart_appkey', Mage::app()->getStore()));
6
  define('KANCART_APP_SECRET', Mage::getStoreConfig('Kancart/Kancart_group/Kancart_appsecret', Mage::app()->getStore()));
7
  define('PRICE_INCLUDE_TAX', (boolean) Mage::getStoreConfig('Kancart/general/price_tax', Mage::app()->getStore()));
@@ -54,7 +54,7 @@ class Kancart_MobileApi_IndexController extends Mage_Core_Controller_Front_Actio
54
  }
55
  }
56
 
57
- public function init() {
58
  $currentStoreCode = Mage::app()->getStore()->getCode();
59
  $switchTo = (string) $this->getRequest()->getParam('language');
60
  if (isset($switchTo) && !empty($switchTo)) {
@@ -165,6 +165,14 @@ class Kancart_MobileApi_IndexController extends Mage_Core_Controller_Front_Actio
165
  $fileName = MOBILE_API_ROOT . DIRECTORY_SEPARATOR . uc_words('Model_Invoice_Total_Discount', DIRECTORY_SEPARATOR) . '.php';
166
  $dest = COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . 'Kancart_MobileApi_Model_Invoice_Total_Discount.php';
167
  file_exists($fileName) && copy($fileName, $dest);
 
 
 
 
 
 
 
 
168
  }
169
  }
170
 
1
  <?php
2
 
3
  error_reporting(E_ALL ^ E_NOTICE);
4
+ define('KANCART_PLUGIN_VERSION', '2.1.2.1');
5
  define('KANCART_APP_KEY', Mage::getStoreConfig('Kancart/Kancart_group/Kancart_appkey', Mage::app()->getStore()));
6
  define('KANCART_APP_SECRET', Mage::getStoreConfig('Kancart/Kancart_group/Kancart_appsecret', Mage::app()->getStore()));
7
  define('PRICE_INCLUDE_TAX', (boolean) Mage::getStoreConfig('Kancart/general/price_tax', Mage::app()->getStore()));
54
  }
55
  }
56
 
57
+ public function init() {
58
  $currentStoreCode = Mage::app()->getStore()->getCode();
59
  $switchTo = (string) $this->getRequest()->getParam('language');
60
  if (isset($switchTo) && !empty($switchTo)) {
165
  $fileName = MOBILE_API_ROOT . DIRECTORY_SEPARATOR . uc_words('Model_Invoice_Total_Discount', DIRECTORY_SEPARATOR) . '.php';
166
  $dest = COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . 'Kancart_MobileApi_Model_Invoice_Total_Discount.php';
167
  file_exists($fileName) && copy($fileName, $dest);
168
+
169
+ $fileName = MOBILE_API_ROOT . DIRECTORY_SEPARATOR . uc_words('Model_System_Config_Source_Allspecificstore', DIRECTORY_SEPARATOR) . '.php';
170
+ $dest = COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . 'Kancart_MobileApi_Model_System_Config_Source_Allspecificstore.php';
171
+ file_exists($fileName) && copy($fileName, $dest);
172
+
173
+ $fileName = MOBILE_API_ROOT . DIRECTORY_SEPARATOR . uc_words('Model_System_Config_Source_Store', DIRECTORY_SEPARATOR) . '.php';
174
+ $dest = COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . 'Kancart_MobileApi_Model_System_Config_Source_Store.php';
175
+ file_exists($fileName) && copy($fileName, $dest);
176
  }
177
  }
178
 
app/code/community/Kancart/MobileApi/etc/system.xml CHANGED
@@ -63,16 +63,6 @@
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
  </price_tax>
66
- <image_frame translate="label">
67
- <label>Image Keep Frame</label>
68
- <comment>Choose Yes keep the original image proportions, otherwise stretch the image.</comment>
69
- <frontend_type>select</frontend_type>
70
- <source_model>adminhtml/system_config_source_yesno</source_model>
71
- <sort_order>10</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
- </image_frame>
76
  <thumbnail_image translate="label">
77
  <label>Thumbnail Image Size</label>
78
  <comment>Set the product list thumbnail image size, example 320 x 320 or 320.</comment>
@@ -91,9 +81,19 @@
91
  <show_in_website>1</show_in_website>
92
  <show_in_store>1</show_in_store>
93
  </main_image>
 
 
 
 
 
 
 
 
 
 
94
  <allowspecific translate="label">
95
  <label>Display Store Views</label>
96
- <comment>Choose store views display on mobile site.</comment>
97
  <frontend_type>select</frontend_type>
98
  <source_model>mobileapi/system_config_source_allspecificstore</source_model>
99
  <sort_order>20</sort_order>
@@ -101,7 +101,7 @@
101
  <show_in_website>1</show_in_website>
102
  </allowspecific>
103
  <stores translate="label">
104
- <label>Available stores From</label>
105
  <frontend_type>multiselect</frontend_type>
106
  <source_model>mobileapi/system_config_source_store</source_model>
107
  <sort_order>25</sort_order>
@@ -112,8 +112,8 @@
112
  </depends>
113
  </stores>
114
  <paypal_standard translate="label">
115
- <label>PayPal Payments Standard</label>
116
- <comment>If you just want to mobile site to use paypal standard you can enable this.</comment>
117
  <frontend_type>select</frontend_type>
118
  <source_model>adminhtml/system_config_source_yesno</source_model>
119
  <sort_order>35</sort_order>
@@ -122,11 +122,11 @@
122
  <show_in_store>1</show_in_store>
123
  </paypal_standard>
124
  <paypal_express translate="label">
125
- <label>PayPal Express Checkout</label>
126
- <comment>If you just want to mobile site to use paypal express checkout you can enable this.</comment>
127
  <frontend_type>select</frontend_type>
128
  <source_model>adminhtml/system_config_source_yesno</source_model>
129
- <sort_order>60</sort_order>
130
  <show_in_default>1</show_in_default>
131
  <show_in_website>1</show_in_website>
132
  <show_in_store>1</show_in_store>
@@ -136,7 +136,7 @@
136
  <redirect translate="label">
137
  <label>Redirect Options</label>
138
  <frontend_type>text</frontend_type>
139
- <comment>Here you can configure your web site redirect options.</comment>
140
  <sort_order>80</sort_order>
141
  <show_in_default>1</show_in_default>
142
  <show_in_website>1</show_in_website>
@@ -151,7 +151,7 @@
151
  </active>
152
  <url translate="label">
153
  <label>Mobile Url</label>
154
- <comment>Please configure your mobile site url that registered in kancart.</comment>
155
  <frontend_type>text</frontend_type>
156
  <sort_order>20</sort_order>
157
  <show_in_default>1</show_in_default>
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
  </price_tax>
 
 
 
 
 
 
 
 
 
 
66
  <thumbnail_image translate="label">
67
  <label>Thumbnail Image Size</label>
68
  <comment>Set the product list thumbnail image size, example 320 x 320 or 320.</comment>
81
  <show_in_website>1</show_in_website>
82
  <show_in_store>1</show_in_store>
83
  </main_image>
84
+ <image_frame translate="label">
85
+ <label>Image Keep Frame</label>
86
+ <comment>Choose Yes to keep the original product image proportions, otherwise stretch the image.</comment>
87
+ <frontend_type>select</frontend_type>
88
+ <source_model>adminhtml/system_config_source_yesno</source_model>
89
+ <sort_order>15</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </image_frame>
94
  <allowspecific translate="label">
95
  <label>Display Store Views</label>
96
+ <comment>Choose store views displayed on mobile site.</comment>
97
  <frontend_type>select</frontend_type>
98
  <source_model>mobileapi/system_config_source_allspecificstore</source_model>
99
  <sort_order>20</sort_order>
101
  <show_in_website>1</show_in_website>
102
  </allowspecific>
103
  <stores translate="label">
104
+ <label>Available Store Views</label>
105
  <frontend_type>multiselect</frontend_type>
106
  <source_model>mobileapi/system_config_source_store</source_model>
107
  <sort_order>25</sort_order>
112
  </depends>
113
  </stores>
114
  <paypal_standard translate="label">
115
+ <label>Force PayPal Payments Standard Enabled For Mobile</label>
116
+ <comment>If you just want the mobile site to use paypal standard you can enable this.</comment>
117
  <frontend_type>select</frontend_type>
118
  <source_model>adminhtml/system_config_source_yesno</source_model>
119
  <sort_order>35</sort_order>
122
  <show_in_store>1</show_in_store>
123
  </paypal_standard>
124
  <paypal_express translate="label">
125
+ <label>Force PayPal Express Checkout Enabled For Mobile</label>
126
+ <comment>If you just want the mobile site to use paypal express checkout you can enable this.</comment>
127
  <frontend_type>select</frontend_type>
128
  <source_model>adminhtml/system_config_source_yesno</source_model>
129
+ <sort_order>40</sort_order>
130
  <show_in_default>1</show_in_default>
131
  <show_in_website>1</show_in_website>
132
  <show_in_store>1</show_in_store>
136
  <redirect translate="label">
137
  <label>Redirect Options</label>
138
  <frontend_type>text</frontend_type>
139
+ <comment>Here you can configure your web site mobile redirect options.</comment>
140
  <sort_order>80</sort_order>
141
  <show_in_default>1</show_in_default>
142
  <show_in_website>1</show_in_website>
151
  </active>
152
  <url translate="label">
153
  <label>Mobile Url</label>
154
+ <comment>Please configure your mobile site url that registered in Kancart.</comment>
155
  <frontend_type>text</frontend_type>
156
  <sort_order>20</sort_order>
157
  <show_in_default>1</show_in_default>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>KANCART_MobileAPI</name>
4
- <version>2.1.2</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
@@ -15,8 +15,8 @@ More details of improvements can be found on www.kancart.com&#xD;
15
  </notes>
16
  <authors><author><name>Kancart.com</name><user>Kancarter</user><email>support@kancart.com</email></author></authors>
17
  <date>2014-02-19</date>
18
- <time>09:34:13</time>
19
- <contents><target name="magecommunity"><dir name="Kancart"><dir name="MobileApi"><dir name="Helper"><file name="CryptoUtil.php" hash="2db9a53cbaed6e8bc5f2dae4ed2ec334"/><file name="DES.php" hash="f038974cc0cf453373a52e6d4770ffdb"/><file name="Data.php" hash="1b254135bbfbcfdfd9f7ff826c1dd196"/><file name="Rijndael.php" hash="be7c805f21086f7c26f785d0c0e73afd"/></dir><dir name="Model"><file name="Abstract.php" hash="d459ecc3f3e6c6bda1a3deb988f94bc3"/><file name="Cart.php" hash="9fc7f8a3c4f28703b565fee710250b68"/><file name="Category.php" hash="f58947db89b3244411da36052836029a"/><file name="Checkout.php" hash="7f7bffd91eeff343f7aab04a97d7467d"/><file name="ErrorHandler.php" hash="6d62e02c4ce592a41b242e781fe2c28a"/><dir name="Invoice"><dir name="Total"><file name="Discount.php" hash="d6f8d914e6447a8b4af54aea212c9551"/></dir></dir><file name="Item.php" hash="d34bfc4b6ed06f9a848799f522f39d2a"/><file name="Items.php" hash="48271a42517906d3a33bc6339c97b7dd"/><file name="Order.php" hash="ab793baf5fd85110730e90c7363f0e9a"/><file name="PayPalEC.php" hash="936af8c18938954caf8a196f48b9fc5a"/><file name="PayPalWPS.php" hash="0e87844cf4bee5db1e9c885de21372ba"/><file name="Payment.php" hash="337b55ba40a0dbf3214c1b9461cce882"/><dir name="Quote"><dir name="Total"><file name="Discount.php" hash="790326803517c509a752aae54622f469"/></dir></dir><file name="Result.php" hash="64759b5dcb022186f12c0cb043877af0"/><file name="Review.php" hash="cd3b705fb6894c36824094f562acc869"/><file name="Store.php" hash="ec9f6b9a4eb6b4c7d6c3b5beb82c40cf"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Allspecificstore.php" hash="3b3b39fd653f6c6600762ec9ca373e03"/><file name="Store.php" hash="31bde96aaa434639e90d760e1b847907"/></dir></dir></dir><file name="User.php" hash="9c41438cc779e83b57b17d28e6a90e77"/></dir><dir name="controllers"><file name="IndexController.php" hash="7c31859c673d65b90154112d9397f19f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="3364317d05e33ac33f067aed7a9f6a58"/><file name="config.xml" hash="6d0cca0578ec73b497fb91a75031537d"/><file name="system.xml" hash="2495a7d0b94595163993791aeddf0ea7"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kancart_MobileApi.xml" hash="efdda31d392fe3c30f461bb2a86e8b14"/></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>KANCART_MobileAPI</name>
4
+ <version>2.1.2.1</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
15
  </notes>
16
  <authors><author><name>Kancart.com</name><user>Kancarter</user><email>support@kancart.com</email></author></authors>
17
  <date>2014-02-19</date>
18
+ <time>11:41:42</time>
19
+ <contents><target name="magecommunity"><dir name="Kancart"><dir name="MobileApi"><dir name="Helper"><file name="CryptoUtil.php" hash="2db9a53cbaed6e8bc5f2dae4ed2ec334"/><file name="DES.php" hash="f038974cc0cf453373a52e6d4770ffdb"/><file name="Data.php" hash="1b254135bbfbcfdfd9f7ff826c1dd196"/><file name="Rijndael.php" hash="be7c805f21086f7c26f785d0c0e73afd"/></dir><dir name="Model"><file name="Abstract.php" hash="d459ecc3f3e6c6bda1a3deb988f94bc3"/><file name="Cart.php" hash="9fc7f8a3c4f28703b565fee710250b68"/><file name="Category.php" hash="f58947db89b3244411da36052836029a"/><file name="Checkout.php" hash="7f7bffd91eeff343f7aab04a97d7467d"/><file name="ErrorHandler.php" hash="6d62e02c4ce592a41b242e781fe2c28a"/><dir name="Invoice"><dir name="Total"><file name="Discount.php" hash="d6f8d914e6447a8b4af54aea212c9551"/></dir></dir><file name="Item.php" hash="d34bfc4b6ed06f9a848799f522f39d2a"/><file name="Items.php" hash="48271a42517906d3a33bc6339c97b7dd"/><file name="Order.php" hash="ab793baf5fd85110730e90c7363f0e9a"/><file name="PayPalEC.php" hash="936af8c18938954caf8a196f48b9fc5a"/><file name="PayPalWPS.php" hash="0e87844cf4bee5db1e9c885de21372ba"/><file name="Payment.php" hash="337b55ba40a0dbf3214c1b9461cce882"/><dir name="Quote"><dir name="Total"><file name="Discount.php" hash="790326803517c509a752aae54622f469"/></dir></dir><file name="Result.php" hash="64759b5dcb022186f12c0cb043877af0"/><file name="Review.php" hash="cd3b705fb6894c36824094f562acc869"/><file name="Store.php" hash="4665db664a88b17eef2d7dd72c38681c"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Allspecificstore.php" hash="3b3b39fd653f6c6600762ec9ca373e03"/><file name="Store.php" hash="31bde96aaa434639e90d760e1b847907"/></dir></dir></dir><file name="User.php" hash="9c41438cc779e83b57b17d28e6a90e77"/></dir><dir name="controllers"><file name="IndexController.php" hash="832a1acb0e6e1ffd20387e1639edc2d4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="3364317d05e33ac33f067aed7a9f6a58"/><file name="config.xml" hash="6d0cca0578ec73b497fb91a75031537d"/><file name="system.xml" hash="6fc18c49e6ee7ad39ae111b0f4824025"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kancart_MobileApi.xml" hash="efdda31d392fe3c30f461bb2a86e8b14"/></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>