getready_kaas - Version 1.0.0

Version Notes

This release adds new SOAP methods allowing integration between Koongo service and Magento application.

Download this release

Release Info

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


Version 1.0.0

Files changed (26) hide show
  1. app/code/community/Getready/Kaas/Helper/Activity/Data.php +291 -0
  2. app/code/community/Getready/Kaas/Helper/Category/Cache/Data.php +51 -0
  3. app/code/community/Getready/Kaas/Helper/Category/Data.php +162 -0
  4. app/code/community/Getready/Kaas/Helper/Data.php +29 -0
  5. app/code/community/Getready/Kaas/Helper/Product/Category/Data.php +188 -0
  6. app/code/community/Getready/Kaas/Helper/Product/Data.php +441 -0
  7. app/code/community/Getready/Kaas/Helper/Product/Store/Data.php +92 -0
  8. app/code/community/Getready/Kaas/Helper/Store/Data.php +88 -0
  9. app/code/community/Getready/Kaas/Model/Activity.php +35 -0
  10. app/code/community/Getready/Kaas/Model/Activity/Api.php +62 -0
  11. app/code/community/Getready/Kaas/Model/Activity/Api/V2.php +30 -0
  12. app/code/community/Getready/Kaas/Model/Category/Api.php +101 -0
  13. app/code/community/Getready/Kaas/Model/Category/Api/V2.php +30 -0
  14. app/code/community/Getready/Kaas/Model/Mysql4/Activity.php +34 -0
  15. app/code/community/Getready/Kaas/Model/Mysql4/Activity/Collection.php +35 -0
  16. app/code/community/Getready/Kaas/Model/Observer.php +93 -0
  17. app/code/community/Getready/Kaas/Model/Product/Api.php +173 -0
  18. app/code/community/Getready/Kaas/Model/Product/Api/V2.php +30 -0
  19. app/code/community/Getready/Kaas/Model/Store/Api.php +76 -0
  20. app/code/community/Getready/Kaas/Model/Store/Api/V2.php +30 -0
  21. app/code/community/Getready/Kaas/etc/api.xml +190 -0
  22. app/code/community/Getready/Kaas/etc/config.xml +115 -0
  23. app/code/community/Getready/Kaas/etc/wsdl.xml +498 -0
  24. app/code/community/Getready/Kaas/sql/kaas_setup/mysql4-install-1.0.0.php +21 -0
  25. app/etc/modules/Getready_Kaas.xml +27 -0
  26. package.xml +18 -0
app/code/community/Getready/Kaas/Helper/Activity/Data.php ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Helper_Activity_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+ protected $_storeIds = null;
29
+
30
+ public function getActivityFeed($store)
31
+ {
32
+ $activity_feed = array();
33
+
34
+ $store_id = $store->getId();
35
+
36
+ $collection = $this->getActivityCollection($store_id);
37
+ foreach($collection as $item)
38
+ {
39
+ $activity_feed[] = array(
40
+ 'entity_id' => (int)$item->getProductId(),
41
+ 'action' => $item->getaction()
42
+ );
43
+ }
44
+
45
+ return $activity_feed;
46
+ }
47
+
48
+ public function getAllStoreIds()
49
+ {
50
+ if($this->_storeIds == null)
51
+ {
52
+ $stores = Mage::app()->getStores();
53
+
54
+ $ids = array();
55
+ foreach ($stores as $store) {
56
+ $ids[] = $store->getId();
57
+ }
58
+
59
+ $this->_storeIds = $ids;
60
+ }
61
+ return $this->_storeIds;
62
+ }
63
+
64
+ public function createUpdateActivity($store_id,$product_id)
65
+ {
66
+ if($product_id)
67
+ {
68
+ try
69
+ {
70
+ $resource = Mage::getSingleton('core/resource');
71
+ $write_connection = $resource->getConnection('core_write');
72
+ $table_name = $resource->getTableName('getready_kaas_activity');
73
+
74
+ $action = 'update';
75
+ $created_at = now();
76
+ $data = array();
77
+
78
+ if($store_id)
79
+ {
80
+ //delete all activity by product id for specific store
81
+ $sql = "DELETE FROM `{$table_name}` WHERE store_id = :store_id AND product_id = :product_id ";
82
+ $binds = array(
83
+ 'store_id' => $store_id,
84
+ 'product_id' => $product_id,
85
+ );
86
+ $write_connection->query($sql, $binds);
87
+
88
+ $data[] = array(
89
+ 'store_id' => $store_id,
90
+ 'product_id' => $product_id,
91
+ 'action' => $action,
92
+ 'created_at' => $created_at
93
+ );
94
+ }
95
+ elseif($store_id == 0)
96
+ {
97
+ //delete all activity by product id for all stores
98
+ $sql = "DELETE FROM `{$table_name}` WHERE product_id = :product_id ";
99
+ $binds = array(
100
+ 'product_id' => $product_id,
101
+ );
102
+ $write_connection->query($sql, $binds);
103
+
104
+ foreach($this->getAllStoreIds() as $_store_id)
105
+ {
106
+ $data[] = array(
107
+ 'store_id' => $_store_id,
108
+ 'product_id' => $product_id,
109
+ 'action' => $action,
110
+ 'created_at' => $created_at
111
+ );
112
+ }
113
+ }
114
+
115
+ if(count($data) > 0)
116
+ {
117
+ $write_connection->insertMultiple($table_name, $data);
118
+ }
119
+ }
120
+ catch (Exception $e)
121
+ {
122
+ Mage::logException($e);
123
+ }
124
+ }
125
+ }
126
+
127
+ public function createDeleteActivity($product_id)
128
+ {
129
+ if($product_id)
130
+ {
131
+ try
132
+ {
133
+ $resource = Mage::getSingleton('core/resource');
134
+ $write_connection = $resource->getConnection('core_write');
135
+ $table_name = $resource->getTableName('getready_kaas_activity');
136
+
137
+ //delete all activity by product id
138
+ $sql = "DELETE FROM `{$table_name}` WHERE product_id = :product_id ";
139
+ $binds = array(
140
+ 'product_id' => $product_id,
141
+ );
142
+ $write_connection->query($sql, $binds);
143
+
144
+
145
+ //add for all stores
146
+ $action = 'delete';
147
+ $created_at = now();
148
+ $data = array();
149
+ foreach($this->getAllStoreIds() as $store_id)
150
+ {
151
+ $data[] = array(
152
+ 'store_id' => $store_id,
153
+ 'product_id' => $product_id,
154
+ 'action' => $action,
155
+ 'created_at' => $created_at
156
+ );
157
+ }
158
+ if(count($data) > 0)
159
+ {
160
+ $write_connection->insertMultiple($table_name, $data);
161
+ }
162
+ }
163
+ catch (Exception $e)
164
+ {
165
+ Mage::logException($e);
166
+ }
167
+ }
168
+ }
169
+
170
+ public function createStockActivity($quote_items)
171
+ {
172
+ try
173
+ {
174
+ $resource = Mage::getSingleton('core/resource');
175
+ $write_connection = $resource->getConnection('core_write');
176
+ $table_name = $resource->getTableName('getready_kaas_activity');
177
+
178
+ $store_ids = $this->getAllStoreIds();
179
+
180
+ $products_ids = array();
181
+ foreach($quote_items as $item)
182
+ {
183
+ $products_ids[] = $item->getProductId();
184
+ }
185
+
186
+ //delete all activity by product ids
187
+ if(count($products_ids) > 0)
188
+ {
189
+ $product_ids_string = implode(',', $products_ids);
190
+ $sql = "DELETE FROM `{$table_name}` WHERE product_id IN (:product_ids)";
191
+ $binds = array(
192
+ 'product_ids' => $product_ids_string,
193
+ );
194
+ $write_connection->query($sql, $binds);
195
+ }
196
+
197
+
198
+ //add new activities
199
+ $action = 'update';
200
+ $created_at = now();
201
+ $data = array();
202
+ foreach($quote_items as $item)
203
+ {
204
+ $_product_id = $item->getProductId();
205
+ foreach($store_ids as $_store_id)
206
+ {
207
+ $data[] = array(
208
+ 'store_id' => $_store_id,
209
+ 'product_id' => $_product_id,
210
+ 'action' => $action,
211
+ 'created_at' => $created_at
212
+ );
213
+ }
214
+ }
215
+ if(count($data) > 0)
216
+ {
217
+ $write_connection->insertMultiple($table_name, $data);
218
+ }
219
+ }
220
+ catch (Exception $e)
221
+ {
222
+ Mage::logException($e);
223
+ }
224
+ }
225
+
226
+ public function deleteProductActivity($store_id,$product_id)
227
+ {
228
+ if($store_id && $product_id)
229
+ {
230
+ try
231
+ {
232
+ $resource = Mage::getSingleton('core/resource');
233
+ $write_connection = $resource->getConnection('core_write');
234
+ $table_name = $resource->getTableName('getready_kaas_activity');
235
+
236
+ $sql = "DELETE FROM `{$table_name}` WHERE store_id = :store_id AND product_id = :product_id ";
237
+ $binds = array(
238
+ 'store_id' => $store_id,
239
+ 'product_id' => $product_id,
240
+ );
241
+ $write_connection->query($sql, $binds);
242
+ }
243
+ catch (Exception $e)
244
+ {
245
+ Mage::logException($e);
246
+ }
247
+ }
248
+ }
249
+
250
+ public function getActivityCollection($store_id)
251
+ {
252
+ $collection = Mage::getModel('kaas/activity')->getCollection();
253
+ $collection->addFieldToFilter('store_id', $store_id);
254
+
255
+ //$collection->addFieldToFilter('store_id', array('in' => array(0,$store_id)) );
256
+
257
+ return $collection;
258
+ }
259
+
260
+ public function clearActivityFeed($store)
261
+ {
262
+ $clered = false;
263
+
264
+ $store_id = $store->getId();
265
+
266
+ if($store_id)
267
+ {
268
+ try
269
+ {
270
+ $resource = Mage::getSingleton('core/resource');
271
+ $write_connection = $resource->getConnection('core_write');
272
+ $table_name = $resource->getTableName('getready_kaas_activity');
273
+
274
+ $sql = "DELETE FROM `{$table_name}` WHERE store_id = :store_id ";
275
+ $binds = array(
276
+ 'store_id' => $store_id,
277
+ );
278
+ $write_connection->query($sql, $binds);
279
+ $clered = true;
280
+ }
281
+ catch (Exception $e)
282
+ {
283
+ Mage::logException($e);
284
+ }
285
+
286
+ }
287
+
288
+ return $clered;
289
+ }
290
+
291
+ }
app/code/community/Getready/Kaas/Helper/Category/Cache/Data.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Helper_Category_Cache_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+ protected $_categories = array();
29
+
30
+ public function loadCategory($category_id)
31
+ {
32
+ $category = Mage::getModel('catalog/category')->load($category_id);
33
+ return $category;
34
+ }
35
+
36
+ public function getCategory($category_id)
37
+ {
38
+ $category = null;
39
+ if(isset($this->_categories[$category_id]))
40
+ {
41
+ $category = $this->_categories[$category_id];
42
+ }
43
+ else
44
+ {
45
+ $category = $this->loadCategory($category_id);
46
+ $this->_categories[$category_id] = $category;
47
+ }
48
+ return $category;
49
+ }
50
+
51
+ }
app/code/community/Getready/Kaas/Helper/Category/Data.php ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Helper_Category_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+
29
+ public function getCategoryInfo($category,$root_level = 0)
30
+ {
31
+ $category_info = array(
32
+ 'category_id' => '',
33
+ 'url' => '',
34
+ 'path' => '',
35
+ 'path_ids' => '',
36
+ 'path_url_key' => '',
37
+ 'level' => '',
38
+ 'parent_id' => '',
39
+ 'parent_name' => '',
40
+ 'root_id' => '',
41
+ 'root_name' => '',
42
+ 'description' => '',
43
+ 'name' => '',
44
+ );
45
+
46
+
47
+ //general
48
+ $category_info['category_id'] = $category->getId();
49
+
50
+ //kaas
51
+ $category_info['url'] = $category->getUrl();
52
+
53
+ $category_path_ids = $this->formatPathIdsForRootCategory($category->getPath(),$root_level);
54
+
55
+ $category_info['path'] = $this->getCategoryPath($category_path_ids);
56
+ $category_info['path_ids'] = $category_path_ids;
57
+ $category_info['path_url_key'] = $this->getCategoryUrlKey($category_path_ids);
58
+
59
+ $level = $this->formatLevelForRootCategory($category->getLevel(),$root_level);
60
+ $category_info['level'] = $level;
61
+ if($level == $root_level)
62
+ {
63
+ $category_info['parent_id'] = null;
64
+ $category_info['parent_name'] = null;
65
+ $category_info['root_id'] = $category->getId();
66
+ $category_info['root_name'] = $category->getName();
67
+ }
68
+ else
69
+ {
70
+
71
+ $parent_id = $category->getParentId();
72
+ $category_info['parent_id'] = $parent_id;
73
+ $category_info['parent_name'] = $this->getCategoryName($parent_id);
74
+ $root_id = $this->getRootId($category_path_ids);
75
+ $category_info['root_id'] = $root_id;
76
+ $category_info['root_name'] = $this->getCategoryName($root_id);
77
+ }
78
+
79
+ $category_info['description'] = $category->getDescription();
80
+ $category_info['name'] = $category->getName();
81
+
82
+ return $category_info;
83
+ }
84
+
85
+ public function getCategory($category_id)
86
+ {
87
+ return Mage::Helper('kaas_category_cache')->getCategory($category_id);
88
+ }
89
+
90
+ public function formatPathIdsForRootCategory($category_path_ids, $root_level)
91
+ {
92
+ $formated_path_ids = $category_path_ids;
93
+ $path_ids_array = explode('/', $category_path_ids);
94
+ if(!empty($path_ids_array))
95
+ {
96
+ for($i=0;$i < $root_level;$i++)
97
+ {
98
+ unset($path_ids_array[$i]);
99
+ }
100
+ $formated_path_ids = implode('/', $path_ids_array);
101
+ }
102
+ return $formated_path_ids;
103
+ }
104
+
105
+ public function formatLevelForRootCategory($level, $root_level)
106
+ {
107
+ $formated_level = $level;
108
+ if($root_level > 1)
109
+ {
110
+ $formated_level = $level - $root_level + 1;
111
+ }
112
+ return $formated_level;
113
+ }
114
+
115
+ public function getCategoryPath($category_path_ids)
116
+ {
117
+ $category_path_array = array();
118
+ $path_ids_array = explode('/', $category_path_ids);
119
+ foreach($path_ids_array as $_category_id)
120
+ {
121
+ $category = $this->getCategory($_category_id);
122
+ $category_path_array[] = $category->getName();
123
+ }
124
+ $category_path = implode('/', $category_path_array);
125
+ return $category_path;
126
+ }
127
+
128
+ public function getCategoryUrlKey($category_path_ids)
129
+ {
130
+ $category_url_key_array = array();
131
+ $path_ids_array = explode('/', $category_path_ids);
132
+ foreach($path_ids_array as $_category_id)
133
+ {
134
+ $category = $this->getCategory($_category_id);
135
+ $category_url_key_array[] = $category->getUrlKey();
136
+ }
137
+ $category_url_key = implode('/', $category_url_key_array);
138
+ return $category_url_key;
139
+ }
140
+
141
+ public function getCategoryName($parent_id)
142
+ {
143
+ $parent_name = '';
144
+ $category = $this->getCategory($parent_id);
145
+ if($category->getId())
146
+ {
147
+ $parent_name = $category->getName();
148
+ }
149
+ return $parent_name;
150
+ }
151
+
152
+ public function getRootId($category_path_ids)
153
+ {
154
+ $path_ids_array = explode('/', $category_path_ids);
155
+ if(!empty($path_ids_array))
156
+ {
157
+ $root_id = $path_ids_array[0];
158
+ }
159
+ return $root_id;
160
+ }
161
+
162
+ }
app/code/community/Getready/Kaas/Helper/Data.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Helper_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+
29
+ }
app/code/community/Getready/Kaas/Helper/Product/Category/Data.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Helper_Product_Category_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+ protected $_categories = array();
29
+ protected $_generated_categories = array();
30
+
31
+ public function getCategoryInfo($category_id)
32
+ {
33
+ $category_info = array();
34
+ if(isset($this->_generated_categories[$category_id]))
35
+ {
36
+ $category_info = $this->_generated_categories[$category_id];
37
+ }
38
+ else
39
+ {
40
+ $category_info = $this->_generateCategoryInfo($category_id);
41
+ $this->_generated_categories[$category_id] = $category_info;
42
+ }
43
+ return $category_info;
44
+ }
45
+
46
+ public function _generateCategoryInfo($category_id)
47
+ {
48
+ $root_level = 1;
49
+ $category_info = array(
50
+ 'id' => '',
51
+ 'name' => '',
52
+ 'path_ids' => '',
53
+ 'level' => '',
54
+ 'parent_id' => '',
55
+ 'parent_name' => '',
56
+ 'url' => '',
57
+ 'path_url_key' => '',
58
+ 'path' => '',
59
+ 'root_id' => '',
60
+ 'root_name' => '',
61
+ );
62
+
63
+ $category = $this->_getCategory($category_id);
64
+ if($category->getId())
65
+ {
66
+ $category_info['id'] = $category->getId();
67
+ $category_info['name'] = $category->getName();
68
+ $category_info['url'] = $category->getUrl();
69
+
70
+ $category_path_ids = $this->_formatPathIdsForRootCategory($category->getPath(),$root_level);
71
+
72
+ $category_info['path_ids'] = $category_path_ids;
73
+ $category_info['path_url_key'] = $this->_getCategoryUrlKey($category_path_ids);
74
+ $category_info['path'] = $this->_getCategoryPath($category_path_ids);
75
+
76
+ $level = $this->_formatLevelForRootCategory($category->getLevel(),$root_level);
77
+ $category_info['level'] = $level;
78
+
79
+ if($level == $root_level)
80
+ {
81
+ $category_info['parent_id'] = null;
82
+ $category_info['parent_name'] = null;
83
+
84
+ $category_info['root_id'] = $category->getId();
85
+ $category_info['root_name'] = $category->getName();
86
+ }
87
+ else
88
+ {
89
+ $parent_id = $category->getParentId();
90
+ $category_info['parent_id'] = $parent_id;
91
+ $category_info['parent_name'] = $this->_getParentCategoryName($parent_id);
92
+
93
+ $root_id = $this->_getRootId($category_path_ids);
94
+ $category_info['root_id'] = $root_id;
95
+ $category_info['root_name'] = $this->_getParentCategoryName($root_id);
96
+ }
97
+ }
98
+
99
+ return $category_info;
100
+ }
101
+
102
+ public function _getCategory($category_id)
103
+ {
104
+ $category = null;
105
+ if(isset($this->_categories[$category_id]))
106
+ {
107
+ $category = $this->_categories[$category_id];
108
+ }
109
+ else
110
+ {
111
+ $category = Mage::getModel('catalog/category')->load($category_id);
112
+ $this->_categories[$category_id] = $category;
113
+ }
114
+ return $category;
115
+ }
116
+
117
+ public function _formatPathIdsForRootCategory($category_path_ids, $root_level)
118
+ {
119
+ $formated_path_ids = $category_path_ids;
120
+ $path_ids_array = explode('/', $category_path_ids);
121
+ if(!empty($path_ids_array))
122
+ {
123
+ for($i=0;$i < $root_level;$i++)
124
+ {
125
+ unset($path_ids_array[$i]);
126
+ }
127
+ $formated_path_ids = implode('/', $path_ids_array);
128
+ }
129
+ return $formated_path_ids;
130
+ }
131
+
132
+ public function _formatLevelForRootCategory($level, $root_level)
133
+ {
134
+ $formated_level = $level;
135
+ if($root_level > 1)
136
+ {
137
+ $formated_level = $level - $root_level + 1;
138
+ }
139
+ return $formated_level;
140
+ }
141
+
142
+ public function _getCategoryPath($category_path_ids)
143
+ {
144
+ $category_path_array = array();
145
+ $path_ids_array = explode('/', $category_path_ids);
146
+ foreach($path_ids_array as $_category_id)
147
+ {
148
+ $category = $this->_getCategory($_category_id);
149
+ $category_path_array[] = $category->getName();
150
+ }
151
+ $category_path = implode('/', $category_path_array);
152
+ return $category_path;
153
+ }
154
+
155
+ public function _getCategoryUrlKey($category_path_ids)
156
+ {
157
+ $category_url_key_array = array();
158
+ $path_ids_array = explode('/', $category_path_ids);
159
+ foreach($path_ids_array as $_category_id)
160
+ {
161
+ $category = $this->_getCategory($_category_id);
162
+ $category_url_key_array[] = $category->getUrlKey();
163
+ }
164
+ $category_url_key = implode('/', $category_url_key_array);
165
+ return $category_url_key;
166
+ }
167
+
168
+ public function _getParentCategoryName($parent_id)
169
+ {
170
+ $parent_name = '';
171
+ $category = $this->_getCategory($parent_id);
172
+ if($category->getId())
173
+ {
174
+ $parent_name = $category->getName();
175
+ }
176
+ return $parent_name;
177
+ }
178
+
179
+ public function _getRootId($category_path_ids)
180
+ {
181
+ $path_ids_array = explode('/', $category_path_ids);
182
+ if(!empty($path_ids_array))
183
+ {
184
+ $root_id = $path_ids_array[0];
185
+ }
186
+ return $root_id;
187
+ }
188
+ }
app/code/community/Getready/Kaas/Helper/Product/Data.php ADDED
@@ -0,0 +1,441 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Helper_Product_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+ public function getProductInfo($product)
29
+ {
30
+ $product_info = array(
31
+ //header
32
+ 'product_id' => '',
33
+ 'group_id' => '',
34
+ 'url' => '',
35
+ 'created_at' => array('sec' => '', 'usec' => ''),
36
+ 'creation_datetime' => '',
37
+ 'creation_date' => '',
38
+ 'creation_time' => '',
39
+ 'updated_at' => array('sec' => '', 'usec' => ''),
40
+ 'updated_datetime' => '',
41
+ 'updated_date' => '',
42
+ 'updated_time' => '',
43
+ 'is_visible' => '',
44
+ 'is_parent' => '',
45
+ 'is_child' => '',
46
+ //flat
47
+ 'flat' => array(),
48
+ //price
49
+ 'price_original_include_tax' => '',
50
+ 'price_original_exclude_tax' => '',
51
+ 'price_final_include_tax' => '',
52
+ 'price_final_exclude_tax' => '',
53
+ 'price_cost' => '',
54
+ 'tax_percent' => '',
55
+ 'discount' => '',
56
+ //invertory
57
+ 'qty' => 0,
58
+ 'stock_status' => false,
59
+ //media
60
+ 'gallery' => array(),
61
+ //category
62
+ 'category' => array(),
63
+ 'children' => array(),
64
+ );
65
+
66
+ //header
67
+ $product_info['product_id'] = $product->getId();
68
+ /* TODO */$product_info['group_id'] = $this->_getGroupId($product);
69
+ $product_info['url'] = $product->getProductUrl();
70
+ $created_at = $product->getCreatedAt();
71
+
72
+ $product_info['created_at'] = array(
73
+ 'sec' => strtotime($created_at),
74
+ 'usec' => 0
75
+ );
76
+ $product_info['creation_datetime'] = date('Y-m-d H:i:s', strtotime($created_at));
77
+ $product_info['creation_date'] = date('Y-m-d', strtotime($created_at));
78
+ $product_info['creation_time'] = date('H:i:s', strtotime($created_at));
79
+
80
+ $updated_at = $product->getUpdatedAt();
81
+ $product_info['updated_at'] = array(
82
+ 'sec' => strtotime($updated_at),
83
+ 'usec' => 0
84
+ );
85
+ $product_info['updated_datetime'] = date('Y-m-d H:i:s', strtotime($updated_at));
86
+ $product_info['updated_date'] = date('Y-m-d', strtotime($updated_at));
87
+ $product_info['updated_time'] = date('H:i:s', strtotime($updated_at));
88
+
89
+ $visibility = false;
90
+ if($product->getVisibility() == '2' || $product->getVisibility() == '4')
91
+ {
92
+ $visibility = true;
93
+ }
94
+ $product_info['is_visible'] = $visibility;
95
+ $product_info['is_parent'] = $this->_isParent($product);
96
+ $product_info['is_child'] = $this->_isChild($product);
97
+
98
+ //flat
99
+ $flat_attributes = $this->_getFlatAttributes($product);
100
+ $product_info['flat'] = $flat_attributes;
101
+
102
+ //price
103
+ $prices = $this->_getPrices($product);
104
+
105
+ $product_info['price_original_include_tax'] = $prices['price_original_include_tax'];
106
+ $product_info['price_original_exclude_tax'] = $prices['price_original_exclude_tax'];
107
+ $product_info['price_final_include_tax'] = $prices['price_final_include_tax'];
108
+ $product_info['price_final_exclude_tax'] = $prices['price_final_exclude_tax'];
109
+ $product_info['price_cost'] = $prices['price_cost'];
110
+ $product_info['tax_percent'] = $prices['tax_percent'];
111
+ $product_info['discount'] = $prices['discount'];
112
+
113
+ //inventory
114
+ $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
115
+ $product_info['qty'] = (int)number_format($stock->getQty(),0);
116
+ $product_info['stock_status'] = (boolean)$stock->getIsInStock();
117
+
118
+ //media
119
+ $product_info['gallery'] = $this->_getGallery($product);
120
+
121
+ //category
122
+ $product_info['category'] = $this->_getCategory($product);
123
+
124
+ //children
125
+ $product_info['children'] = $this->_getChildren($product);
126
+
127
+ return $product_info;
128
+ }
129
+
130
+ public function _getGroupId($product)
131
+ {
132
+ $group_id = 0; //$product->getId();
133
+
134
+ return $group_id;
135
+ }
136
+
137
+ public function _isParent($product)
138
+ {
139
+ $is_parent = false;
140
+ $product_id = $product->getId();
141
+
142
+ if($product->getTypeId() != 'simple' )
143
+ {
144
+ $child_ids = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($product_id);
145
+ if(!$child_ids)
146
+ {
147
+ $child_ids = Mage::getModel('catalog/product_type_grouped')->getChildrenIds($product_id);
148
+ }
149
+
150
+ // if(!$child_ids)
151
+ // {
152
+ // $child_ids = Mage::getModel('bundle/product_type')->getChildrenIds($product_id);
153
+ // }
154
+
155
+ if($child_ids)
156
+ {
157
+ $is_parent = true;
158
+ }
159
+ }
160
+
161
+ return $is_parent;
162
+ }
163
+
164
+ public function _isChild($product)
165
+ {
166
+ $is_child = false;
167
+ $product_id = $product->getId();
168
+
169
+ if($product->getTypeId() == 'simple' )
170
+ {
171
+ $parent_ids = Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($product_id);
172
+ if(!$parent_ids)
173
+ {
174
+ $parent_ids = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product_id);
175
+ }
176
+
177
+ // if(!$parent_ids)
178
+ // {
179
+ // $parent_ids = $parent_ids = Mage::getModel('bundle/product_type')->getParentIdsByChild($product_id);
180
+ // }
181
+
182
+ if($parent_ids)
183
+ {
184
+ $is_child = true;
185
+ }
186
+ }
187
+
188
+ return $is_child;
189
+ }
190
+
191
+ public function _getChildren($product)
192
+ {
193
+ $children = array();
194
+ $product_id = $product->getId();
195
+
196
+ if($product->getTypeId() != 'simple' )
197
+ {
198
+ $conf_child_ids = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($product_id);
199
+ if(isset($conf_child_ids[0]))
200
+ {
201
+ $child_ids = $conf_child_ids[0];
202
+ foreach($child_ids as $child_id)
203
+ {
204
+ $children[] = $child_id;
205
+ }
206
+ }
207
+
208
+ $group_child_ids = Mage::getModel('catalog/product_type_grouped')->getChildrenIds($product_id);
209
+ if(isset($group_child_ids[Mage_Catalog_Model_Product_Link::LINK_TYPE_GROUPED]))
210
+ {
211
+ $child_ids = $group_child_ids[Mage_Catalog_Model_Product_Link::LINK_TYPE_GROUPED];
212
+ foreach($child_ids as $child_id)
213
+ {
214
+ $children[] = $child_id;
215
+ }
216
+ }
217
+
218
+ // $bundle_child_ids = Mage::getModel('bundle/product_type')->getChildrenIds($product_id);
219
+ // foreach($bundle_child_ids as $child_id)
220
+ // {
221
+ // $children[] = $child_id;
222
+ // }
223
+ }
224
+
225
+ return $children;
226
+ }
227
+
228
+ public function _getFlatAttributes($product)
229
+ {
230
+ $flat_attributes = array();
231
+ $attributes = $product->getAttributes();
232
+ $not_exported_attributes_codes = array(
233
+ 'type_id',
234
+ 'entity_id',
235
+ 'attribute_set_id',
236
+ 'entity_type_id',
237
+ 'old_id',
238
+ 'url_path',
239
+ 'category_ids',
240
+ 'required_options',
241
+ 'has_options',
242
+ 'created_at',
243
+ 'updated_at',
244
+ 'media_gallery',
245
+ 'gallery',
246
+ 'custom_design',
247
+ 'custom_design_from',
248
+ 'custom_design_to',
249
+ 'custom_layout_update',
250
+ 'page_layout',
251
+ 'options_container',
252
+ 'thumbnail_label',
253
+ 'image_label',
254
+ 'small_image_label'
255
+ );
256
+ foreach ($attributes as $attribute) {
257
+
258
+ $attributeCode = $attribute->getAttributeCode();
259
+ if (!in_array($attributeCode, $not_exported_attributes_codes))
260
+ {
261
+ $label = $attribute->getStoreLabel($product->getStoreId());
262
+ $value = $attribute->getFrontend()->getValue($product);
263
+
264
+ $flat_attribute = array(
265
+ 'code' => $attributeCode,
266
+ 'label' => $label,
267
+ 'value' => $this->_getProductAttributeValue($product,$attribute)
268
+ );
269
+
270
+ $flat_attributes[] = $flat_attribute;
271
+ }
272
+ }
273
+
274
+ return $flat_attributes;
275
+ }
276
+
277
+ public function _getProductAttributeValue($product,$attribute)
278
+ {
279
+ $formated_value = $attribute->getFrontend()->getValue($product);
280
+
281
+ $attributeCode = $attribute->getAttributeCode();
282
+ if($attributeCode == 'image')
283
+ {
284
+ $base_image = $product->getImage();
285
+ if($base_image)
286
+ {
287
+ $formated_value = Mage::getModel('catalog/product_media_config')->getMediaUrl( $base_image);
288
+ }
289
+ }
290
+ elseif($attributeCode == 'small_image')
291
+ {
292
+ $small_image = $product->getSmallImage();
293
+ if($small_image)
294
+ {
295
+ $formated_value = Mage::getModel('catalog/product_media_config')->getMediaUrl( $small_image);
296
+ }
297
+ }
298
+ elseif($attributeCode == 'thumbnail')
299
+ {
300
+ $thumbnail = $product->getThumbnail();
301
+ if($thumbnail)
302
+ {
303
+ $formated_value = Mage::getModel('catalog/product_media_config')->getMediaUrl( $thumbnail);
304
+ }
305
+ }
306
+
307
+ $backend_type = $attribute->getBackendType();
308
+ switch ($backend_type)
309
+ {
310
+ case 'decimal':
311
+ $formated_value = number_format($formated_value,2);
312
+ break;
313
+ }
314
+
315
+ return $formated_value;
316
+ }
317
+
318
+ public function _getPrices($product)
319
+ {
320
+ $prices = array(
321
+ 'price_original_include_tax' => 0,
322
+ 'price_original_exclude_tax' => 0,
323
+ 'price_final_include_tax' => 0,
324
+ 'price_final_exclude_tax' => 0,
325
+ 'price_cost' => 0,
326
+ 'tax_percent' => 0,
327
+ 'discount' => 0,
328
+ );
329
+
330
+ //price
331
+ $tax_helper = Mage::Helper('tax');
332
+
333
+ $_price = $product->getPrice();
334
+ $_final_price = $product->getFinalPrice();
335
+
336
+ $price = $tax_helper->getPrice($product, $_price);
337
+ $price_incl_tax = $tax_helper->getPrice($product, $_price, true);
338
+ $final_price = $tax_helper->getPrice($product, $_final_price);
339
+ $final_price_incl_tax = $tax_helper->getPrice($product, $_final_price, true);
340
+
341
+ $prices['price_original_include_tax'] = (double) $price_incl_tax; //number_format($price_incl_tax,2);
342
+ $prices['price_original_exclude_tax'] = (double) $price; //number_format($price,2);
343
+ $prices['price_final_include_tax'] = (double) $final_price_incl_tax; //number_format($final_price_incl_tax,2);
344
+ $prices['price_final_exclude_tax'] = (double) $final_price; //number_format($final_price,2);
345
+
346
+ //cost
347
+ $prices['price_cost'] = (double)number_format($product->getCost(),2);
348
+
349
+ //tax
350
+ $prices['tax_percent'] = (double)$this->_getTax($product);
351
+
352
+ //discount
353
+ $discount = abs((double)$price_incl_tax - (double)$final_price_incl_tax);
354
+ $prices['discount'] = (double)number_format($discount,2);
355
+
356
+ return $prices;
357
+ }
358
+
359
+ public function _getTax($product)
360
+ {
361
+ $tax = 0;
362
+ $store_id = $product->getStoreId();
363
+
364
+ if($store_id)
365
+ {
366
+ $store = Mage::app()->getStore($store_id);
367
+ if($store->getId())
368
+ {
369
+ $taxCalculation = Mage::getModel('tax/calculation');
370
+ $request = $taxCalculation->getRateRequest(null, null, null, $store);
371
+ $taxClassId = $product->getTaxClassId();
372
+ $tax = $taxCalculation->getRate($request->setProductClassId($taxClassId));
373
+ }
374
+ }
375
+ return $tax;
376
+ }
377
+
378
+ //nepouziva se
379
+ public function _getImages($product)
380
+ {
381
+ $images = array(
382
+ 'thumbnail' => '',
383
+ 'small_image' => '',
384
+ 'image' => ''
385
+ );
386
+
387
+ $thumbnail = $product->getThumbnail();
388
+ if($thumbnail)
389
+ {
390
+ $images['thumbnail'] = Mage::getModel('catalog/product_media_config')->getMediaUrl( $thumbnail); //(string)Mage::Helper('catalog/image')->init($product, 'thumbnail');
391
+ }
392
+ $small_image = $product->getSmallImage();
393
+ if($small_image)
394
+ {
395
+ $images['small_image'] = Mage::getModel('catalog/product_media_config')->getMediaUrl( $small_image); //(string)Mage::Helper('catalog/image')->init($product, 'small_image');
396
+ }
397
+ $base_image = $product->getImage();
398
+ if($base_image)
399
+ {
400
+ $images['image'] = Mage::getModel('catalog/product_media_config')->getMediaUrl( $base_image); //(string)Mage::Helper('catalog/image')->init($product, 'image');
401
+ }
402
+
403
+ return $images;
404
+ }
405
+
406
+ public function _getGallery($product)
407
+ {
408
+ $gallery = array();
409
+
410
+ foreach ($product->getMediaGalleryImages() as $image)
411
+ {
412
+ $product_image = array(
413
+ 'label' => $image->getLabel(),
414
+ 'thumbnail_image' => $image->getUrl(),
415
+ 'small_image' => $image->getUrl(),
416
+ 'base_image' => $image->getUrl(),
417
+ );
418
+ $gallery[] = $product_image;
419
+ }
420
+
421
+ return $gallery;
422
+ }
423
+
424
+ public function _getCategory($product)
425
+ {
426
+ $category = array();
427
+
428
+ $category_ids = $product->getCategoryIds();
429
+ foreach($category_ids as $category_id)
430
+ {
431
+ if(Mage::Helper('kaas_product_store')->isStoreCategory($category_id,$product->getStoreId()))
432
+ {
433
+ $category_info = Mage::Helper('kaas_product_category')->getCategoryInfo($category_id);
434
+ $category[] = $category_info;
435
+ }
436
+ }
437
+
438
+ return $category;
439
+ }
440
+
441
+ }
app/code/community/Getready/Kaas/Helper/Product/Store/Data.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Helper_Product_Store_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+ protected $_store_category_ids = array();
29
+ protected $_store_category_ids_loaded = false;
30
+
31
+ public function isStoreCategory($category_id, $store_id)
32
+ {
33
+ $is_store_category = false;
34
+ if(!$this->_store_category_ids_loaded)
35
+ {
36
+ $this->_loadStoreCategoryIds($store_id);
37
+ }
38
+ else
39
+ {
40
+ //log load not needed
41
+ }
42
+
43
+ if(in_array($category_id, $this->_store_category_ids))
44
+ {
45
+ $is_store_category = true;
46
+ }
47
+
48
+ return $is_store_category;
49
+ }
50
+
51
+ protected function _loadStoreCategoryIds($store_id)
52
+ {
53
+ $store_category_ids = array();
54
+ $store = Mage::app()->getStore($store_id);
55
+ if($store->getId())
56
+ {
57
+ $root_id = $store->getRootCategoryId();
58
+
59
+ /* @var $tree Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Tree */
60
+ $tree = Mage::getResourceSingleton('catalog/category_tree')->load();
61
+
62
+ $root = $tree->getNodeById($root_id);
63
+
64
+ $collection = Mage::getModel('catalog/category')->getCollection()
65
+ ->setStoreId($store_id)
66
+ ->addAttributeToSelect('name')
67
+ ->addAttributeToSelect('is_active');
68
+
69
+ $tree->addCollectionData($collection, true);
70
+
71
+ $store_category_ids = $this->_nodeToArray($root);
72
+ }
73
+
74
+
75
+ $this->_store_category_ids = $store_category_ids;
76
+ $this->_store_category_ids_loaded = true;
77
+ }
78
+
79
+ protected function _nodeToArray(Varien_Data_Tree_Node $node)
80
+ {
81
+ $result = array();
82
+ $category_id = $node->getId();
83
+
84
+ $result[] = $category_id;
85
+
86
+ foreach ($node->getChildren() as $child) {
87
+ $result = array_merge($result,$this->_nodeToArray($child));
88
+ }
89
+
90
+ return $result;
91
+ }
92
+ }
app/code/community/Getready/Kaas/Helper/Store/Data.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Helper_Store_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+ public function getStoreInfo($store)
29
+ {
30
+ $store_info = array(
31
+ 'store_id' => '',
32
+ 'code' => '',
33
+ 'website_id' => '',
34
+ 'group_id' => '',
35
+ 'name' => '',
36
+ 'sort_order' => '',
37
+ 'is_active' => '',
38
+ 'country' => '',
39
+ 'language' => '',
40
+ 'locale' => '',
41
+ 'currency' => '',
42
+ 'currency_symbol' => '',
43
+ 'timezone' => '',
44
+ 'store_url' => '',
45
+ 'store_url_secure' => '',
46
+ );
47
+
48
+ //general
49
+ $store_info['store_id'] = $store->getId();
50
+ $store_info['code'] = $store->getCode();
51
+ $store_info['website_id'] = $store->getWebsiteId();
52
+ $store_info['group_id'] = $store->getGroupId();
53
+ $store_info['name'] = $store->getName();
54
+ $store_info['sort_order'] = $store->getSortOrder();
55
+ $store_info['is_active'] = $store->getIsActive();
56
+
57
+ //kaas
58
+ $store_id = $store->getId();
59
+ $store_info['country'] = Mage::getStoreConfig('general/country/default', $store_id);
60
+ $store_info['language'] = strtoupper(substr(Mage::getStoreConfig('general/locale/code', $store_id),0,2));
61
+ $store_info['locale'] = Mage::getStoreConfig('general/locale/code', $store_id);
62
+ $currency = Mage::getStoreConfig('currency/options/default', $store_id);
63
+ $store_info['currency'] = $currency;
64
+ $store_info['currency_symbol'] = Mage::app()->getLocale()->currency($currency)->getSymbol();
65
+ //$timezone_string = Mage::getStoreConfig('general/locale/timezone', $store_id);
66
+ $date = Mage::app()->getLocale()->storeDate($store_id);
67
+ $store_info['timezone'] = $date->get(Zend_Date::GMT_DIFF);
68
+ $store_info['store_url'] = Mage::getStoreConfig('web/unsecure/base_url', $store_id);
69
+ $store_info['store_url_secure'] = Mage::getStoreConfig('web/secure/base_url', $store_id);
70
+
71
+
72
+ return $store_info;
73
+ }
74
+
75
+ public function getStoreByCode($store_code)
76
+ {
77
+ $store_id = null;
78
+ $stores = array_keys(Mage::app()->getStores());
79
+ foreach($stores as $id){
80
+ $store = Mage::app()->getStore($id);
81
+ if($store->getCode()==$store_code) {
82
+ $store_id = $id;
83
+ }
84
+ }
85
+
86
+ return Mage::app()->getStore($store_id);
87
+ }
88
+ }
app/code/community/Getready/Kaas/Model/Activity.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Activity extends Mage_Core_Model_Abstract
27
+ {
28
+
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('kaas/activity');
33
+ }
34
+
35
+ }
app/code/community/Getready/Kaas/Model/Activity/Api.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Activity_Api extends Mage_Api_Model_Resource_Abstract
27
+ {
28
+ public function feed($storeId)
29
+ {
30
+ // Retrieve store info
31
+ try {
32
+ $store = Mage::app()->getStore($storeId);
33
+ } catch (Mage_Core_Model_Store_Exception $e) {
34
+ $this->_fault('store_not_exists');
35
+ }
36
+
37
+ if (!$store->getId()) {
38
+ $this->_fault('store_not_exists');
39
+ }
40
+
41
+ $activity_feed = Mage::Helper('kaas_activity')->getActivityFeed($store);
42
+ return $activity_feed;
43
+ }
44
+
45
+ public function clear($storeId)
46
+ {
47
+ // Retrieve store info
48
+ try {
49
+ $store = Mage::app()->getStore($storeId);
50
+ } catch (Mage_Core_Model_Store_Exception $e) {
51
+ $this->_fault('store_not_exists');
52
+ }
53
+
54
+ if (!$store->getId()) {
55
+ $this->_fault('store_not_exists');
56
+ }
57
+
58
+ $cleared = Mage::Helper('kaas_activity')->clearActivityFeed($store);
59
+ return $cleared;
60
+ }
61
+
62
+ }
app/code/community/Getready/Kaas/Model/Activity/Api/V2.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Activity_Api_V2 extends Getready_Kaas_Model_Activity_Api
27
+ {
28
+
29
+
30
+ }
app/code/community/Getready/Kaas/Model/Category/Api.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Category_Api extends Mage_Api_Model_Resource_Abstract
27
+ {
28
+ public function info($categoryId,$storeId = null)
29
+ {
30
+ $category = Mage::getModel('catalog/category');
31
+ if(!is_null($storeId))
32
+ {
33
+ $category->setStoreId($storeId);
34
+ }
35
+ $category->load($categoryId);
36
+
37
+ if (!$category->getId()) {
38
+ $this->_fault('category_not_exists');
39
+ }
40
+
41
+ $category_info = Mage::Helper('kaas_category')->getCategoryInfo($category,1);
42
+
43
+ return $category_info;
44
+ }
45
+
46
+
47
+
48
+ public function items($storeId)
49
+ {
50
+ try {
51
+ $store = Mage::app()->getStore($storeId);
52
+ } catch (Mage_Core_Model_Store_Exception $e) {
53
+ $this->_fault('store_not_exists');
54
+ }
55
+
56
+ if (!$store->getId()) {
57
+ $this->_fault('store_not_exists');
58
+ }
59
+
60
+ $root_id = $store->getRootCategoryId();
61
+
62
+ /* @var $tree Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Tree */
63
+ $tree = Mage::getResourceSingleton('catalog/category_tree')
64
+ ->load();
65
+
66
+ $root = $tree->getNodeById($root_id);
67
+
68
+ if($root && $root->getId() == 1) {
69
+ $root->setName(Mage::helper('catalog')->__('Root'));
70
+ }
71
+
72
+ $collection = Mage::getModel('catalog/category')->getCollection()
73
+ ->setStoreId($storeId)
74
+ ->addAttributeToSelect('name')
75
+ ->addAttributeToSelect('is_active');
76
+
77
+ $tree->addCollectionData($collection, true);
78
+
79
+ $category_info = $this->_nodeToArray($root);
80
+
81
+
82
+ return $category_info;
83
+ }
84
+
85
+ protected function _nodeToArray(Varien_Data_Tree_Node $node)
86
+ {
87
+ $result = array();
88
+ $category_id = $node->getId();
89
+ $category = Mage::Helper('kaas_category_cache')->getCategory($category_id);
90
+ $category_info = Mage::Helper('kaas_category')->getCategoryInfo($category,1);
91
+
92
+ $result[] = $category_info;
93
+
94
+ foreach ($node->getChildren() as $child) {
95
+ $result = array_merge($result,$this->_nodeToArray($child));
96
+ }
97
+
98
+ return $result;
99
+ }
100
+
101
+ }
app/code/community/Getready/Kaas/Model/Category/Api/V2.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Category_Api_V2 extends Getready_Kaas_Model_Category_Api
27
+ {
28
+
29
+
30
+ }
app/code/community/Getready/Kaas/Model/Mysql4/Activity.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Mysql4_Activity extends Mage_Core_Model_Mysql4_Abstract
27
+ {
28
+
29
+ public function _construct()
30
+ {
31
+ $this->_init( 'kaas/kaas_activity','id' );
32
+ }
33
+
34
+ }
app/code/community/Getready/Kaas/Model/Mysql4/Activity/Collection.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Mysql4_Activity_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
27
+ {
28
+
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('kaas/activity');
33
+ }
34
+
35
+ }
app/code/community/Getready/Kaas/Model/Observer.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Observer
27
+ {
28
+
29
+ public function addUpdateActivity(Varien_Event_Observer $observer)
30
+ {
31
+ try
32
+ {
33
+ $product = $observer->getEvent()->getProduct();
34
+ $product_id = $product->getId();
35
+ $store_id = $product->getStoreId();
36
+ if($product && $product->getId())
37
+ {
38
+ Mage::Helper('kaas_activity')->createUpdateActivity($store_id,$product_id);
39
+ }
40
+ }
41
+ catch (Exception $e)
42
+ {
43
+ Mage::logException($e);
44
+ }
45
+ return $this;
46
+ }
47
+
48
+ public function addDeleteActivity(Varien_Event_Observer $observer)
49
+ {
50
+ try
51
+ {
52
+ $product = $observer->getEvent()->getProduct();
53
+ if($product && $product->getId())
54
+ {
55
+ $product_id = $product->getId();
56
+ Mage::Helper('kaas_activity')->createDeleteActivity($product_id);
57
+ }
58
+ }
59
+ catch (Exception $e)
60
+ {
61
+ Mage::logException($e);
62
+ }
63
+ return $this;
64
+ }
65
+
66
+ public function addStockActivity(Varien_Event_Observer $observer)
67
+ {
68
+ try
69
+ {
70
+ $quote = $observer->getEvent()->getQuote();
71
+
72
+ //$store_id = $quote->getStoreId();
73
+
74
+ $items = $quote->getAllItems();
75
+
76
+ Mage::Helper('kaas_activity')->createStockActivity($items);
77
+
78
+ }
79
+ catch (Exception $e)
80
+ {
81
+ Mage::logException($e);
82
+ }
83
+ return $this;
84
+ }
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+ }
app/code/community/Getready/Kaas/Model/Product/Api.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Product_Api extends Mage_Api_Model_Resource_Abstract
27
+ {
28
+ public function info($productId,$storeId)
29
+ {
30
+ try {
31
+ $store = Mage::app()->getStore($storeId);
32
+ } catch (Mage_Core_Model_Store_Exception $e) {
33
+ $this->_fault('store_not_exists');
34
+ }
35
+
36
+ if (!$store->getId()) {
37
+ $this->_fault('store_not_exists');
38
+ }
39
+
40
+ $product = Mage::helper('catalog/product')->getProduct($productId, $storeId, null);
41
+ if (is_null($product->getId())) {
42
+ $this->_fault('product_not_exists');
43
+ }
44
+
45
+ $product_info = Mage::Helper('kaas_product')->getProductInfo($product);
46
+
47
+ Mage::Helper('kaas_activity')->deleteProductActivity($storeId,$productId);
48
+
49
+ return $product_info;
50
+ }
51
+
52
+ public function infoBySku($productSku,$storeId)
53
+ {
54
+ try {
55
+ $store = Mage::app()->getStore($storeId);
56
+ } catch (Mage_Core_Model_Store_Exception $e) {
57
+ $this->_fault('store_not_exists');
58
+ }
59
+
60
+ if (!$store->getId()) {
61
+ $this->_fault('store_not_exists');
62
+ }
63
+ $product_id = Mage::getModel('catalog/product')->getIdBySku($productSku);
64
+ if($product_id)
65
+ {
66
+ $product = Mage::helper('catalog/product')->getProduct($product_id, $storeId, null);
67
+ if (is_null($product->getId())) {
68
+ $this->_fault('product_not_exists');
69
+ }
70
+ }
71
+ else
72
+ {
73
+ $this->_fault('product_not_exists');
74
+ }
75
+
76
+ $product_info = Mage::Helper('kaas_product')->getProductInfo($product);
77
+
78
+ if($product_id)
79
+ {
80
+ Mage::Helper('kaas_activity')->deleteProductActivity($storeId,$product_id);
81
+ }
82
+
83
+ return $product_info;
84
+ }
85
+
86
+ public function items($storeId)
87
+ {
88
+ $collection = Mage::getModel('catalog/product')->getCollection()
89
+ ->addStoreFilter($storeId)
90
+ ->addAttributeToSelect('name');
91
+
92
+ $result = array();
93
+
94
+ foreach ($collection as $product)
95
+ {
96
+ $product = Mage::helper('catalog/product')->getProduct($product->getId(), $storeId, null);
97
+ if (is_null($product->getId())) {
98
+ $this->_fault('product_not_exists');
99
+ }
100
+
101
+ $product_info = Mage::Helper('kaas_product')->getProductInfo($product);
102
+
103
+ Mage::Helper('kaas_activity')->deleteProductActivity($storeId,$product->getId());
104
+
105
+ $result[] = $product_info;
106
+ }
107
+
108
+ return $result;
109
+ }
110
+
111
+ public function itemsByIds($storeId, $productIds)
112
+ {
113
+ $result = array();
114
+ $products_export = array();
115
+ $errors = array();
116
+ if(!empty($productIds))
117
+ {
118
+ foreach($productIds as $product_id)
119
+ {
120
+ if($product_id > 0)
121
+ {
122
+ $product = Mage::helper('catalog/product')->getProduct($product_id, $storeId, null);
123
+ if (is_null($product->getId())) {
124
+ $errors[] = array(
125
+ 'product_id' => $product_id,
126
+ 'message' => 'product with id ' . $product_id . ' not exists',
127
+ );
128
+ continue;
129
+ }
130
+
131
+ try
132
+ {
133
+ $product_info = Mage::Helper('kaas_product')->getProductInfo($product);
134
+ }
135
+ catch (Exception $e)
136
+ {
137
+ $errors[] = array(
138
+ 'product_id' => $product_id,
139
+ 'message' => $e->getMessage()
140
+ );
141
+ continue;
142
+ }
143
+ $products_export[] = $product_info;
144
+
145
+ Mage::Helper('kaas_activity')->deleteProductActivity($storeId,$product->getId());
146
+ }
147
+ }
148
+ }
149
+
150
+ $result['products'] = $products_export;
151
+ $result['errors'] = $errors;
152
+
153
+ return $result;
154
+ }
155
+
156
+ public function itemsIds($storeId)
157
+ {
158
+ $collection = Mage::getModel('catalog/product')->getCollection()
159
+ ->addStoreFilter($storeId);
160
+
161
+ $result = array();
162
+
163
+ foreach ($collection as $product)
164
+ {
165
+ $result[] = (int)$product->getId();
166
+ }
167
+
168
+ return $result;
169
+ }
170
+
171
+
172
+
173
+ }
app/code/community/Getready/Kaas/Model/Product/Api/V2.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Product_Api_V2 extends Getready_Kaas_Model_Product_Api
27
+ {
28
+
29
+
30
+ }
app/code/community/Getready/Kaas/Model/Store/Api.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Store_Api extends Mage_Api_Model_Resource_Abstract
27
+ {
28
+ public function info($storeId)
29
+ {
30
+ // Retrieve store info
31
+ try {
32
+ $store = Mage::app()->getStore($storeId);
33
+ } catch (Mage_Core_Model_Store_Exception $e) {
34
+ $this->_fault('store_not_exists');
35
+ }
36
+
37
+ if (!$store->getId()) {
38
+ $this->_fault('store_not_exists');
39
+ }
40
+
41
+ $store_info = Mage::Helper('kaas_store')->getStoreInfo($store);
42
+ return $store_info;
43
+ }
44
+
45
+ public function infoByCode($storeCode)
46
+ {
47
+ // Retrieve store info
48
+ try {
49
+ $store = Mage::Helper('kaas_store')->getStoreByCode($storeCode);
50
+ } catch (Mage_Core_Model_Store_Exception $e) {
51
+ $this->_fault('store_not_exists');
52
+ }
53
+
54
+ if (!$store->getId()) {
55
+ $this->_fault('store_not_exists');
56
+ }
57
+
58
+ $store_info = Mage::Helper('kaas_store')->getStoreInfo($store);
59
+ return $store_info;
60
+ }
61
+
62
+ public function items()
63
+ {
64
+ // Retrieve stores
65
+ $stores = Mage::app()->getStores();
66
+
67
+ // Make result array
68
+ $result = array();
69
+ foreach ($stores as $store) {
70
+ $result[] = Mage::Helper('kaas_store')->getStoreInfo($store);
71
+ }
72
+
73
+ return $result;
74
+ }
75
+
76
+ }
app/code/community/Getready/Kaas/Model/Store/Api/V2.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Module developed by Getready s.r.o
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 info@getready.cz so we can send you a copy immediately.
14
+ *
15
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
16
+ *
17
+ */
18
+ /**
19
+ *
20
+ *
21
+ *
22
+ * @category Getready
23
+ * @package Getready_Kaas
24
+ * @author Getready Team <info@getready.cz>
25
+ */
26
+ class Getready_Kaas_Model_Store_Api_V2 extends Getready_Kaas_Model_Store_Api
27
+ {
28
+
29
+
30
+ }
app/code/community/Getready/Kaas/etc/api.xml ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <api>
4
+ <resources>
5
+ <kaas_store translate="title" module="kaas">
6
+ <title>Kaas Store</title>
7
+ <model>kaas/store_api</model>
8
+ <acl>kaas/store</acl>
9
+ <methods>
10
+ <info translate="title" module="kaas">
11
+ <title>Info</title>
12
+ <acl>kaas/store/info</acl>
13
+ </info>
14
+ <infoByCode translate="title" module="kaas">
15
+ <title>Info by store code</title>
16
+ <acl>kaas/store/info_by_code</acl>
17
+ </infoByCode>
18
+ <list translate="title" module="kaas">
19
+ <title>Store List</title>
20
+ <method>items</method>
21
+ <acl>kaas/store/list</acl>
22
+ </list>
23
+ </methods>
24
+ <faults module="kaas">
25
+ <store_not_exists>
26
+ <code>100</code>
27
+ <message>Requested store view not found.</message>
28
+ </store_not_exists>
29
+ </faults>
30
+ </kaas_store>
31
+ <kaas_category translate="title" module="kaas">
32
+ <title>Kaas Category</title>
33
+ <model>kaas/category_api</model>
34
+ <acl>kaas/category</acl>
35
+ <methods>
36
+ <info translate="title" module="kaas">
37
+ <title>Info</title>
38
+ <acl>kaas/category/info</acl>
39
+ </info>
40
+ <list translate="title" module="kaas">
41
+ <title>Category List</title>
42
+ <method>items</method>
43
+ <acl>kaas/category/list</acl>
44
+ </list>
45
+ </methods>
46
+ <faults module="kaas">
47
+ <store_not_exists>
48
+ <code>100</code>
49
+ <message>Requested store view not found.</message>
50
+ </store_not_exists>
51
+ <category_not_exists>
52
+ <code>100</code>
53
+ <message>Requested category not found.</message>
54
+ </category_not_exists>
55
+ </faults>
56
+ </kaas_category>
57
+ <kaas_product translate="title" module="kaas">
58
+ <title>Kaas Product</title>
59
+ <model>kaas/product_api</model>
60
+ <acl>kaas/product</acl>
61
+ <methods>
62
+ <info translate="title" module="kaas">
63
+ <title>Info</title>
64
+ <acl>kaas/product/info</acl>
65
+ </info>
66
+ <infoBySku translate="title" module="kaas">
67
+ <title>Info by SKU</title>
68
+ <acl>kaas/product/info_by_sku</acl>
69
+ </infoBySku>
70
+ <list translate="title" module="kaas">
71
+ <title>Product List</title>
72
+ <method>items</method>
73
+ <acl>kaas/product/list</acl>
74
+ </list>
75
+ <listIds translate="title" module="kaas">
76
+ <title>Product List IDs</title>
77
+ <method>itemsIds</method>
78
+ <acl>kaas/product/list_ids</acl>
79
+ </listIds>
80
+ <listByIds translate="title" module="kaas">
81
+ <title>Product List by IDs</title>
82
+ <method>itemsByIds</method>
83
+ <acl>kaas/product/list_by_ids</acl>
84
+ </listByIds>
85
+ </methods>
86
+ <faults module="kaas">
87
+ <store_not_exists>
88
+ <code>100</code>
89
+ <message>Requested store view not found.</message>
90
+ </store_not_exists>
91
+ <product_not_exists>
92
+ <code>101</code>
93
+ <message>Product not exists.</message>
94
+ </product_not_exists>
95
+ </faults>
96
+ </kaas_product>
97
+ <kaas_activity translate="title" module="kaas">
98
+ <title>Kaas Activity</title>
99
+ <model>kaas/activity_api</model>
100
+ <acl>kaas/activity</acl>
101
+ <methods>
102
+ <feed translate="title" module="kaas">
103
+ <title>Feed</title>
104
+ <acl>kaas/activity/feed</acl>
105
+ </feed>
106
+ <clear translate="title" module="kaas">
107
+ <title>Clear</title>
108
+ <acl>kaas/activity/clear</acl>
109
+ </clear>
110
+ </methods>
111
+ <faults module="kaas">
112
+ <store_not_exists>
113
+ <code>100</code>
114
+ <message>Requested store view not found.</message>
115
+ </store_not_exists>
116
+ </faults>
117
+ </kaas_activity>
118
+ </resources>
119
+ <resources_alias>
120
+ <kaas_store>kaas_store</kaas_store>
121
+ <kaas_category>kaas_category</kaas_category>
122
+ <kaas_product>kaas_product</kaas_product>
123
+ <kaas_activity>kaas_activity</kaas_activity>
124
+ </resources_alias>
125
+ <v2>
126
+ <resources_function_prefix>
127
+ <kaas_store>kaasStore</kaas_store>
128
+ <kaas_category>kaasCategory</kaas_category>
129
+ <kaas_product>kaasProduct</kaas_product>
130
+ <kaas_activity>kaasActivity</kaas_activity>
131
+ </resources_function_prefix>
132
+ </v2>
133
+ <acl>
134
+ <resources>
135
+ <kaas translate="title" module="kaas">
136
+ <title>Kaas</title>
137
+ <sort_order>2000</sort_order>
138
+ <store translate="title" module="kaas">
139
+ <title>Store</title>
140
+ <info translate="title" module="kaas">
141
+ <title>Info</title>
142
+ </info>
143
+ <info_by_code translate="title" module="kaas">
144
+ <title>Info By Code</title>
145
+ </info_by_code>
146
+ <list translate="title" module="kaas">
147
+ <title>List</title>
148
+ </list>
149
+ </store>
150
+ <category translate="title" module="kaas">
151
+ <title>Category</title>
152
+ <info translate="title" module="kaas">
153
+ <title>Info</title>
154
+ </info>
155
+ <list translate="title" module="kaas">
156
+ <title>List</title>
157
+ </list>
158
+ </category>
159
+ <product translate="title" module="kaas">
160
+ <title>Product</title>
161
+ <info translate="title" module="kaas">
162
+ <title>Info</title>
163
+ </info>
164
+ <info_by_sku translate="title" module="kaas">
165
+ <title>Info By SKU</title>
166
+ </info_by_sku>
167
+ <list translate="title" module="kaas">
168
+ <title>List</title>
169
+ </list>
170
+ <list_ids translate="title" module="kaas">
171
+ <title>List IDs</title>
172
+ </list_ids>
173
+ <list_by_ids translate="title" module="kaas">
174
+ <title>List by IDs</title>
175
+ </list_by_ids>
176
+ </product>
177
+ <activity translate="title" module="kaas">
178
+ <title>Activity</title>
179
+ <feed translate="title" module="kaas">
180
+ <title>Feed</title>
181
+ </feed>
182
+ <clear translate="title" module="kaas">
183
+ <title>Clear</title>
184
+ </clear>
185
+ </activity>
186
+ </kaas>
187
+ </resources>
188
+ </acl>
189
+ </api>
190
+ </config>
app/code/community/Getready/Kaas/etc/config.xml ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento Module developed by Getready s.r.o
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@getready.cz so we can send you a copy immediately.
15
+ *
16
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
17
+ *
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Getready_Kaas>
23
+ <version>1.0.0</version>
24
+ </Getready_Kaas>
25
+ </modules>
26
+
27
+ <global>
28
+ <models>
29
+ <kaas>
30
+ <class>Getready_Kaas_Model</class>
31
+ <resourceModel>kaas_mysql4</resourceModel>
32
+ </kaas>
33
+ <kaas_mysql4>
34
+ <class>Getready_Kaas_Model_Mysql4</class>
35
+ <entities>
36
+ <kaas_activity>
37
+ <table>getready_kaas_activity</table>
38
+ </kaas_activity>
39
+ </entities>
40
+ </kaas_mysql4>
41
+ </models>
42
+ <resources>
43
+ <kaas_setup>
44
+ <setup>
45
+ <module>Getready_Kaas</module>
46
+ </setup>
47
+ <connection>
48
+ <use>core_setup</use>
49
+ </connection>
50
+ </kaas_setup>
51
+ <kaas_write>
52
+ <connection>
53
+ <use>core_write</use>
54
+ </connection>
55
+ </kaas_write>
56
+ <kaas_read>
57
+ <connection>
58
+ <use>core_read</use>
59
+ </connection>
60
+ </kaas_read>
61
+ </resources>
62
+ <helpers>
63
+ <kaas>
64
+ <class>Getready_Kaas_Helper</class>
65
+ </kaas>
66
+ <kaas_store>
67
+ <class>Getready_Kaas_Helper_Store</class>
68
+ </kaas_store>
69
+ <kaas_category>
70
+ <class>Getready_Kaas_Helper_Category</class>
71
+ </kaas_category>
72
+ <kaas_category_cache>
73
+ <class>Getready_Kaas_Helper_Category_Cache</class>
74
+ </kaas_category_cache>
75
+ <kaas_product>
76
+ <class>Getready_Kaas_Helper_Product</class>
77
+ </kaas_product>
78
+ <kaas_product_category>
79
+ <class>Getready_Kaas_Helper_Product_Category</class>
80
+ </kaas_product_category>
81
+ <kaas_product_store>
82
+ <class>Getready_Kaas_Helper_Product_Store</class>
83
+ </kaas_product_store>
84
+ <kaas_activity>
85
+ <class>Getready_Kaas_Helper_Activity</class>
86
+ </kaas_activity>
87
+ </helpers>
88
+ <events>
89
+ <catalog_product_save_after>
90
+ <observers>
91
+ <kaas_activity_update>
92
+ <class>kaas/observer</class>
93
+ <method>addUpdateActivity</method>
94
+ </kaas_activity_update>
95
+ </observers>
96
+ </catalog_product_save_after>
97
+ <catalog_product_delete_after>
98
+ <observers>
99
+ <kaas_activity_delete>
100
+ <class>kaas/observer</class>
101
+ <method>addDeleteActivity</method>
102
+ </kaas_activity_delete>
103
+ </observers>
104
+ </catalog_product_delete_after>
105
+ <checkout_submit_all_after>
106
+ <observers>
107
+ <kaas_activity_stock>
108
+ <class>kaas/observer</class>
109
+ <method>addStockActivity</method>
110
+ </kaas_activity_stock>
111
+ </observers>
112
+ </checkout_submit_all_after>
113
+ </events>
114
+ </global>
115
+ </config>
app/code/community/Getready/Kaas/etc/wsdl.xml ADDED
@@ -0,0 +1,498 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Magento Module developed by Getready s.r.o
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@getready.cz so we can send you a copy immediately.
15
+ *
16
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
17
+ *
18
+ */
19
+ -->
20
+ <definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
21
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"
22
+ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
23
+ <types>
24
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
25
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
26
+ <!-- Store -->
27
+ <complexType name="kaasStoreEntity">
28
+ <all>
29
+ <element name="store_id" type="xsd:int" />
30
+ <element name="code" type="xsd:string" />
31
+ <element name="website_id" type="xsd:int" />
32
+ <element name="group_id" type="xsd:int" />
33
+ <element name="name" type="xsd:string" />
34
+ <element name="sort_order" type="xsd:int" />
35
+ <element name="is_active" type="xsd:int" />
36
+ <element name="country" type="xsd:string" />
37
+ <element name="language" type="xsd:string" />
38
+ <element name="locale" type="xsd:string" />
39
+ <element name="currency" type="xsd:string" />
40
+ <element name="currency_symbol" type="xsd:string" />
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
+ </all>
45
+ </complexType>
46
+ <complexType name="kaasStoreEntityArray">
47
+ <complexContent>
48
+ <restriction base="soapenc:Array">
49
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:kaasStoreEntity[]" />
50
+ </restriction>
51
+ </complexContent>
52
+ </complexType>
53
+ <!-- Category -->
54
+ <complexType name="kaasCategoryEntity">
55
+ <all>
56
+ <element name="category_id" type="xsd:int" />
57
+ <element name="url" type="xsd:string" />
58
+ <element name="path" type="xsd:string" />
59
+ <element name="path_ids" type="xsd:string" />
60
+ <element name="path_url_key" type="xsd:string" />
61
+ <element name="level" type="xsd:int" />
62
+ <element name="parent_id" type="xsd:int" />
63
+ <element name="parent_name" type="xsd:string" />
64
+ <element name="root_id" type="xsd:int" />
65
+ <element name="root_name" type="xsd:string" />
66
+ <element name="description" type="xsd:string" />
67
+ <element name="name" type="xsd:string" />
68
+ </all>
69
+ </complexType>
70
+ <complexType name="kaasCategoryEntityArray">
71
+ <complexContent>
72
+ <restriction base="soapenc:Array">
73
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:kaasCategoryEntity[]" />
74
+ </restriction>
75
+ </complexContent>
76
+ </complexType>
77
+ <!-- Product -->
78
+ <complexType name="kaasDatetimeSec">
79
+ <all>
80
+ <element name="sec" type="xsd:int" />
81
+ <element name="usec" type="xsd:int" />
82
+ </all>
83
+ </complexType>
84
+ <complexType name="kaasImageEntity">
85
+ <all>
86
+ <element name="label" type="xsd:string" />
87
+ <element name="thumbnail_image" type="xsd:string" />
88
+ <element name="small_image" type="xsd:string" />
89
+ <element name="base_image" type="xsd:string" />
90
+ </all>
91
+ </complexType>
92
+ <complexType name="kaasFlatAttributeEntity">
93
+ <all>
94
+ <element name="code" type="xsd:string" />
95
+ <element name="label" type="xsd:string" />
96
+ <element name="value" type="xsd:string" />
97
+ </all>
98
+ </complexType>
99
+ <complexType name="kaasFlatAttributeArray">
100
+ <complexContent>
101
+ <restriction base="soapenc:Array">
102
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:kaasFlatAttributeEntity[]" />
103
+ </restriction>
104
+ </complexContent>
105
+ </complexType>
106
+ <complexType name="kaasGalleryArray">
107
+ <complexContent>
108
+ <restriction base="soapenc:Array">
109
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:kaasImageEntity[]" />
110
+ </restriction>
111
+ </complexContent>
112
+ </complexType>
113
+ <complexType name="kaasIdsArray">
114
+ <complexContent>
115
+ <restriction base="soapenc:Array">
116
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:int[]" />
117
+ </restriction>
118
+ </complexContent>
119
+ </complexType>
120
+ <complexType name="kaasProductCategoryEntity">
121
+ <all>
122
+ <element name="id" type="xsd:int" />
123
+ <element name="name" type="xsd:string" />
124
+ <element name="path_ids" type="xsd:string" />
125
+ <element name="level" type="xsd:int" />
126
+ <element name="parent_id" type="xsd:int" />
127
+ <element name="parent_name" type="xsd:string" />
128
+ <element name="url" type="xsd:string" />
129
+ <element name="path_url_key" type="xsd:string" />
130
+ <element name="path" type="xsd:string" />
131
+ <element name="root_id" type="xsd:int" />
132
+ <element name="root_name" type="xsd:string" />
133
+ </all>
134
+ </complexType>
135
+ <complexType name="kaasProductCategoryArray">
136
+ <complexContent>
137
+ <restriction base="soapenc:Array">
138
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:kaasProductCategoryEntity[]" />
139
+ </restriction>
140
+ </complexContent>
141
+ </complexType>
142
+ <complexType name="kaasProductEntity">
143
+ <all>
144
+ <element name="product_id" type="xsd:int" />
145
+ <element name="group_id" type="xsd:int" />
146
+ <element name="url" type="xsd:string" />
147
+ <element name="created_at" type="xsd:kaasDatetimeSec" />
148
+ <element name="creation_datetime" type="xsd:string" />
149
+ <element name="creation_date" type="xsd:string" />
150
+ <element name="creation_time" type="xsd:string" />
151
+ <element name="updated_at" type="xsd:DatetimeSec" />
152
+ <element name="updated_datetime" type="xsd:string" />
153
+ <element name="updated_date" type="xsd:string" />
154
+ <element name="updated_time" type="xsd:string" />
155
+ <element name="is_visible" type="xsd:boolean" />
156
+ <element name="is_parent" type="xsd:boolean" />
157
+ <element name="is_child" type="xsd:boolean" />
158
+ <element name="flat" type="xsd:kaasFlatAttributeArray" />
159
+ <element name="price_original_include_tax" type="xsd:double" />
160
+ <element name="price_original_exclude_tax" type="xsd:double" />
161
+ <element name="price_final_include_tax" type="xsd:double" />
162
+ <element name="price_final_exclude_tax" type="xsd:double" />
163
+ <element name="price_cost" type="xsd:double" />
164
+ <element name="tax_percent" type="xsd:double" />
165
+ <element name="discount" type="xsd:double" />
166
+ <element name="qty" type="xsd:int" />
167
+ <element name="stock_status" type="xsd:boolean" />
168
+ <element name="gallery" type="xsd:kaasGalleryArray" />
169
+ <element name="category" type="xsd:kaasProductCategoryArray" />
170
+ <element name="children" type="xsd:kaasIdsArray" />
171
+ </all>
172
+ </complexType>
173
+ <complexType name="kaasProductEntityArray">
174
+ <complexContent>
175
+ <restriction base="soapenc:Array">
176
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:kaasProductEntity[]" />
177
+ </restriction>
178
+ </complexContent>
179
+ </complexType>
180
+ <complexType name="kaasProductErrorEntity">
181
+ <all>
182
+ <element name="product_id" type="xsd:int" />
183
+ <element name="message" type="xsd:string" />
184
+ </all>
185
+ </complexType>
186
+ <complexType name="kaasProductErrorArray">
187
+ <complexContent>
188
+ <restriction base="soapenc:Array">
189
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:kaasProductErrorEntity[]" />
190
+ </restriction>
191
+ </complexContent>
192
+ </complexType>
193
+ <complexType name="kaasProductExportResponsArray">
194
+ <all>
195
+ <element name="products" type="xsd:kaasProductEntityArray" />
196
+ <element name="errors" type="xsd:kaasProductErrorArray" />
197
+ </all>
198
+ </complexType>
199
+ <complexType name="kaasProductIdArray">
200
+ <complexContent>
201
+ <restriction base="soapenc:Array">
202
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:int[]" />
203
+ </restriction>
204
+ </complexContent>
205
+ </complexType>
206
+ <!-- Activity -->
207
+ <complexType name="kaasActivityFeedEntity">
208
+ <all>
209
+ <element name="entity_id" type="xsd:int" />
210
+ <element name="action" type="xsd:string" />
211
+ </all>
212
+ </complexType>
213
+ <complexType name="kaasActivityFeedEntityArray">
214
+ <complexContent>
215
+ <restriction base="soapenc:Array">
216
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:kaasActivityFeedEntity[]" />
217
+ </restriction>
218
+ </complexContent>
219
+ </complexType>
220
+ </schema>
221
+ </types>
222
+ <!-- Store -->
223
+ <message name="kaasStoreInfoRequest">
224
+ <part name="sessionId" type="xsd:string"/>
225
+ <part name="storeId" type="xsd:string" />
226
+ </message>
227
+ <message name="kaasStoreInfoResponse">
228
+ <part name="result" type="xsd:kaasStoreEntity" />
229
+ </message>
230
+ <message name="kaasStoreInfoByCodeRequest">
231
+ <part name="sessionId" type="xsd:string"/>
232
+ <part name="storeCode" type="xsd:string" />
233
+ </message>
234
+ <message name="kaasStoreInfoByCodeResponse">
235
+ <part name="result" type="xsd:kaasStoreEntity" />
236
+ </message>
237
+ <message name="kaasStoreListRequest">
238
+ <part name="sessionId" type="xsd:string"/>
239
+ </message>
240
+ <message name="kaasStoreListResponse">
241
+ <part name="result" type="xsd:kaasStoreEntityArray" />
242
+ </message>
243
+ <!-- Category -->
244
+ <message name="kaasCategoryInfoRequest">
245
+ <part name="sessionId" type="xsd:string"/>
246
+ <part name="categoryId" type="xsd:string" />
247
+ </message>
248
+ <message name="kaasCategoryInfoResponse">
249
+ <part name="result" type="xsd:kaasCategoryEntity" />
250
+ </message>
251
+ <message name="kaasCategoryListRequest">
252
+ <part name="sessionId" type="xsd:string"/>
253
+ <part name="storeId" type="xsd:string" />
254
+ </message>
255
+ <message name="kaasCategoryListResponse">
256
+ <part name="result" type="xsd:kaasCategoryEntityArray" />
257
+ </message>
258
+ <!-- Product -->
259
+ <message name="kaasProductInfoRequest">
260
+ <part name="sessionId" type="xsd:string"/>
261
+ <part name="productId" type="xsd:string" />
262
+ <part name="storeId" type="xsd:string" />
263
+ </message>
264
+ <message name="kaasProductInfoResponse">
265
+ <part name="result" type="xsd:kaasProductEntity" />
266
+ </message>
267
+ <message name="kaasProductInfoBySkuRequest">
268
+ <part name="sessionId" type="xsd:string"/>
269
+ <part name="productSku" type="xsd:string" />
270
+ <part name="storeId" type="xsd:string" />
271
+ </message>
272
+ <message name="kaasProductInfoBySkuResponse">
273
+ <part name="result" type="xsd:kaasProductEntity" />
274
+ </message>
275
+ <message name="kaasProductListRequest">
276
+ <part name="sessionId" type="xsd:string"/>
277
+ <part name="storeId" type="xsd:string" />
278
+ </message>
279
+ <message name="kaasProductListResponse">
280
+ <part name="result" type="xsd:kaasProductEntityArray" />
281
+ </message>
282
+ <message name="kaasProductListIdsRequest">
283
+ <part name="sessionId" type="xsd:string"/>
284
+ <part name="storeId" type="xsd:string" />
285
+ </message>
286
+ <message name="kaasProductListIdsResponse">
287
+ <part name="result" type="xsd:kaasProductIdArray" />
288
+ </message>
289
+ <message name="kaasProductListByIdsRequest">
290
+ <part name="sessionId" type="xsd:string"/>
291
+ <part name="storeId" type="xsd:string" />
292
+ <part name="productIds" type="xsd:kaasProductIdArray" />
293
+ </message>
294
+ <message name="kaasProductListByIdsResponse">
295
+ <part name="result" type="xsd:kaasProductExportResponsArray" />
296
+ </message>
297
+ <!-- Activity -->
298
+ <message name="kaasActivityFeedRequest">
299
+ <part name="sessionId" type="xsd:string"/>
300
+ <part name="storeId" type="xsd:string" />
301
+ </message>
302
+ <message name="kaasActivityFeedResponse">
303
+ <part name="result" type="xsd:kaasActivityFeedEntityArray" />
304
+ </message>
305
+ <message name="kaasActivityClearRequest">
306
+ <part name="sessionId" type="xsd:string"/>
307
+ <part name="storeId" type="xsd:string" />
308
+ </message>
309
+ <message name="kaasActivityClearResponse">
310
+ <part name="result" type="xsd:boolean" />
311
+ </message>
312
+ <portType name="{{var wsdl.handler}}PortType">
313
+ <!-- Store -->
314
+ <operation name="kaasStoreInfo">
315
+ <documentation>Getready - Koongo Kaas Store Info</documentation>
316
+ <input message="typens:kaasStoreInfoRequest" />
317
+ <output message="typens:kaasStoreInfoResponse" />
318
+ </operation>
319
+ <operation name="kaasStoreInfoByCode">
320
+ <documentation>Getready - Koongo Kaas Store Info By Store Code</documentation>
321
+ <input message="typens:kaasStoreInfoByCodeRequest" />
322
+ <output message="typens:kaasStoreInfoByCodeResponse" />
323
+ </operation>
324
+ <operation name="kaasStoreList">
325
+ <documentation>Getready - Koongo Kaas Store List</documentation>
326
+ <input message="typens:kaasStoreListRequest" />
327
+ <output message="typens:kaasStoreListResponse" />
328
+ </operation>
329
+ <!-- Category -->
330
+ <operation name="kaasCategoryInfo">
331
+ <documentation>Getready - Koongo Kaas Category Info</documentation>
332
+ <input message="typens:kaasCategoryInfoRequest" />
333
+ <output message="typens:kaasCategoryInfoResponse" />
334
+ </operation>
335
+ <operation name="kaasCategoryList">
336
+ <documentation>Getready - Koongo Kaas Category List</documentation>
337
+ <input message="typens:kaasCategoryListRequest" />
338
+ <output message="typens:kaasCategoryListResponse" />
339
+ </operation>
340
+ <!-- Product -->
341
+ <operation name="kaasProductInfo">
342
+ <documentation>Getready - Koongo Kaas Product Info</documentation>
343
+ <input message="typens:kaasProductInfoRequest" />
344
+ <output message="typens:kaasProductInfoResponse" />
345
+ </operation>
346
+ <operation name="kaasProductInfoBySku">
347
+ <documentation>Getready - Koongo Kaas Product Info by SKU</documentation>
348
+ <input message="typens:kaasProductInfoBySkuRequest" />
349
+ <output message="typens:kaasProductInfoBySkuResponse" />
350
+ </operation>
351
+ <operation name="kaasProductList">
352
+ <documentation>Getready - Koongo Kaas Product List</documentation>
353
+ <input message="typens:kaasProductListRequest" />
354
+ <output message="typens:kaasProductListResponse" />
355
+ </operation>
356
+ <operation name="kaasProductListIds">
357
+ <documentation>Getready - Koongo Kaas Product List IDs</documentation>
358
+ <input message="typens:kaasProductListIdsRequest" />
359
+ <output message="typens:kaasProductListIdsResponse" />
360
+ </operation>
361
+ <operation name="kaasProductListByIds">
362
+ <documentation>Getready - Koongo Kaas Product List By IDs</documentation>
363
+ <input message="typens:kaasProductListByIdsRequest" />
364
+ <output message="typens:kaasProductListByIdsResponse" />
365
+ </operation>
366
+ <!-- Activity -->
367
+ <operation name="kaasActivityFeed">
368
+ <documentation>Getready - Koongo Kaas Activity Feed</documentation>
369
+ <input message="typens:kaasActivityFeedRequest" />
370
+ <output message="typens:kaasActivityFeedResponse" />
371
+ </operation>
372
+ <operation name="kaasActivityClear">
373
+ <documentation>Getready - Clear Koongo Kaas Activity</documentation>
374
+ <input message="typens:kaasActivityFeedRequest" />
375
+ <output message="typens:kaasActivityFeedResponse" />
376
+ </operation>
377
+ </portType>
378
+ <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
379
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
380
+ <!-- Store -->
381
+ <operation name="kaasStoreInfo">
382
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
383
+ <input>
384
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
385
+ </input>
386
+ <output>
387
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
388
+ </output>
389
+ </operation>
390
+ <operation name="kaasStoreInfoByCode">
391
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
392
+ <input>
393
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
394
+ </input>
395
+ <output>
396
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
397
+ </output>
398
+ </operation>
399
+ <operation name="kaasStoreList">
400
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
401
+ <input>
402
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
403
+ </input>
404
+ <output>
405
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
406
+ </output>
407
+ </operation>
408
+ <!-- Category -->
409
+ <operation name="kaasCategoryInfo">
410
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
411
+ <input>
412
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
413
+ </input>
414
+ <output>
415
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
416
+ </output>
417
+ </operation>
418
+ <operation name="kaasCategoryList">
419
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
420
+ <input>
421
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
422
+ </input>
423
+ <output>
424
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
425
+ </output>
426
+ </operation>
427
+ <!-- Product -->
428
+ <operation name="kaasProductInfo">
429
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
430
+ <input>
431
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
432
+ </input>
433
+ <output>
434
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
435
+ </output>
436
+ </operation>
437
+ <operation name="kaasProductInfoBySku">
438
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
439
+ <input>
440
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
441
+ </input>
442
+ <output>
443
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
444
+ </output>
445
+ </operation>
446
+ <operation name="kaasProductList">
447
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
448
+ <input>
449
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
450
+ </input>
451
+ <output>
452
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
453
+ </output>
454
+ </operation>
455
+ <operation name="kaasProductListIds">
456
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
457
+ <input>
458
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
459
+ </input>
460
+ <output>
461
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
462
+ </output>
463
+ </operation>
464
+ <operation name="kaasProductListByIds">
465
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
466
+ <input>
467
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
468
+ </input>
469
+ <output>
470
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
471
+ </output>
472
+ </operation>
473
+ <!-- Activity -->
474
+ <operation name="kaasActivityFeed">
475
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
476
+ <input>
477
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
478
+ </input>
479
+ <output>
480
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
481
+ </output>
482
+ </operation>
483
+ <operation name="kaasActivityClear">
484
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
485
+ <input>
486
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
487
+ </input>
488
+ <output>
489
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
490
+ </output>
491
+ </operation>
492
+ </binding>
493
+ <service name="{{var wsdl.name}}Service">
494
+ <port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
495
+ <soap:address location="{{var wsdl.url}}" />
496
+ </port>
497
+ </service>
498
+ </definitions>
app/code/community/Getready/Kaas/sql/kaas_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("
6
+
7
+ -- DROP TABLE IF EXISTS {$this->getTable('getready_kaas_activity')};
8
+ CREATE TABLE {$this->getTable('getready_kaas_activity')} (
9
+ `id` int(11) unsigned NOT NULL auto_increment,
10
+ `store_id` int(11) NOT NULL default 0,
11
+ `product_id` int(11) NOT NULL default 0,
12
+ `action` VARCHAR(255) NULL ,
13
+ `created_at` DATETIME NULL ,
14
+ PRIMARY KEY (`id`),
15
+ INDEX `getready_activity_feed_store_index1` (`store_id`),
16
+ INDEX `getready_activity_feed_index1` (`store_id`,`product_id`)
17
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
18
+
19
+ ");
20
+
21
+ $installer->endSetup();
app/etc/modules/Getready_Kaas.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento Module developed by Getready s.r.o
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@getready.cz so we can send you a copy immediately.
15
+ *
16
+ * @copyright Copyright (c) 2015 Getready s.r.o. (http://getready.cz)
17
+ *
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Getready_Kaas>
23
+ <active>true</active>
24
+ <codePool>community</codePool>
25
+ </Getready_Kaas>
26
+ </modules>
27
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>getready_kaas</name>
4
+ <version>1.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>
8
+ <extends/>
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>This release adds new SOAP methods allowing integration between Koongo service and Magento application.</notes>
12
+ <authors><author><name>GetReady Team</name><user>getreadycz</user><email>info@getready.cz</email></author></authors>
13
+ <date>2015-03-24</date>
14
+ <time>15:08:45</time>
15
+ <contents><target name="magecommunity"><dir name="Getready"><dir name="Kaas"><dir name="Helper"><dir name="Activity"><file name="Data.php" hash="62a3e1b7febee61d271a92d1a2f54dd5"/></dir><dir name="Category"><dir name="Cache"><file name="Data.php" hash="d7ab70ef0fcd3ef76fba644ac65657b9"/></dir><file name="Data.php" hash="1d1e87fac121929c349a46a9f7877952"/></dir><file name="Data.php" hash="bd38134d9a36590307269b333723941e"/><dir name="Product"><dir name="Category"><file name="Data.php" hash="c30cbcdc5d00d4a7390f588d6f580c8c"/></dir><file name="Data.php" hash="02e2d01b1d5700e894cafbb46a339e6d"/><dir name="Store"><file name="Data.php" hash="b8b3a47a4f62e88ae8b7486448b3d117"/></dir></dir><dir name="Store"><file name="Data.php" hash="858b925336ad142137863fb39ea48bfc"/></dir></dir><dir name="Model"><dir name="Activity"><dir name="Api"><file name="V2.php" hash="8f42f3185ea31e3aa26effcb5ab9125a"/></dir><file name="Api.php" hash="b26a8e15dfea24bae6fd42dd22a62854"/></dir><file name="Activity.php" hash="7aba5dc7971c1eadb520d18976b1125c"/><dir name="Category"><dir name="Api"><file name="V2.php" hash="78a7066d3140b657eff58b14b23d1f08"/></dir><file name="Api.php" hash="6608d4b4201dd3da09ad72bb6f42229d"/></dir><dir name="Mysql4"><dir name="Activity"><file name="Collection.php" hash="dd7228a1cdb5b4ac78cd11474087651f"/></dir><file name="Activity.php" hash="85589a497a54e021566f76d6551a2d00"/></dir><file name="Observer.php" hash="05871d18b19cecc2565a97a491722e8e"/><dir name="Product"><dir name="Api"><file name="V2.php" hash="e8678b1521bdb64aa190525ec2eddcec"/></dir><file name="Api.php" hash="648985181c2613673970f3be39583668"/></dir><dir name="Store"><dir name="Api"><file name="V2.php" hash="a6e77878c5381fca64e78345282039e5"/></dir><file name="Api.php" hash="5779a9fba1a66545cca8780278a0d997"/></dir></dir><dir name="etc"><file name="api.xml" hash="35d556b362351ad9eb02cbddce39db3d"/><file name="config.xml" hash="ff7beb17b9aac0c81b9a05bc5ba615db"/><file name="wsdl.xml" hash="80c23b574cb985611f11bf612143023b"/></dir><dir name="sql"><dir name="kaas_setup"><file name="mysql4-install-1.0.0.php" hash="ba340185bf02226645e753dc9a5fbf1c"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Getready_Kaas.xml" hash="f074e529238944862070b165459b5f2c"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>