getready_kaas - Version 2.0.0

Version Notes

The release fixed:
- changed signature of kaasProductListIds
- added posibility to filter ids in kaasProductListIds
- added posibility to filter by category_id

Download this release

Release Info

Developer GetReady Team
Extension getready_kaas
Version 2.0.0
Comparing to
See all releases


Code changes from version 1.0.5 to 2.0.0

app/code/community/Getready/Kaas/Helper/Data.php CHANGED
@@ -27,4 +27,8 @@ class Getready_Kaas_Helper_Data extends Mage_Core_Helper_Abstract
27
  {
28
  return self::DEFAULT_ROOT_LEVEL;
29
  }
 
 
 
 
30
  }
27
  {
28
  return self::DEFAULT_ROOT_LEVEL;
29
  }
30
+
31
+ public function getModuleVersion() {
32
+ return(string) Mage::getConfig()->getNode()->modules->Getready_Kaas->version;
33
+ }
34
  }
app/code/community/Getready/Kaas/Helper/Store/Data.php CHANGED
@@ -40,6 +40,7 @@ class Getready_Kaas_Helper_Store_Data extends Mage_Core_Helper_Abstract
40
  'store_url' => '',
41
  'store_url_secure' => '',
42
  'ga_account' => '',
 
43
  );
44
 
45
  //general
@@ -67,6 +68,8 @@ class Getready_Kaas_Helper_Store_Data extends Mage_Core_Helper_Abstract
67
 
68
  $store_info['ga_account'] = trim((string) Mage::getStoreConfig('google/analytics/account', $store_id));
69
 
 
 
70
  return $store_info;
71
  }
72
 
40
  'store_url' => '',
41
  'store_url_secure' => '',
42
  'ga_account' => '',
43
+ 'kaas_module_version' => '',
44
  );
45
 
46
  //general
68
 
69
  $store_info['ga_account'] = trim((string) Mage::getStoreConfig('google/analytics/account', $store_id));
70
 
71
+ $store_info['kaas_module_version'] = (string) Mage::helper('kaas/data')->getModuleVersion();
72
+
73
  return $store_info;
74
  }
75
 
app/code/community/Getready/Kaas/Model/Product/Api.php CHANGED
@@ -143,17 +143,73 @@ class Getready_Kaas_Model_Product_Api extends Mage_Api_Model_Resource_Abstract
143
  return $result;
144
  }
145
 
146
- public function itemsIds($storeId)
147
  {
 
 
 
148
  $collection = Mage::getModel('catalog/product')->getCollection()
149
  ->addStoreFilter($storeId);
150
 
151
- $result = array();
 
 
 
 
152
 
 
153
  foreach ($collection as $product) {
154
  $result[] = (int) $product->getId();
155
  }
156
 
157
  return $result;
158
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  }
143
  return $result;
144
  }
145
 
146
+ public function itemsIds($query)
147
  {
148
+ $parsed_query = $this->_parseQuery($query);
149
+ $storeId = $parsed_query['store_id'];
150
+
151
  $collection = Mage::getModel('catalog/product')->getCollection()
152
  ->addStoreFilter($storeId);
153
 
154
+ foreach($parsed_query['query'] as $cond) {
155
+ $this->_addQueryCondFilter($collection, $cond);
156
+ }
157
+
158
+ Mage::log((string) $collection->getSelectSql());
159
 
160
+ $result = array();
161
  foreach ($collection as $product) {
162
  $result[] = (int) $product->getId();
163
  }
164
 
165
  return $result;
166
  }
167
+
168
+ protected function _parseQuery($query) {
169
+ $result = array();
170
+ if ( strpos($query, 'json:') === 0 ) {
171
+ list($j, $json_string) = explode(':', $query, 2);
172
+ $result = json_decode($json_string, true);
173
+ if ($result===false) $result['store_id'] = 0;
174
+
175
+ } else if (is_numeric($query)) {
176
+ $result['store_id'] = (int) $query;
177
+ } else {
178
+ $result['store_id'] = (int) $query;
179
+ }
180
+
181
+ return $result;
182
+ }
183
+
184
+ protected function _addQueryCondFilter($collection, $cond) {
185
+ if (isset($cond[0]) && isset($cond[1]) && isset($cond[2])) {
186
+ switch ($cond[1]) {
187
+ case 'category_id':
188
+ $this->_joinCategory($collection);
189
+ $this->_addAttributeFilter($collection, $cond);
190
+ break;
191
+ default:
192
+ $this->_addAttributeFilter($collection, $cond);
193
+
194
+ }
195
+ }
196
+ return $collection;
197
+ }
198
+
199
+ protected function _joinCategory($collection) {
200
+ $collection->getSelect()->group('entity_id');
201
+ $collection->joinField(
202
+ 'category_id',
203
+ 'catalog/category_product',
204
+ 'category_id',
205
+ 'product_id=entity_id',null,'left');
206
+ }
207
+
208
+ protected function _addAttributeFilter($collection, $cond) {
209
+ $collection->addAttributeToFilter($cond[1],array($cond[0]=>$cond[2]));
210
+ }
211
+
212
+
213
+
214
+
215
  }
app/code/community/Getready/Kaas/etc/config.xml CHANGED
@@ -20,7 +20,7 @@
20
  <config>
21
  <modules>
22
  <Getready_Kaas>
23
- <version>1.0.5</version>
24
  </Getready_Kaas>
25
  </modules>
26
 
20
  <config>
21
  <modules>
22
  <Getready_Kaas>
23
+ <version>2.0.0</version>
24
  </Getready_Kaas>
25
  </modules>
26
 
app/code/community/Getready/Kaas/etc/wsdl.xml CHANGED
@@ -41,7 +41,9 @@
41
  <element name="timezone" type="xsd:string" />
42
  <element name="store_url" type="xsd:string" />
43
  <element name="store_url_secure" type="xsd:string" />
44
- <element name="ga_account" type="xsd:string" />
 
 
45
  </all>
46
  </complexType>
47
  <complexType name="kaasStoreEntityArray">
41
  <element name="timezone" type="xsd:string" />
42
  <element name="store_url" type="xsd:string" />
43
  <element name="store_url_secure" type="xsd:string" />
44
+ <element name="ga_account" type="xsd:string" />
45
+ <element name="ga_account" type="xsd:string" />
46
+ <element name="kaas_module_version" type="xsd:string" />
47
  </all>
48
  </complexType>
49
  <complexType name="kaasStoreEntityArray">
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>getready_kaas</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL-v3</license>
7
  <channel>community</channel>
@@ -9,11 +9,13 @@
9
  <summary>Koongo is the ultimate Feed and Affiliate Marketing Tool that allows integration of electronic stores with more 500+ product aggregators, affiliate networks and selling channels worldwide.</summary>
10
  <description>Koongo is the ultimate feed marketing tool that streamlines the process of the product export from e-stores to various product search and price comparison websites, affiliate networks and selling channels. Since Koongo doesn&#x2019;t require any programming skills it allows online retailers and merchants to reach seamlessly hundreds of new marketing channels from around the world from a single integration point. Hence, Koongo is capable of bringing millions of new prospective customers to online stores of merchants and can increase store revenues by up to 25%! In addition, through the support of 500+ selling channels from more than 40 countries worldwide Koongo simplifies the process of expanding online businesses behind the borders of one country (i.e. cross-border selling).</description>
11
  <notes>The release fixed: &#xD;
12
- - MEKCFM-7 Magento API - remove unprintable chars</notes>
 
 
13
  <authors><author><name>GetReady Team</name><user>getreadycz</user><email>info@getready.cz</email></author></authors>
14
- <date>2016-08-24</date>
15
- <time>08:41:01</time>
16
- <contents><target name="magecommunity"><dir name="Getready"><dir name="Kaas"><dir name="Helper"><dir name="Activity"><file name="Data.php" hash="f740db9b7cf37539c30ce8766120099e"/></dir><dir name="Category"><dir name="Cache"><file name="Data.php" hash="f58b176ea2aafaf6379b3a8032807c9a"/></dir><file name="Data.php" hash="cdfcb801765cfdcb0fc29324e0f83c79"/></dir><file name="Data.php" hash="396a79d8e2d1bc921d16853a8810be6f"/><dir name="Product"><dir name="Category"><file name="Data.php" hash="3b0d25221ea5470e74e18f3d95c65f3e"/></dir><file name="Data.php" hash="2f0d8223518969a1c7dc1174449d7bfb"/><dir name="Store"><file name="Data.php" hash="4f7520c7735e8a74c2f31108af0292d1"/></dir></dir><dir name="Store"><file name="Data.php" hash="dd6761eabe99f38e1bee0b8970d79ad1"/></dir></dir><dir name="Model"><dir name="Activity"><dir name="Api"><file name="V2.php" hash="95991dd5a89815c25b3452b504ddc724"/></dir><file name="Api.php" hash="9d2cc4613c946121339947c3f6d309d1"/></dir><file name="Activity.php" hash="5c66680b60ed77a43b72f7f48fc5a388"/><dir name="Category"><dir name="Api"><file name="V2.php" hash="3b630df6b4db280474c101739e845cf1"/></dir><file name="Api.php" hash="168fb674acfd68ab8783272cc6451b05"/></dir><dir name="Mysql4"><dir name="Activity"><file name="Collection.php" hash="07ca00fd1d671851a2cda075f43d1edf"/></dir><file name="Activity.php" hash="df1ee06c9f0d5b51f351a770056bc6cc"/></dir><file name="Observer.php" hash="86a5f75f45e6fa3a24aa3c0f48167ca3"/><dir name="Product"><dir name="Api"><file name="V2.php" hash="d897bffbb6828432959552242970309c"/></dir><file name="Api.php" hash="2412f1942067b954ddf69b106c6b5e0d"/></dir><dir name="Store"><dir name="Api"><file name="V2.php" hash="80c4a43f1f06448dc4a615ba4faa4380"/></dir><file name="Api.php" hash="77ec017377e44735cba6c3b87b2d40d6"/></dir></dir><dir name="etc"><file name="api.xml" hash="a3837ad74ac6d25f3486d1f8c174bf98"/><file name="config.xml" hash="61788895e8cfca614bf87015c948e860"/><file name="wsdl.xml" hash="49baf43dfcb1e8f5726de0d2ac9cea5a"/></dir><dir name="sql"><dir name="kaas_setup"><file name="mysql4-install-1.0.0.php" hash="74ddd3718f91c81735c47aee48781e13"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Getready_Kaas.xml" hash="0ad572c56eb98c83337dcaf2f1f2053f"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>getready_kaas</name>
4
+ <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL-v3</license>
7
  <channel>community</channel>
9
  <summary>Koongo is the ultimate Feed and Affiliate Marketing Tool that allows integration of electronic stores with more 500+ product aggregators, affiliate networks and selling channels worldwide.</summary>
10
  <description>Koongo is the ultimate feed marketing tool that streamlines the process of the product export from e-stores to various product search and price comparison websites, affiliate networks and selling channels. Since Koongo doesn&#x2019;t require any programming skills it allows online retailers and merchants to reach seamlessly hundreds of new marketing channels from around the world from a single integration point. Hence, Koongo is capable of bringing millions of new prospective customers to online stores of merchants and can increase store revenues by up to 25%! In addition, through the support of 500+ selling channels from more than 40 countries worldwide Koongo simplifies the process of expanding online businesses behind the borders of one country (i.e. cross-border selling).</description>
11
  <notes>The release fixed: &#xD;
12
+ - changed signature of kaasProductListIds&#xD;
13
+ - added posibility to filter ids in kaasProductListIds&#xD;
14
+ - added posibility to filter by category_id</notes>
15
  <authors><author><name>GetReady Team</name><user>getreadycz</user><email>info@getready.cz</email></author></authors>
16
+ <date>2017-03-29</date>
17
+ <time>08:33:27</time>
18
+ <contents><target name="magecommunity"><dir name="Getready"><dir name="Kaas"><dir name="Helper"><dir name="Activity"><file name="Data.php" hash="f740db9b7cf37539c30ce8766120099e"/></dir><dir name="Category"><dir name="Cache"><file name="Data.php" hash="f58b176ea2aafaf6379b3a8032807c9a"/></dir><file name="Data.php" hash="cdfcb801765cfdcb0fc29324e0f83c79"/></dir><file name="Data.php" hash="6bc2133a7fc551e3c8d04bfbd2cdc946"/><dir name="Product"><dir name="Category"><file name="Data.php" hash="3b0d25221ea5470e74e18f3d95c65f3e"/></dir><file name="Data.php" hash="2f0d8223518969a1c7dc1174449d7bfb"/><dir name="Store"><file name="Data.php" hash="4f7520c7735e8a74c2f31108af0292d1"/></dir></dir><dir name="Store"><file name="Data.php" hash="ebf770b5a296aa8add7876625b89a0e0"/></dir></dir><dir name="Model"><dir name="Activity"><dir name="Api"><file name="V2.php" hash="95991dd5a89815c25b3452b504ddc724"/></dir><file name="Api.php" hash="9d2cc4613c946121339947c3f6d309d1"/></dir><file name="Activity.php" hash="5c66680b60ed77a43b72f7f48fc5a388"/><dir name="Category"><dir name="Api"><file name="V2.php" hash="3b630df6b4db280474c101739e845cf1"/></dir><file name="Api.php" hash="168fb674acfd68ab8783272cc6451b05"/></dir><dir name="Mysql4"><dir name="Activity"><file name="Collection.php" hash="07ca00fd1d671851a2cda075f43d1edf"/></dir><file name="Activity.php" hash="df1ee06c9f0d5b51f351a770056bc6cc"/></dir><file name="Observer.php" hash="86a5f75f45e6fa3a24aa3c0f48167ca3"/><dir name="Product"><dir name="Api"><file name="V2.php" hash="d897bffbb6828432959552242970309c"/></dir><file name="Api.php" hash="6bfb6b7e9f037524ca018de5218979ec"/></dir><dir name="Store"><dir name="Api"><file name="V2.php" hash="80c4a43f1f06448dc4a615ba4faa4380"/></dir><file name="Api.php" hash="77ec017377e44735cba6c3b87b2d40d6"/></dir></dir><dir name="etc"><file name="api.xml" hash="a3837ad74ac6d25f3486d1f8c174bf98"/><file name="config.xml" hash="8f03e1b85d2f96dcd23305526fa916b1"/><file name="wsdl.xml" hash="9dfd0b95622c8d3d1c0e01ec4ec3d935"/></dir><dir name="sql"><dir name="kaas_setup"><file name="mysql4-install-1.0.0.php" hash="74ddd3718f91c81735c47aee48781e13"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Getready_Kaas.xml" hash="0ad572c56eb98c83337dcaf2f1f2053f"/></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>