Channelpilotsolutions_Channelpilot - Version 2.2.1

Version Notes

- general bugfixes
- ebay payment method

Download this release

Release Info

Developer Magento Core Team
Extension Channelpilotsolutions_Channelpilot
Version 2.2.1
Comparing to
See all releases


Code changes from version 2.2.0 to 2.2.1

app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Articlenumber/Values.php CHANGED
@@ -25,7 +25,6 @@ class Channelpilotsolutions_Channelpilot_Adminhtml_Model_Articlenumber_Values
25
  public function toOptionArray()
26
  {
27
  return array(
28
- array('value' => "---", 'label' => "---"),
29
  array('value' => 'product_id', 'label'=>'Entity ID'),
30
  array('value' => 'sku', 'label'=>'Sku')
31
  );
25
  public function toOptionArray()
26
  {
27
  return array(
 
28
  array('value' => 'product_id', 'label'=>'Entity ID'),
29
  array('value' => 'sku', 'label'=>'Sku')
30
  );
app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Orderstatus/Values.php CHANGED
@@ -38,7 +38,7 @@ class Channelpilotsolutions_Channelpilot_Adminhtml_Model_Orderstatus_Values {
38
  $dbConnection->closeConnection();
39
  }
40
  $dbConnection->closeConnection();
41
-
42
  return $result_array;
43
  }
44
 
38
  $dbConnection->closeConnection();
39
  }
40
  $dbConnection->closeConnection();
41
+
42
  return $result_array;
43
  }
44
 
app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Field/Exportfields.php CHANGED
@@ -52,6 +52,7 @@ class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Exportfields exte
52
  $attributes[]['attribute_code'] = 'stock_status';
53
  $attributes[]['attribute_code'] = 'cp_color_attribute_id';
54
  $attributes[]['attribute_code'] = 'type_id';
 
55
  asort($attributes);
56
  foreach ($attributes as $attribute) {
57
  $rendered .= '<option value="' . $attribute['attribute_code'] . '">' . $attribute['attribute_code'] . '</option>';
52
  $attributes[]['attribute_code'] = 'stock_status';
53
  $attributes[]['attribute_code'] = 'cp_color_attribute_id';
54
  $attributes[]['attribute_code'] = 'type_id';
55
+ $attributes[]['attribute_code'] = 'parent_id';
56
  asort($attributes);
57
  foreach ($attributes as $attribute) {
58
  $rendered .= '<option value="' . $attribute['attribute_code'] . '">' . $attribute['attribute_code'] . '</option>';
app/code/community/Channelpilotsolutions/Channelpilot/Helper/Data.php CHANGED
@@ -72,17 +72,9 @@ class Channelpilotsolutions_Channelpilot_Helper_Data extends Mage_Core_Helper_Ab
72
  $password = Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_password');
73
  $paramPassword = Mage::app()->getRequest()->getParam('password', false);
74
  if ($password == '' || ($paramPassword AND $paramPassword == $password)) {
75
- header('Content-Type: text/xml; charset=utf-8');
76
- include 'ExportData.php';
77
- $exporter = new ExportData();
78
- echo('<?xml version="1.0"?>');
79
- echo("<root>");
80
- echo("<catalog>");
81
- $exporter->_runMain();
82
- echo("</catalog>");
83
- echo("</root>");
84
  exit();
85
- return;
86
  }
87
  }
88
  return;
@@ -163,7 +155,6 @@ class Channelpilotsolutions_Channelpilot_Helper_Data extends Mage_Core_Helper_Ab
163
  // Send method + token + priceId
164
  case self::GET_NEWPRICES:
165
  $this->checkActivation(array($pricecontrolActive), 'pricecontrol');
166
- // $this->checkSignature();
167
  $handler = new CPNewPriceHandler();
168
  $hook = $handler->handle();
169
  break;
@@ -171,9 +162,8 @@ class Channelpilotsolutions_Channelpilot_Helper_Data extends Mage_Core_Helper_Ab
171
  // Send method + limit + shopId ( + last)
172
  case self::GET_EXPORT:
173
  $this->checkActivation(array($exportActive), 'export');
174
- // $this->checkSignature();
175
  $handler = new CPExportHandler();
176
- $hook = $handler->handle();
177
  break;
178
 
179
  // Send method + limit + shopId ( + last)
72
  $password = Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_password');
73
  $paramPassword = Mage::app()->getRequest()->getParam('password', false);
74
  if ($password == '' || ($paramPassword AND $paramPassword == $password)) {
75
+ $handler = new CPExportHandler(CPExportHandler::METHOD_XML);
76
+ $handler->handle();
 
 
 
 
 
 
 
77
  exit();
 
78
  }
79
  }
80
  return;
155
  // Send method + token + priceId
156
  case self::GET_NEWPRICES:
157
  $this->checkActivation(array($pricecontrolActive), 'pricecontrol');
 
158
  $handler = new CPNewPriceHandler();
159
  $hook = $handler->handle();
160
  break;
162
  // Send method + limit + shopId ( + last)
163
  case self::GET_EXPORT:
164
  $this->checkActivation(array($exportActive), 'export');
 
165
  $handler = new CPExportHandler();
166
+ $hook = $handler->handle(CPExportHandler::METHOD_JSON);
167
  break;
168
 
169
  // Send method + limit + shopId ( + last)
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPExportHandler.php CHANGED
@@ -11,63 +11,118 @@ class CPExportHandler extends CPAbstractHandler {
11
  private $_siteId;
12
  private $_mediaUrl;
13
  private $_webUrl;
14
- private $_dbConnection;
15
  private $_allCat;
16
  private $oldCatPath;
17
- private $limit;
18
- private $last;
19
- private $productId;
20
- private $_productEntityTypeId;
21
- private $_mediaGalleryAttributeId;
22
  private $_blankProduct;
23
- private $_baseImageAttributeId;
 
 
 
 
 
 
 
24
 
25
  /**
26
  * Handle status event
27
  *
28
  */
29
- public function handle() {
30
- $limit = Mage::app()->getRequest()->getParam('limit', 0);
31
- $store = Mage::app()->getRequest()->getParam('store', false);
32
- if ($limit && $store) {
33
- $this->limit = $limit;
34
- $this->last = Mage::app()->getRequest()->getParam('last', null);
35
- $this->_storeId = $store;
36
- $this->initExport();
37
- $productData = null;
38
- if (Mage::app()->getRequest()->getParam('priceStock') === "true") {
39
- $productData = $this->getStockAndPriceData();
40
- } else {
41
- $productData = $this->getFullProductData();
42
- }
43
-
44
- $hook = new CPHookResponse();
45
- $hook->resultCode = CPResultCodes::SUCCESS;
46
- $hook->products = $productData;
47
- $hook->resultMessage = "ProductData of " . sizeof($hook->products) . " articles";
48
- $hook->moreAvailable = true;
49
- if (sizeof($hook->products) < $this->limit) {
50
- $hook->moreAvailable = false;
51
- }
52
- $hook->writeResponse(self::defaultHeader, json_encode($hook));
53
- } else {
54
- $hook = new CPHookResponse();
55
- $hook->resultCode = CPResultCodes::SYSTEM_ERROR;
56
- $hook->resultMessage = "Not enough parameter set";
57
- $hook->writeResponse(self::defaultHeader, json_encode($hook));
58
- }
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  private function initExport() {
62
- ini_set('max_execution_time', 150);
63
- Mage::app('admin');
64
 
65
- $this->_dbConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
66
- $this->_productEntityTypeId = Mage::helper('channelpilot/export')->getEntityTypeIdForProduct();
67
 
68
  $this->_blankProduct = array();
69
- $this->_blankProduct['id'] = '';
70
  $this->_blankProduct['sku'] = '';
 
 
71
  $this->_blankProduct['name'] = '';
72
  $this->_blankProduct['description'] = '';
73
  $this->_blankProduct['price'] = '';
@@ -77,14 +132,9 @@ class CPExportHandler extends CPAbstractHandler {
77
  $this->_blankProduct['cp_image_url'] = '';
78
  $this->_blankProduct['color'] = '';
79
  $this->_blankProduct['weight'] = '';
80
-
81
- $this->_blankProduct['cp_additional_image_1'] = '';
82
- $this->_blankProduct['cp_additional_image_2'] = '';
83
- $this->_blankProduct['cp_additional_image_3'] = '';
84
-
85
- // By default, set media gallery attribute id to 703
86
- // Look it up later
87
- $this->_mediaGalleryAttributeId = 703;
88
 
89
  try {
90
  $store = Mage::app()->getStore($this->_storeId);
@@ -94,539 +144,390 @@ class CPExportHandler extends CPAbstractHandler {
94
  } catch (Exception $e) {
95
  die('Store=' . $this->_storeId . " probably does not exist.");
96
  }
97
- // $this->buildCategoryTree();
98
- $this->_allCat = Mage::helper('channelpilot/export')->buildCategoryTree();
99
- }
100
 
101
- private function getStockAndPriceData() {
102
- $selectProductIdsQuery = new Zend_Db_Select($this->_dbConnection);
103
- $selectProductIdsQuery->from(array('p' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),
104
- array('p.entity_id')
105
- );
106
- $selectProductIdsQuery->joinLeft(array('l' => Mage::getSingleton('core/resource')->getTableName('catalog/product_super_link')),
107
- 'l.product_id = p.entity_id',
108
- null
109
- );
110
- $selectProductIdsQuery->where('p.entity_id NOT IN (SELECT parent_id FROM '.
111
- $this->_dbConnection->quoteIdentifier(Mage::getSingleton('core/resource')->getTableName('catalog/product_super_link')). ')');
112
-
113
- if (isset($this->last)) {
114
- $selectProductIdsQuery->where('p.entity_id > ?', $this->last);
115
- }
116
- $selectProductIdsQuery->group('p.entity_id');
117
- $selectProductIdsQuery->order('p.entity_id ASC');
118
- $selectProductIdsQuery->limit($this->limit);
119
-
120
- $this->_dbConnection->setFetchMode(ZEND_DB::FETCH_NUM);
121
- $productEntities = $this->_dbConnection->fetchAll($selectProductIdsQuery);
122
- $productIds = array();
123
- foreach ($productEntities as $productId) {
124
- $productIds[] = $this->_dbConnection->quote($productId[0]);
125
- }
126
- $productIds = implode(',', $productIds);
127
-
128
- $columns = array('cpe.entity_id', 'cpe.sku');
129
-
130
- $subquery = new Zend_Db_Select($this->_dbConnection);
131
- $subquery->from(Mage::getSingleton('core/resource')->getTableName('catalog/product_super_link'),
132
- array(new Zend_Db_Expr('COUNT(*)'))
133
- );
134
- $subquery->where('parent_id = cpe.entity_id');
135
- $subquery->limit(1);
136
-
137
- $columns['is_parent'] = new Zend_Db_Expr('('.$subquery.')');
138
-
139
- $subquery = New Zend_Db_Select($this->_dbConnection);
140
- $subquery->from(array('cped' => Mage::getSingleton('core/resource')->getTableName(array('catalog/product', 'decimal'))),
141
- array('cped.value')
142
- );
143
- $subquery->joinLeft(array('eavAttr' => Mage::getSingleton('core/resource')->getTableName('eav/attribute')),
144
- 'eavAttr.attribute_id = cped.attribute_id',
145
- null
146
- );
147
- $subquery->where('cped.entity_id = cpe.entity_id');
148
- $subquery->where('eavAttr.attribute_code = ?', 'price');
149
- $subquery->limit(1);
150
-
151
- $columns['price'] = new Zend_Db_Expr('('.$subquery.')');
152
-
153
- $subquery = new Zend_Db_Select($this->_dbConnection);
154
- $subquery->from(Mage::getSingleton('core/resource')->getTableName('cataloginventory/stock_status'),
155
- array('qty')
156
- );
157
- $subquery->where('product_id = cpe.entity_id');
158
- $subquery->where('website_id = ?', $this->_siteId);
159
- $subquery->where('stock_id = 1');
160
- $subquery->limit(1);
161
-
162
- $columns['qty'] = new Zend_Db_Expr('('.$subquery.')');
163
-
164
- $subquery = new Zend_Db_Select($this->_dbConnection);
165
- $subquery->from(Mage::getSingleton('core/resource')->getTableName('cataloginventory/stock_status'),
166
- array('stock_status')
167
- );
168
- $subquery->where('product_id = cpe.entity_id');
169
- $subquery->where('website_id = ?', $this->_siteId);
170
- $subquery->where('stock_id = 1');
171
- $subquery->limit(1);
172
-
173
- $columns['stock_status'] = new Zend_Db_Expr('('.$subquery.')');
174
-
175
- $subquery = new Zend_Db_Select($this->_dbConnection);
176
- $subquery->from(array('crpp' => Mage::getSingleton('core/resource')->getTableName('catalogrule/rule_product_price')),
177
- array('crpp.rule_price')
178
- );
179
- $subquery->where('crpp.rule_date = CURDATE()');
180
- $subquery->where('crpp.product_id = cpe.entity_id');
181
- $subquery->where('crpp.customer_group_id = 1');
182
- $subquery->where('crpp.website_id = ?', $this->_siteId);
183
-
184
- $columns['cat_price'] = new Zend_Db_Expr('('.$subquery.')');
185
-
186
- $query = new Zend_Db_Select($this->_dbConnection);
187
- $query->from(array('cpe' => Mage::getSingleton('core/resource')->getTableName('catalog/product')), $columns);
188
- $query->join(array('cpw' => Mage::getSingleton('core/resource')->getTableName('catalog/product_website')),
189
- 'cpw.product_id = cpe.entity_id',
190
- null
191
- );
192
- $query->where('cpw.website_id = ?', $this->_siteId);
193
- $query->where("IFNULL(cpe.sku, '') != ''");
194
- $query->where('cpe.entity_id IN ('.$productIds.')');
195
- $query->order(array('is_parent DESC', 'entity_id ASC'));
196
-
197
- // Set fetch mode to numeric to save memory
198
- $this->_dbConnection->setFetchMode(ZEND_DB::FETCH_NUM);
199
- $productEntities = $this->_dbConnection->fetchAll($query);
200
- // Loop through each product and output the data
201
-
202
- $productData = array();
203
- foreach ($productEntities as $entity) {
204
- $product = array();
205
- $product['id'] = $entity[0];
206
- $product['sku'] = $entity[1];
207
- $product['price'] = $entity[3];
208
- if (empty($entity[6]) != true) {
209
- // Override price with catalog rule price
210
- $product['price'] = $entity[6];
211
- }
212
- $product['qty'] = $entity[4];
213
- $productData[] = $product;
214
- }
215
- return $productData;
216
  }
217
 
218
  /**
219
- * Get all products.
220
- * @return array
221
  */
222
- private function _getProductEntites() {
223
- $subquery = new Zend_Db_Select($this->_dbConnection);
224
- $subquery->from(Mage::getSingleton('core/resource')->getTableName('catalog/product_super_link'), array('parent_id'));
225
-
226
- $selectProductIdsQuery = new Zend_Db_Select($this->_dbConnection);
227
- $selectProductIdsQuery->from(array('p' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),
228
- array('p.entity_id', 'l.parent_id')
229
- );
230
- $selectProductIdsQuery->joinLeft(array('l' => Mage::getSingleton('core/resource')->getTableName('catalog/product_super_link')),
231
- 'l.product_id = p.entity_id',
232
- null
233
- );
234
- $selectProductIdsQuery->where('p.entity_id NOT IN(?)', $subquery);
235
-
236
- if (isset($this->last)) {
237
- $selectProductIdsQuery->where('p.entity_id > ?', $this->last);
238
- }
239
- $selectProductIdsQuery->group('p.entity_id');
240
- $selectProductIdsQuery->order('p.entity_id ASC');
241
- $selectProductIdsQuery->limit($this->limit);
242
-
243
- $this->_dbConnection->setFetchMode(ZEND_DB::FETCH_NUM);
244
- $productEntities = $this->_dbConnection->fetchAll($selectProductIdsQuery);
245
- $productIds = array();
246
- foreach ($productEntities as $productId) {
247
- $productIds[] = $this->_dbConnection->quote($productId[0]);
248
- if (!empty($productId[1])) {
249
- $productIds[] = $this->_dbConnection->quote($productId[1]);
250
  }
251
  }
252
- $productIds = implode(',', $productIds);
253
-
254
- // Get all entity_ids for all products in the selected store
255
- $columns = array('cpe.entity_id', 'cpe.sku');
256
-
257
- $subquery = new Zend_Db_Select($this->_dbConnection);
258
- $subquery->from(Mage::getSingleton('core/resource')->getTableName('catalog/product_super_link'),
259
- array('parent_id')
260
- );
261
- $subquery->where('product_id = cpe.entity_id');
262
- $subquery->limit(1);
263
-
264
- $columns['parent'] = new Zend_Db_Expr('('.$subquery.')');
265
-
266
- $subquery = new Zend_Db_Select($this->_dbConnection);
267
- $subquery->from(Mage::getSingleton('core/resource')->getTableName('catalog/product_super_link'),
268
- array(new Zend_Db_Expr('COUNT(*)'))
269
- );
270
- $subquery->where('parent_id = cpe.entity_id');
271
- $subquery->limit(1);
272
-
273
- $columns['is_parent'] = new Zend_Db_Expr('('.$subquery.')');
274
-
275
- $subquery = new Zend_Db_Select($this->_dbConnection);
276
- $subquery->from(Mage::getSingleton('core/resource')->getTableName('cataloginventory/stock_status'), array('qty'));
277
- $subquery->where('product_id = cpe.entity_id');
278
- $subquery->where('website_id = ?', $this->_siteId);
279
- $subquery->where('stock_id = 1');
280
- $subquery->limit(1);
281
-
282
- $columns['qty'] = new Zend_Db_Expr('('.$subquery.')');
283
-
284
- $subquery = new Zend_Db_Select($this->_dbConnection);
285
- $subquery->from(Mage::getSingleton('core/resource')->getTableName('cataloginventory/stock_status'),
286
- array('stock_status')
287
- );
288
- $subquery->where('product_id = cpe.entity_id');
289
- $subquery->where('website_id = ?', $this->_siteId);
290
- $subquery->where('stock_id = 1');
291
- $subquery->limit(1);
292
-
293
- $columns['stock_status'] = new Zend_Db_Expr('('.$subquery.')');
294
-
295
- $subquery = new Zend_Db_Select($this->_dbConnection);
296
- $subquery->from(array('crpp' => Mage::getSingleton('core/resource')->getTableName('catalogrule/rule_product_price')),
297
- array('crpp.rule_price')
298
- );
299
- $subquery->where('crpp.rule_date = CURDATE()');
300
- $subquery->where('crpp.product_id = cpe.entity_id');
301
- $subquery->where('crpp.customer_group_id = 1');
302
- $subquery->where('crpp.website_id = ?', $this->_siteId);
303
-
304
- $columns['cat_price'] = new Zend_Db_Expr('('.$subquery.')');
305
- $columns[] = 'cpe.type_id';
306
-
307
- $query = new Zend_Db_Select($this->_dbConnection);
308
- $query->from(array('cpe' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),
309
- $columns
310
- );
311
- $query->join(array('cpw' => Mage::getSingleton('core/resource')->getTableName('catalog/product_website')),
312
- 'cpw.product_id = cpe.entity_id',
313
- null
314
- );
315
- $query->where('cpw.website_id = ?', $this->_siteId);
316
- $query->where("IFNULL(cpe.sku, '') != ''");
317
- $query->where('cpe.entity_id IN ('.$productIds.')');
318
- $query->order(array('is_parent DESC', 'entity_id ASC'));
319
-
320
- return $this->_dbConnection->fetchAssoc($query);
321
  }
322
 
323
  /**
324
- * Get the category information for a product entity_id.
325
- * @param int $entityId
326
- * @return string
327
  */
328
- private function _getCategoryInformation($entityId) {
329
- // Get category information
330
- if (substr(Mage::getVersion(), 2, 3) >= 6 && Mage::getStoreConfigFlag('catalog/frontend/flat_catalog_category', $this->_storeId)) {
331
- $query = new Zend_Db_Select($this->_dbConnection);
332
- $query->distinct();
333
- $query->from(array('pi' => Mage::getSingleton('core/resource')->getTableName('catalog/category_product_index')),
334
- array('fs.entity_id', 'fs.path', 'fs.name')
335
- );
336
- $query->join(array('fs' => Mage::getSingleton('core/resource')
337
- ->getTableName(array('catalog/category_flat', 'store_'.$this->_storeId))),
338
- 'pi.category_id = fs.entity_id',
339
- null
340
- );
341
- $query->where('pi.product_id = ?', $entityId);
342
- $query->order('fs.path ASC');
343
- } else {
344
- $query = new Zend_Db_Select($this->_dbConnection);
345
- $query->from(array('pi' => Mage::getSingleton('core/resource')->getTableName('catalog/category_product_index')),
346
- array('pi.category_id', 'ce.path')
347
- );
348
- $query->join(array('ce' => Mage::getSingleton('core/resource')->getTableName('catalog/category')),
349
- 'pi.category_id = ce.entity_id',
350
- null
351
- );
352
- $query->where('pi.product_id = ?', $entityId);
353
- $query->where('pi.is_parent = 1');
354
- $query->where('pi.store_id = ?', $this->_storeId);
355
- $query->order('ce.path ASC');
356
- }
357
- $this->_dbConnection->setFetchMode(ZEND_DB::FETCH_NUM);
358
- $categoriesTable = $this->_dbConnection->fetchAll($query);
359
- $categorieField = '';
360
- $this->oldCatPath = '';
361
- foreach ($categoriesTable as $categorie) {
362
- if (($this->oldCatPath == '') || (strpos($categorie[1], $this->oldCatPath) !== 0)) {
363
- // Start tree
364
- if ($this->oldCatPath !== '') {
365
- if ($categorieField !== '') {
366
- $categorieField = $categorieField . ', ' . $this->_allCat[$this->oldCatPath];
367
- } else {
368
- $categorieField = $this->_allCat[$this->oldCatPath];
369
- }
370
- }
371
- $this->oldCatPath = $categorie[1];
372
  } else {
373
- // Add to tree
374
- $this->oldCatPath = $categorie[1];
375
  }
376
  }
377
- if ($categorieField !== '') {
378
- $categorieField = $categorieField . ', ' . $this->_allCat[$this->oldCatPath];
379
- } else {
380
- if ($this->oldCatPath !== '') {
381
- $categorieField = $this->_allCat[$this->oldCatPath];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  }
 
383
  }
384
- return $categorieField;
385
  }
386
 
387
  /**
388
- * Get the additional image urls for an entity_id.
389
- * @param int $entityId
 
390
  * @return array
391
  */
392
- private function _getAdditionalImageUrl($entityId) {
393
- $galleryImagePrefix = $this->_dbConnection->quote($this->_mediaUrl . 'catalog/product');
394
-
395
- $query = new Zend_Db_Select($this->_dbConnection);
396
- $query->from(array('gallery' => Mage::getSingleton('core/resource')->getTableName('catalog/product_attribute_media_gallery')),
397
- array(
398
- 'value_id' => new Zend_Db_Expr("GROUP_CONCAT(gallery.value_id SEPARATOR ',')"),
399
- 'value' => new Zend_Db_Expr("GROUP_CONCAT(CONCAT(" . $galleryImagePrefix . ", gallery.value) SEPARATOR ',')")
400
- )
401
- );
402
- $query->join(array('gallery_value' => Mage::getSingleton('core/resource')->getTableName('catalog/product_attribute_media_gallery_value')),
403
- 'gallery.value_id = gallery_value.value_id',
404
- null
405
- );
406
- $query->where('gallery_value.store_id IN(0, ?)', $this->_storeId);
407
- $query->where('gallery_value.disabled = 0');
408
- $query->where('gallery.entity_id = ?', $entityId);
409
- $query->where('gallery.attribute_id = ?', $this->_mediaGalleryAttributeId);
410
- $query->order('gallery_value.position ASC');
411
-
412
- $this->_dbConnection->setFetchMode(ZEND_DB::FETCH_NUM);
413
- return $this->_dbConnection->fetchAll($query);
414
  }
415
 
416
- private function getFullProductData() {
417
- // Increase maximium length for group_concat (for additional image URLs field)
418
- $query = "SET SESSION group_concat_max_len = 1000000;";
419
- $this->_dbConnection->query($query);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
 
421
- // Get attribute codes and types
422
- $attributes = Mage::helper('channelpilot/export')->getProductAttributes();
 
423
 
424
- Mage::helper('channelpilot/export')->setSpecialExportField($this->_blankProduct);
 
425
 
426
- $attributeCodes = array();
427
- $attributeOptions = array();
428
- foreach ($attributes as $row) {
429
- // Save attribute ID for media gallery
430
- if ($row['attribute_code'] == 'media_gallery') {
431
- $this->_mediaGalleryAttributeId = $row['attribute_id'];
432
- }
433
-
434
- if($row['attribute_code'] == 'image') {
435
- $this->_baseImageAttributeId = $row['attribute_id'];
436
- }
437
 
438
- if($row['backend_type'] != 'static') {
439
- $attributeCodes[$row['attribute_id']] = $row['attribute_code'];
 
 
 
 
 
 
 
 
440
  }
441
 
442
- // If the type is multiple choice, cache the option values
443
- // in a lookup array for performance (avoids several joins/aggregations)
444
- if ($row['frontend_input'] == 'select' || $row['frontend_input'] == 'multiselect') {
445
- $result = Mage::helper('channelpilot/export')->getAttributeOptions($row['attribute_id'], $this->_storeId);
446
- // If found, then save the lookup table in the attributeOptions array
447
- if (is_array($result)) {
448
- $attributeOptions[$row['attribute_id']] = $result;
449
- } else {
450
- // Otherwise, leave a blank array
451
- $attributeOptions[$row['attribute_id']] = array();
452
- }
453
- $result = null;
454
- }
455
- }
456
 
457
- return $this->_getProductData($attributeCodes, $attributeOptions);
458
- }
 
 
 
 
 
459
 
460
  /**
461
- * Get the product data.
462
- *
463
- * @param array $attributeCodes
464
- * @param array $attributeOptions
465
- * @return array
 
466
  */
467
- private function _getProductData(array $attributeCodes, array $attributeOptions) {
468
- $parentProductArray = array();
469
- $exportFields = Mage::helper('channelpilot/export')->getExportFields($attributeCodes, $this->_blankProduct);
470
- $masterProductQuery = Mage::helper('channelpilot/export')->getMasterProductQuery($this->_storeId, $exportFields['id']);
471
- $productData = array();
472
- foreach ($this->_getProductEntites() as $entity) {
473
- // Fill the master query with the entity ID
474
- $query = str_replace('@ENTITY_ID', $entity['entity_id'], $masterProductQuery);
475
- $result = $this->_dbConnection->query($query);
476
-
477
- // Create a new product record
478
- $product = $this->_blankProduct;
479
-
480
- // Initialize basic product data
481
- $product['id'] = $entity['entity_id'];
482
- $product['sku'] = $entity['sku'];
483
-
484
- $product_status = null;
485
- $product_url = null;
486
- $product_image = null;
487
- // Loop through each field in the row and get the value
488
- foreach($result->fetchAll() as $column) {
489
- // Translate the option option_id to a value.
490
- if (isset($attributeOptions[$column[1]])) {
491
- // Convert all option values
492
- $optionValues = explode(',', $column[0]);
493
- $convertedOptionValues = array();
494
- foreach ($optionValues as $optionValue) {
495
- if (isset($attributeOptions[$column[1]][$optionValue]) == true) {
496
- // If a option_id is found, translate it
497
- $convertedOptionValues[] = $attributeOptions[$column[1]][$optionValue];
498
- }
499
- }
500
- // Erase values that are set to zero
501
- if ($column[0] == '0') {
502
- $column[0] = '';
503
- } elseif (!empty($convertedOptionValues)) {
504
- // Use convert values if any conversions exist
505
- $column[0] = implode(',', $convertedOptionValues);
506
- }
507
- // Otherwise, leave value as-is
508
- }
509
 
510
- if (in_array($attributeCodes[$column[1]], $exportFields['code'])) {
511
- $product[$attributeCodes[$column[1]]] = $column[0];
512
- }
 
513
 
514
- if ($attributeCodes[$column[1]] == 'status') {
515
- $product_status = $column[0];
516
- }
517
- if ($attributeCodes[$column[1]] == 'url_path') {
518
- $product_url = $column[0];
519
- }
520
- if ($attributeCodes[$column[1]] == 'image') {
521
- $product_image = $column[0];
522
- }
523
  }
524
- $result = null;
525
 
526
- // Skip product that are disabled or have no status
527
- if (empty($product_status) || $product_status == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
528
- continue;
529
- }
 
 
 
 
530
 
531
- $product['categories'] = $this->_getCategoryInformation($entity['entity_id']);
 
 
 
 
532
 
533
- // Get stock quantity
534
- // NOTE: stock_id = 1 is the 'Default' stock
535
- if (in_array('qty', $exportFields['code'])) {
536
- if (empty($entity['qty']) == true) {
537
- $product['qty'] = '0';
538
- } else {
539
- $product['qty'] = $entity['qty'];
540
- }
541
- }
542
 
543
- if (in_array('stock_status', $exportFields['code'])) {
544
- if (empty($entity['stock_status']) == true) {
545
- $product['stock_status'] = '';
546
- } else {
547
- $product['stock_status'] = $entity['stock_status'];
548
- }
549
- }
550
- $stockInfoResult = null;
551
-
552
- // Get additional image URLs
553
- $galleryValues = Mage::helper('channelpilot/export')->getAdditionalImageUrl(
554
- $entity['entity_id'],
555
- $this->_storeId,
556
- $this->_mediaGalleryAttributeId,
557
- $this->_baseImageAttributeId
558
- );
559
 
560
- if (empty($galleryValues) != true) {
561
- $additional_images = explode(',', $galleryValues[0][1]);
562
- for ($i = 0; $i <= 2; $i++) {
563
- if (isset($additional_images[$i])) {
564
- $product['cp_additional_image_' . ($i + 1)] = $additional_images[$i];
565
- }
566
- }
567
- }
568
 
569
- // Get parent ID
570
- if (empty($entity['parent']) != true && in_array('parent_id', $exportFields['code'])) {
571
- $product['parent_id'] = $entity['parent'];
 
 
 
 
 
 
 
 
572
  }
573
 
574
- // Override price with catalog price rule, if found
575
- if (empty($entity['cat_price']) != true) {
576
- // Override price with catalog rule price
577
- $product['price'] = $entity['cat_price'];
578
  }
579
 
580
- // Calculate image and product URLs
581
- if (empty($product_url) == false) {
582
- $product['cp_product_url'] = $this->_urlPathJoin($this->_webUrl, $product_url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583
  }
 
 
 
 
584
 
585
- if (empty($product_image) == false) {
586
- $product['cp_image_url'] = $this->_urlPathJoin($this->_mediaUrl, 'catalog/product');
587
- $product['cp_image_url'] = $this->_urlPathJoin($product['cp_image_url'], $product_image);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
588
  }
 
 
589
 
590
- $replace_fields = unserialize(Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_replacefields'));
591
- if (!empty($replace_fields)) {
592
- // PARENT
593
- if ($entity['is_parent'] > 0) {
594
- foreach ($replace_fields as $element) {
595
- if (!empty($element['productattribute']) && array_key_exists($element['productattribute'], $product)) {
596
- $parentProductArray[$product['id']][$element['productattribute']] = $product[$element['productattribute']];
597
- }
598
- }
599
- } else {
600
- // CHILD
601
- if ($entity['parent'] != null) {
602
- foreach ($replace_fields as $element) {
603
- if (!empty($element['productattribute']) && array_key_exists($element['productattribute'], $product)) {
604
- $product[$element['productattribute']] = $parentProductArray[$entity['parent']][$element['productattribute']];
605
- }
606
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
  }
608
  }
 
 
 
 
609
  }
610
 
611
- if($exportFields['use_type_id']) {
612
- $product['type_id'] = $entity['type_id'];
613
- }
614
 
615
- if ($entity['is_parent'] < 1) {
616
- foreach ($product as $key => $value) {
617
- $product[$key] = str_replace('""', '"', $value);
618
- }
619
- $this->productId = $product['id'];
620
- $productData[] = $product;
621
  }
622
  }
623
- return $productData;
624
- }
625
 
626
- // Join two URL paths and handle forward slashes
627
- private function _urlPathJoin($part1, $part2) {
628
- return rtrim($part1, '/') . '/' . ltrim($part2, '/');
629
- }
630
  }
631
 
632
  ?>
11
  private $_siteId;
12
  private $_mediaUrl;
13
  private $_webUrl;
 
14
  private $_allCat;
15
  private $oldCatPath;
16
+ private $_limit;
17
+ private $_last;
 
 
 
18
  private $_blankProduct;
19
+ private $_exportMethod;
20
+ private $_configurableAttributes = array();
21
+ private $_imageBaseUrl;
22
+ private $_maxAdditionalImages;
23
+ private $_exportFields;
24
+
25
+ const METHOD_XML = 0;
26
+ const METHOD_JSON = 1;
27
 
28
  /**
29
  * Handle status event
30
  *
31
  */
32
+ public function handle($exportMethod = self::METHOD_XML) {
33
+ $limit = Mage::app()->getRequest()->getParam('limit', null);
34
+ $store = Mage::app()->getRequest()->getParam('store', null);
35
+ $this->_exportMethod = $exportMethod;
36
+ $this->_limit = $limit;
37
+ $this->_last = Mage::app()->getRequest()->getParam('last', null);
38
+ try {
39
+ $this->_storeId = Mage::app()->getStore($store)->getId();
40
+ } catch(Exception $e) {
41
+ $this->_handleStoreException();
42
+ return;
43
+ }
44
+
45
+ $this->initExport();
46
+ $productData = $this->_export();
47
+
48
+ switch($this->_exportMethod) {
49
+ case self::METHOD_XML:
50
+ $this->_toXml($productData);
51
+ break;
52
+ case self::METHOD_JSON:
53
+ $this->_toJson($productData);
54
+ break;
55
+ default:
56
+ echo "Export method not supported.";
57
+ return;
58
+ }
 
 
 
59
  }
60
 
61
+ /**
62
+ * Display an error message based on current export (and therefore display) method
63
+ * if an exception has occured during Mage::app()->getStore().
64
+ */
65
+ private function _handleStoreException() {
66
+ // The exception thrown by Mage::app()->getStore() has an empty message ...
67
+ switch($this->_exportMethod) {
68
+ case self::METHOD_XML:
69
+ $xml = new SimpleXMLElement('<root></root>');
70
+ $xml->addChild('error', 'Error retrieving store.');
71
+ header('Content-Type: text/xml; charset=utf-8');
72
+ echo $xml->asXML();
73
+ break;
74
+ case self::METHOD_JSON:
75
+ default:
76
+ $hook = new CPHookResponse();
77
+ $hook->resultCode = CPResultCodes::SYSTEM_ERROR;
78
+ $hook->resultMessage = "Error retrieving store.";
79
+ $hook->writeResponse(self::defaultHeader, json_encode($hook));
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Check if another currency (other than the base currency) should be used. Displays an error if the
85
+ * given currency could not be found.
86
+ */
87
+ private function _initCurrencyChange() {
88
+ $currencyCode = Mage::app()->getRequest()->getParam('currency', false);
89
+ if ($currencyCode && $currencyCode != '') {
90
+ $result = Mage::getModel('directory/currency')->getCurrencyRates(Mage::app()->getBaseCurrencyCode(), $currencyCode);
91
+ if(count($result) === 0){
92
+ switch($this->_exportMethod) {
93
+ case self::METHOD_XML:
94
+ $xml = new SimpleXMLElement('<root></root>');
95
+ $xml->addChild('error', 'wrong currency');
96
+ header('Content-Type: text/xml; charset=utf-8');
97
+ echo $xml->asXML();
98
+ exit();
99
+ case self::METHOD_JSON:
100
+ default:
101
+ $hook = new CPHookResponse();
102
+ $hook->resultCode = CPResultCodes::SYSTEM_ERROR;
103
+ $hook->resultMessage = "wrong currency";
104
+ $hook->writeResponse(self::defaultHeader, json_encode($hook));
105
+ }
106
+ }
107
+ $this->_currencyChange = $result[$currencyCode];
108
+
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Initialize the export.
114
+ */
115
  private function initExport() {
116
+ ini_set('max_execution_time', 7200);
 
117
 
118
+ // Initialize the admin application
119
+ Mage::app('admin');
120
 
121
  $this->_blankProduct = array();
122
+ $this->_blankProduct['entity_id'] = '';
123
  $this->_blankProduct['sku'] = '';
124
+ $this->_blankProduct['parent_id'] = '';
125
+ $this->_blankProduct['variationTheme'] = '';
126
  $this->_blankProduct['name'] = '';
127
  $this->_blankProduct['description'] = '';
128
  $this->_blankProduct['price'] = '';
132
  $this->_blankProduct['cp_image_url'] = '';
133
  $this->_blankProduct['color'] = '';
134
  $this->_blankProduct['weight'] = '';
135
+ for($i = 1; $i <= Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_imagenumber'); $i++) {
136
+ $this->_blankProduct['cp_additional_image_'.$i] = '';
137
+ }
 
 
 
 
 
138
 
139
  try {
140
  $store = Mage::app()->getStore($this->_storeId);
144
  } catch (Exception $e) {
145
  die('Store=' . $this->_storeId . " probably does not exist.");
146
  }
 
 
 
147
 
148
+ $this->buildCategoryTree();
149
+
150
+ $this->_initCurrencyChange();
151
+
152
+ $this->_initConfigurableAttributes();
153
+
154
+ /** @var $mediaConfig Mage_Catalog_Model_Product_Media_Config */
155
+ $mediaConfig = Mage::getSingleton('catalog/product_media_config');
156
+ $this->_imageBaseUrl = $mediaConfig->getBaseMediaUrl();
157
+
158
+ $this->_maxAdditionalImages = Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_imagenumber');
159
+ $this->_exportFields = unserialize(Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_exportfields'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
161
 
162
  /**
163
+ * Build the category tree.
 
164
  */
165
+ public function buildCategoryTree() {
166
+ $this->_allCat = array();
167
+ $this->oldCatPath = '';
168
+ $oldCatTree = '';
169
+
170
+ $categoryCollection = Mage::getModel('catalog/category')->getCollection()
171
+ ->addAttributeToSelect('name')
172
+ ->addAttributeToSort('path');
173
+
174
+ foreach($categoryCollection as $category) {
175
+ if (strpos($category->getPath(), $this->oldCatPath) !== 0) {
176
+ // start tree
177
+ $path = $this->getCategory($category->getPath());
178
+ if($path !== 0) {
179
+ $this->_allCat[$category->getPath()] = str_replace('Root Catalog', 'Home', $path . '>' . $category->getName());
180
+ $oldCatTree = $path . '>' . $category->getName();
181
+ } else {
182
+ $this->_allCat[$category->getPath()] = str_replace('Root Catalog', 'Home', $category->getName());
183
+ $oldCatTree = $category->getName();
184
+ }
185
+ } else {
186
+ // continue tree
187
+ $this->_allCat[$category->getPath()] = str_replace('Root Catalog', 'Home', $oldCatTree . '>' . $category->getName());
188
+ $oldCatTree = $this->_allCat[$category->getPath()];
 
 
 
 
189
  }
190
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  }
192
 
193
  /**
194
+ * Get the category id from a path.
195
+ * @param $key
196
+ * @return int | string
197
  */
198
+ private function getCategory($key) {
199
+ $return = 0;
200
+ if (strpos($key, '/') != false) {
201
+ $tmpKey = substr($key, 0, strpos($key, strrchr($key, '/')));
202
+ if (isset($this->_allCat[$tmpKey])) {
203
+ $return = $this->_allCat[$tmpKey];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  } else {
205
+ $return = $this->getCategory($tmpKey);
 
206
  }
207
  }
208
+ return $return;
209
+ }
210
+
211
+ /**
212
+ * Initialize the configurableAttributes array.
213
+ * Array(
214
+ * [PRODUCT_ID] => ARRAY(
215
+ * [ATTRIBUTE_CODE] => [FRONTEND_LABEL]
216
+ * )
217
+ * )
218
+ */
219
+ private function _initConfigurableAttributes() {
220
+ $this->_configurableAttributes = array();
221
+
222
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
223
+
224
+ $select = $connection->select()
225
+ ->from(array('super_attribute' => Mage::getSingleton('core/resource')->getTableName('catalog/product_super_attribute')), array('attribute_id', 'product_id'))
226
+ ->join(array('attribute' => Mage::getSingleton('core/resource')->getTableName('eav/attribute')),
227
+ 'attribute.attribute_id = super_attribute.attribute_id',
228
+ array('attribute_code', 'frontend_label')
229
+ );
230
+
231
+ $result = $connection->fetchAll($select);
232
+
233
+ foreach($result as $attribute) {
234
+ if(!isset($this->_configurableAttributes[$attribute['product_id']])) {
235
+ $this->_configurableAttributes[$attribute['product_id']] = array();
236
  }
237
+ $this->_configurableAttributes[$attribute['product_id']][$attribute['attribute_code']] = $attribute['frontend_label'];
238
  }
 
239
  }
240
 
241
  /**
242
+ * Get an array of attribute codes for all configurable attributes of a product ID.
243
+ *
244
+ * @param int $productId
245
  * @return array
246
  */
247
+ private function _getConfigurableAttributes($productId) {
248
+ $attributeOptions = array();
249
+ if(isset($this->_configurableAttributes[$productId])) {
250
+ foreach($this->_configurableAttributes[$productId] as $attributeCode => $label) {
251
+ $attributeOptions[] = $label;
252
+ }
253
+ }
254
+ return $attributeOptions;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  }
256
 
257
+ /**
258
+ * Export the products and return them as array.
259
+ * @return array
260
+ */
261
+ private function _export() {
262
+ $flatEnabled = false;
263
+ if(class_exists('Mage_Core_Model_App_Emulation')) {
264
+ /* @var $flatHelper Mage_Catalog_Helper_Product_Flat */
265
+ $flatHelper = Mage::helper('catalog/product_flat');
266
+ /* @var $emulationModel Mage_Core_Model_App_Emulation */
267
+ $emulationModel = Mage::getModel('core/app_emulation');
268
+ if ($flatHelper) {
269
+ $flatEnabled = method_exists($flatHelper, 'isAvailable') ? $flatHelper->isAvailable() : $flatHelper->isEnabled();
270
+ if($flatEnabled) {
271
+ // Emulate admin environment to disable using flat model - otherwise we won't get global stats
272
+ // for all stores
273
+ $initialEnvironmentInfo = $emulationModel->startEnvironmentEmulation(0, Mage_Core_Model_App_Area::AREA_ADMINHTML);
274
+ }
275
+ }
276
+ }
277
+
278
+ /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */
279
+ $collection = Mage::getModel('catalog/product')->getCollection()
280
+ ->addAttributeToSelect('*')
281
+ ->joinField('qty',
282
+ 'cataloginventory/stock_item',
283
+ 'qty',
284
+ 'product_id=entity_id',
285
+ '{{table}}.stock_id=1',
286
+ 'left')
287
+ ->addAttributeToSort('type_id')
288
+ ->setStoreId($this->_storeId);
289
+
290
+ if($this->_last) {
291
+ $collection->setCurPage($this->_last);
292
+ }
293
 
294
+ if($this->_limit) {
295
+ $collection->setPageSize($this->_limit);
296
+ }
297
 
298
+ /** @var $backendModel Mage_Catalog_Model_Product_Attribute_Backend_Media */
299
+ $backendModel = $collection->getResource()->getAttribute('media_gallery')->getBackend();
300
 
301
+ $onlyStockAndPriceData = (Mage::app()->getRequest()->getParam('priceStock', '') === "true");
 
 
 
 
 
 
 
 
 
 
302
 
303
+ $productData = array();
304
+
305
+ /** @var $item Mage_Catalog_Model_Product */
306
+ foreach ($collection as $item) {
307
+
308
+ if($onlyStockAndPriceData) {
309
+ $product = $this->_getOnlyStockAndPriceData($item);
310
+ } else {
311
+ $backendModel->afterLoad($item);
312
+ $product = $this->_getFullProductData($item);
313
  }
314
 
315
+ $productData[] = $product;
316
+ }
 
 
 
 
 
 
 
 
 
 
 
 
317
 
318
+ // stop emulating admin store and set initial environment
319
+ if ($flatEnabled) {
320
+ $emulationModel->stopEnvironmentEmulation($initialEnvironmentInfo);
321
+ }
322
+
323
+ return $productData;
324
+ }
325
 
326
  /**
327
+ * Get the current $item as array.
328
+ * Returns Array(
329
+ * [ATTRIBUTE_CODE] => [VALUE]
330
+ * )
331
+ * @param Mage_Catalog_Model_Product $item
332
+ * @return array
333
  */
334
+ private function _getFullProductData(Mage_Catalog_Model_Product $item) {
335
+ $imageUrl = $this->_imageBaseUrl . $item->getImage();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
 
337
+ $isParent = 0;
338
+ if ($item->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
339
+ $isParent = 1;
340
+ }
341
 
342
+ $parentId = null;
343
+ if ($item->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
344
+ $parentId = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($item->getId());
345
+ if(is_array($parentId) && !empty($parentId)) {
346
+ $parentId = $parentId[0];
 
 
 
 
347
  }
348
+ }
349
 
350
+ $configurableAttributes = array();
351
+ if($parentId && isset($this->_variationThemes[$parentId])) {
352
+ $configurableAttributes = $this->_variationThemes[$parentId];
353
+ } else if($isParent && $parentId === null) {
354
+ $configurableAttributes = $this->_getConfigurableAttributes($item->getId());
355
+ $configurableAttributes = (!empty($configurableAttributes)) ? implode('|', $configurableAttributes) : '';
356
+ $this->_variationThemes[$item->getId()] = $configurableAttributes;
357
+ }
358
 
359
+ // workaround... $item->getProductUrl() sometimes adds store code to url (e.g. <url>?___store=default)
360
+ $productUrl = $this->_webUrl . $item->getUrlPath();
361
+ $colorText = $item->getAttributeText('color');
362
+ $rulePrice = Mage::getModel('catalogrule/rule')->calcProductPriceRule($item->setStoreId($this->_storeId),$item->getPrice());
363
+ $price = ($rulePrice) ? $rulePrice : $item->getPrice();
364
 
365
+ $product = $this->_blankProduct;
 
 
 
 
 
 
 
 
366
 
367
+ $product['entity_id'] = $item->getId();
368
+ $product['sku'] = $item->getSku();
369
+ $product['parent_id'] = $parentId;
370
+ $product['variationTheme'] = $configurableAttributes;
371
+ $product['name'] = $item->getName();
372
+ $product['description'] = $item->getDescription();
 
 
 
 
 
 
 
 
 
 
373
 
374
+ $product['price'] = $price;
375
+ if($this->_currencyChange) {
376
+ $product['price'] = round($product['price']*$this->_currencyChange, 2);
377
+ }
 
 
 
 
378
 
379
+ $product['categories'] = $this->_getCategoryInformation($item);
380
+ $product['manufacturer'] = $item->getManufacturer();
381
+ $product['cp_product_url'] = $productUrl;
382
+ $product['cp_image_url'] = $imageUrl;
383
+ $product['color'] = ($colorText) ? $colorText : null;
384
+ $product['weight'] = $item->getWeight();
385
+
386
+ $counter = 1;
387
+ foreach ($item->getMediaGalleryImages() as $image) {
388
+ if ($counter > $this->_maxAdditionalImages) {
389
+ break;
390
  }
391
 
392
+ if ($image->getFile() == $item->getImage()) {
393
+ continue;
 
 
394
  }
395
 
396
+ $product['cp_additional_image_' . $counter] = $this->_imageBaseUrl . $image->getFile();
397
+ $counter++;
398
+ }
399
+
400
+ $product['is_parent'] = $isParent;
401
+
402
+ foreach($this->_exportFields as $field) {
403
+ $code = $field['productattribute'];
404
+ switch($code) {
405
+ case 'qty':
406
+ $product[$code] = $item->getQty();
407
+ break;
408
+ case 'stock_status':
409
+ $product[$code] = $item->getStockItem()->getIsInStock();
410
+ break;
411
+ default:
412
+ $attributeText = $item->getAttributeText($code);
413
+ $product[$code] = ($attributeText) ? $attributeText : $item->getData($code);
414
  }
415
+ }
416
+
417
+ return $product;
418
+ }
419
 
420
+ /**
421
+ * Get only the stock and price data for a product as array. Attributes: entity_id, sku, price, qty.
422
+ * Array(
423
+ * [ATTRIBUTE_CODE] => [VALUE]
424
+ * )
425
+ * @param Mage_Catalog_Model_Product $item
426
+ * @return array
427
+ */
428
+ private function _getOnlyStockAndPriceData(Mage_Catalog_Model_Product $item) {
429
+ $rulePrice = Mage::getModel('catalogrule/rule')->calcProductPriceRule($item->setStoreId($this->_storeId),$item->getPrice());
430
+ $price = ($rulePrice) ? $rulePrice : $item->getPrice();
431
+
432
+ $product['entity_id'] = $item->getId();
433
+ $product['sku'] = $item->getSku();
434
+ $product['price'] = $price;
435
+ if($this->_currencyChange) {
436
+ $product['price'] = round($product['price']*$this->_currencyChange, 2);
437
+ }
438
+
439
+ $product['qty'] = $item->getQty();
440
+
441
+ return $product;
442
+ }
443
+
444
+ /**
445
+ * Creates and shows an XML based on the values of the $productData array created by the export method.
446
+ * Sends a Content-Type header.
447
+ * @param array $productData
448
+ */
449
+ private function _toXml(array $productData) {
450
+ $xml = new SimpleXMLElement('<root></root>');
451
+ $xmlCatalog = $xml->addChild('catalog');
452
+ foreach($productData as $product) {
453
+ $xmlProduct = $xmlCatalog->addChild('product');
454
+ $this->_productToXml($product, $xmlProduct);
455
+ }
456
+ header('Content-Type: text/xml; charset=utf-8');
457
+ echo $xml->asXML();
458
+ exit();
459
+ }
460
+
461
+ /**
462
+ * Adds the values of the $product array to the $xml structure.
463
+ * @param array $product
464
+ * @param SimpleXMLElement $xml
465
+ */
466
+ private function _productToXml(array $product, SimpleXMLElement $xml) {
467
+ foreach($product as $code => $value) {
468
+ if (is_string($value) || is_numeric($value) || is_bool($value)) {
469
+ $xml->addChild($code, $value);
470
+ } else {
471
+ $node = $xml->addChild($code);
472
+ $this->_productToXml($value, $node);
473
  }
474
+ }
475
+ }
476
 
477
+ /**
478
+ * Shows the content of $productData as JSON.
479
+ * @param array $productData
480
+ */
481
+ private function _toJson(array $productData) {
482
+ $hook = new CPHookResponse();
483
+ $hook->resultCode = CPResultCodes::SUCCESS;
484
+ $hook->products = $productData;
485
+ $hook->resultMessage = "ProductData of " . sizeof($hook->products) . " articles";
486
+ $hook->moreAvailable = true;
487
+ if (sizeof($hook->products) < $this->_limit) {
488
+ $hook->moreAvailable = false;
489
+ }
490
+ $hook->writeResponse(self::defaultHeader, json_encode($hook));
491
+ }
492
+
493
+ /**
494
+ * Get the category information for a product.
495
+ * @param Mage_Catalog_Model_Product $product
496
+ * @return string
497
+ */
498
+ private function _getCategoryInformation(Mage_Catalog_Model_Product $product) {
499
+ $categorieField = '';
500
+ $this->oldCatPath = '';
501
+
502
+ /** @var $category Mage_Catalog_Model_Category */
503
+ foreach($product->getCategoryCollection() as $category) {
504
+ if (($this->oldCatPath == '') || (strpos($category->getPath(), $this->oldCatPath) !== 0)) {
505
+ // Start tree
506
+ if ($this->oldCatPath !== '') {
507
+ if ($categorieField !== '') {
508
+ $categorieField = $categorieField . ', ' . $this->_allCat[$this->oldCatPath];
509
+ } else {
510
+ $categorieField = $this->_allCat[$this->oldCatPath];
511
  }
512
  }
513
+ $this->oldCatPath = $category->getPath();
514
+ } else {
515
+ // Add to tree
516
+ $this->oldCatPath = $category->getPath();
517
  }
518
 
519
+ }
 
 
520
 
521
+ if ($categorieField !== '') {
522
+ $categorieField = $categorieField . ', ' . $this->_allCat[$this->oldCatPath];
523
+ } else {
524
+ if ($this->oldCatPath !== '') {
525
+ $categorieField = $this->_allCat[$this->oldCatPath];
 
526
  }
527
  }
 
 
528
 
529
+ return ltrim($categorieField, '>');
530
+ }
 
 
531
  }
532
 
533
  ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPOrderHandler.php CHANGED
@@ -198,6 +198,15 @@ class CPOrderHandler extends CPAbstractHandler {
198
  return $apiOrder;
199
  }
200
 
 
 
 
 
 
 
 
 
 
201
  $service = Mage::getModel('sales/service_quote', $quote);
202
  $service->submitAll();
203
  $order = $service->getOrder();
@@ -340,12 +349,13 @@ class CPOrderHandler extends CPAbstractHandler {
340
  }
341
  break;
342
  case "sku":
343
- $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $id);
344
- if (is_object($product)) {
345
- $product = Mage::getModel('catalog/product')->load($product->getId());
346
- } else {
347
- $product = null;
348
- }
 
349
  break;
350
  default:
351
  break;
198
  return $apiOrder;
199
  }
200
 
201
+ // disable any discount to be applied and recollect totals
202
+ // has to be done after the quote has been created
203
+ $quote->setTotalsCollectedFlag(false);
204
+ foreach($quote->getAllItems() as $item) {
205
+ $item->setNoDiscount(1);
206
+ }
207
+
208
+ $quote->collectTotals()->save();
209
+
210
  $service = Mage::getModel('sales/service_quote', $quote);
211
  $service->submitAll();
212
  $order = $service->getOrder();
349
  }
350
  break;
351
  case "sku":
352
+ $productId = Mage::getModel('catalog/product')->getIdBySku($id);
353
+ if($productId) {
354
+ $product = Mage::getModel('catalog/product')->load($productId);
355
+ if (!is_object($product)) {
356
+ $product = null;
357
+ }
358
+ }
359
  break;
360
  default:
361
  break;
app/code/community/Channelpilotsolutions/Channelpilot/Model/Payment.php CHANGED
@@ -67,7 +67,7 @@ class Channelpilotsolutions_Channelpilot_Model_Payment extends Mage_Payment_Mode
67
  $types = array();
68
  $types["cp_mp_default"] = "ChannelPilot Marketplace Payment Default";
69
  $types["cp_mp_amazon"] = "ChannelPilot Marketplace Payment Amazon";
70
- // $types["cp_mp_ebay"] = "ChannelPilot Marketplace Payment Ebay";
71
  // $types["cp_mp_rakuten"] = "ChannelPilot Marketplace Payment Rakuten";
72
  // $types["cp_mp_cdiscount"] = "ChannelPilot Marketplace Payment CDiscount";
73
  return $types;
67
  $types = array();
68
  $types["cp_mp_default"] = "ChannelPilot Marketplace Payment Default";
69
  $types["cp_mp_amazon"] = "ChannelPilot Marketplace Payment Amazon";
70
+ $types["cp_mp_ebay"] = "ChannelPilot Marketplace Payment Ebay";
71
  // $types["cp_mp_rakuten"] = "ChannelPilot Marketplace Payment Rakuten";
72
  // $types["cp_mp_cdiscount"] = "ChannelPilot Marketplace Payment CDiscount";
73
  return $types;
app/code/community/Channelpilotsolutions/Channelpilot/etc/config.xml CHANGED
@@ -24,7 +24,7 @@
24
  <config>
25
  <modules>
26
  <Channelpilotsolutions_Channelpilot>
27
- <version>2.2.0</version>
28
  </Channelpilotsolutions_Channelpilot>
29
  </modules>
30
  <global>
24
  <config>
25
  <modules>
26
  <Channelpilotsolutions_Channelpilot>
27
+ <version>2.2.1</version>
28
  </Channelpilotsolutions_Channelpilot>
29
  </modules>
30
  <global>
app/code/community/Channelpilotsolutions/Channelpilot/sql/channelpilot_setup/mysql4-upgrade-1.0.0-2.0.0.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Channelpilotsolutions_Channelpilot to newer
12
+ * versions in the future. If you wish to customize Channelpilotsolutions_Channelpilot for your
13
+ * needs please refer to http://www.channelpilot.com for more information.
14
+ *
15
+ * @category Channelpilotsolutions
16
+ * @package Channelpilotsolutions_Channelpilot
17
+ * @copyright Copyright (c) 2012 <info@channelpilot.com> - www.channelpilot.com
18
+ * @author Bj�rn Wehner <info@channelpilot.com>
19
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
20
+ * @link http://www.channelpilot.com
21
+ */
22
+
23
+ $installer = $this;
24
+
25
+ $installer->startSetup();
26
+
27
+ /** @var $adapter Varien_Db_Adapter_Pdo_Mysql */
28
+ $adapter = $installer->getConnection();
29
+
30
+ /**
31
+ * Create table 'channelpilot/registration'
32
+ */
33
+ $table = $adapter->newTable($installer->getTable('channelpilot/registration'))
34
+ ->addColumn('shopId', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
35
+ 'nullable' => false,
36
+ 'primary' => true
37
+ ), 'shopId')
38
+ ->addColumn('ips_authorized', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
39
+ 'nullable' => false
40
+ ), 'ips_authorized')
41
+ ->addColumn('merchantId', Varien_Db_Ddl_Table::TYPE_VARCHAR, 150, array(
42
+ 'nullable' => false
43
+ ), 'merchantId')
44
+ ->addColumn('securityToken', Varien_Db_Ddl_Table::TYPE_VARCHAR, 150, array(
45
+ 'nullable' => false
46
+ ), 'securityToken')
47
+ ->addColumn('last_stock_update', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
48
+ 'nullable' => true
49
+ ), 'last_stock_update')
50
+ ->addColumn('last_price_update', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
51
+ 'nullable' => true
52
+ ), 'last_price_update')
53
+ ->addColumn('last_catalog_update', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
54
+ 'nullable' => true
55
+ ), 'last_catalog_update')
56
+ ->addIndex(
57
+ $installer->getIdxName(
58
+ $installer->getTable('channelpilot/registration'), array('merchantId', 'securityToken'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
59
+ ), array('merchantId', 'securityToken'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
60
+ );
61
+ $adapter->createTable($table);
62
+
63
+ /**
64
+ * Create table 'channelpilot/order'
65
+ */
66
+ $table = $adapter->newTable($installer->getTable('channelpilot/order'))
67
+ ->addColumn('order_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
68
+ 'nullable' => false,
69
+ 'primary' => true
70
+ ), 'order_id')
71
+ ->addColumn('order_nr', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
72
+ 'nullable' => false
73
+ ), 'order_nr')
74
+ ->addColumn('marketplace_order_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 150, array(
75
+ 'nullable' => false
76
+ ), 'marketplace_order_id')
77
+ ->addColumn('marketplace', Varien_Db_Ddl_Table::TYPE_VARCHAR, 150, array(
78
+ 'nullable' => false
79
+ ), 'marketplace')
80
+ ->addColumn('shop', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
81
+ 'nullable' => false
82
+ ), 'shop')
83
+ ->addColumn('created', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
84
+ 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT,
85
+ 'nullable' => false
86
+ ), 'created')
87
+ ->addColumn('status', Varien_Db_Ddl_Table::TYPE_INTEGER, 10, array(
88
+ 'nullable' => true
89
+ ), 'status')
90
+ ->addIndex($installer->getIdxName(
91
+ 'channelpilot/order', array('order_nr'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
92
+ ), array('order_nr'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
93
+ )
94
+ ->addIndex(
95
+ $installer->getIdxName(
96
+ $installer->getTable('channelpilot/order'), array('marketplace_order_id', 'marketplace'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
97
+ ), array('marketplace_order_id', 'marketplace'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
98
+ );
99
+ $adapter->createTable($table);
100
+
101
+ /**
102
+ * Create table 'channelpilot/order_item'
103
+ */
104
+ $table = $adapter->newTable($installer->getTable('channelpilot/order_item'))
105
+ ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, 11, array(
106
+ 'auto_increment' => true,
107
+ 'unsigned' => true,
108
+ 'nullable' => false,
109
+ 'primary' => true,
110
+ ), 'id')
111
+ ->addColumn('order_item_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
112
+ 'nullable' => false,
113
+ ), 'order_item_id')
114
+ ->addColumn('marketplace_order_item_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
115
+ 'nullable' => false
116
+ ), 'marketplace_order_item_id')
117
+ ->addColumn('order_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
118
+ 'nullable' => false
119
+ ), 'order_id')
120
+ ->addColumn('cancelled', Varien_Db_Ddl_Table::TYPE_INTEGER, 11, array(
121
+ 'default' => 0,
122
+ 'nullable' => false
123
+ ), 'cancelled')
124
+ ->addColumn('amount', Varien_Db_Ddl_Table::TYPE_INTEGER, 11, array(
125
+ 'default' => 0,
126
+ 'nullable' => false
127
+ ), 'amount')
128
+ ->addColumn('amount_delivered', Varien_Db_Ddl_Table::TYPE_INTEGER, 11, array(
129
+ 'default' => 0,
130
+ 'nullable' => false
131
+ ), 'amount_delivered')
132
+ ->addIndex($installer->getIdxName(
133
+ 'channelpilot/order_item', array('order_item_id'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
134
+ ), array('order_item_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
135
+ )
136
+ ->addIndex($installer->getIdxName(
137
+ 'channelpilot/order_item', array('marketplace_order_item_id'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
138
+ ), array('marketplace_order_item_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
139
+ )
140
+ ->addIndex($installer->getIdxName(
141
+ $installer->getTable('channelpilot/order_item'), array('marketplace_order_item_id', 'order_item_id'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
142
+ ), array('marketplace_order_item_id', 'order_item_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
143
+ );
144
+ $adapter->createTable($table);
145
+
146
+ /**
147
+ * Create table 'channelpilot/prices'
148
+ */
149
+ $table = $adapter->newTable($installer->getTable('channelpilot/prices'))
150
+ ->addColumn('price_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
151
+ 'nullable' => false,
152
+ 'primary' => true
153
+ ), 'price_id')
154
+ ->addColumn('last_price_update', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
155
+ 'nullable' => true
156
+ ), 'last_price_update');
157
+ $adapter->createTable($table);
158
+
159
+ /**
160
+ * Create table 'channelpilot/logs'
161
+ */
162
+ $table = $adapter->newTable($installer->getTable('channelpilot/logs'))
163
+ ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, 11, array(
164
+ 'auto_increment' => true,
165
+ 'nullable' => false,
166
+ 'primary' => true
167
+ ), 'id')
168
+ ->addColumn('created', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
169
+ 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT,
170
+ 'nullable' => false
171
+ ), 'created')
172
+ ->addColumn('content', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(
173
+ 'nullable' => false
174
+ ), 'content')
175
+ ->addIndex($installer->getIdxName(
176
+ 'channelpilot/logs', array('created')
177
+ ), array('created'));
178
+ $adapter->createTable($table);
179
+
180
+ $installer->endSetup();
app/design/frontend/base/default/template/Channelpilotsolutions/gtm.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if($this->isEnabled() && !$this->isTrackingModeImage() && strpos(Mage::app()->getRequest()->getRequestString(), 'checkout/success') !== false): ?>
2
+ <script type="text/javascript" src="//content.cptrack.de/clicks.js"></script>
3
+ <?php else: ?>
4
+ <?php $_order = $this->getOrder(); ?>
5
+
6
+ <script type="text/javascript">
7
+ var products = new Array();
8
+
9
+ <?php $_productIdField = $this->getProductIdField(); ?>
10
+ <?php foreach($_order->getItemsCollection(array(), true) as $_item): ?>
11
+ products.push({id: "<?php echo $_item->getData($_productIdField); ?>", price: <?php echo $_item->getPrice(); ?>, amount: <?php echo $_item->getQtyOrdered(); ?>})
12
+ <?php endforeach; ?>
13
+
14
+ dataLayer = [{
15
+ 'cp_trackingkey': '<?php echo $this->getTrackingKey(); ?>',
16
+ 'transactionId': '<?php echo $_order->getId(); ?>',
17
+ 'transactionValueNumber': '<?php echo ($_order->getGrandTotal() - $_order->getTaxAmount()); ?>',
18
+ 'pruchaseProductArray': products,
19
+ }];
20
+ </script>
21
+ <!-- Google Tag Manager -->
22
+ <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-TF8T67"
23
+ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
24
+ <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
25
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
26
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
27
+ '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
28
+ })(window,document,'script','dataLayer','GTM-TF8T67');</script>
29
+ <!-- End Google Tag Manager -->
30
+ <?php endif; ?>
31
+
32
+
33
+ var cpSale = {
34
+ trackingKey: "<?php echo $this->getTrackingKey();; ?>",
35
+ orderId: "<?php echo $_order->getId(); ?>",
36
+ orderTotal: <?php echo ($_order->getGrandTotal() - $_order->getTaxAmount()); ?>,
37
+ cookie: "<?php echo $this->getCookieMode(); ?>",
38
+ shoppingCart: new Array()
39
+ };
40
+
41
+ <?php $_productIdField = $this->getProductIdField(); ?>
42
+ <?php foreach($_order->getItemsCollection(array(), true) as $_item): ?>
43
+ cpSale.shoppingCart.push({id: "<?php echo $_item->getData($_productIdField); ?>", price: <?php echo $_item->getPrice(); ?>, amount: <?php echo $_item->getQtyOrdered(); ?>});
44
+ <?php endforeach; ?>
app/design/frontend/base/default/template/Channelpilotsolutions/salestracking_js.phtml CHANGED
@@ -27,7 +27,7 @@
27
  <?php if($_order): ?>
28
  <script type="text/javascript">
29
  var cpSale = {
30
- trackingKey: "<?php echo $this->getTrackingKey();; ?>",
31
  orderId: "<?php echo $_order->getId(); ?>",
32
  orderTotal: <?php echo ($_order->getGrandTotal() - $_order->getTaxAmount()); ?>,
33
  cookie: "<?php echo $this->getCookieMode(); ?>",
27
  <?php if($_order): ?>
28
  <script type="text/javascript">
29
  var cpSale = {
30
+ trackingKey: "<?php echo $this->getTrackingKey(); ?>",
31
  orderId: "<?php echo $_order->getId(); ?>",
32
  orderTotal: <?php echo ($_order->getGrandTotal() - $_order->getTaxAmount()); ?>,
33
  cookie: "<?php echo $this->getCookieMode(); ?>",
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Channelpilotsolutions_Channelpilot</name>
4
- <version>2.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
@@ -27,13 +27,11 @@
27
  &lt;/ul&gt;&#xD;
28
  Just get more information about ChannelPilot: &lt;a href="http://www.channelpilot.com"&gt;www.channelpilot.com&lt;/a&gt;</description>
29
  <notes>- general bugfixes&#xD;
30
- - tracking method selection added&#xD;
31
- - sellerAPI payment added&#xD;
32
- - sellerAPI partial cancellation added</notes>
33
  <authors><author><name>ChannelPilot Solutions GmbH</name><user>auto-converted</user><email>info@channelpilot.com</email></author></authors>
34
- <date>2015-08-13</date>
35
- <time>07:47:34</time>
36
- <contents><target name="magecommunity"><dir name="Channelpilotsolutions"><dir name="Channelpilot"><dir name="Adminhtml"><dir name="Model"><dir name="Articlenumber"><file name="Values.php" hash="a1701067c9e01cd4e7d62ef3bae53c83"/></dir><dir name="Cookiemode"><file name="Values.php" hash="1ec39f85bb7562c1b6a4614f759d9124"/></dir><dir name="Grossnet"><file name="Values.php" hash="11eaf553b0ec34299524ec6d5a9f1e13"/></dir><dir name="Imagenumber"><file name="Values.php" hash="010dbb2ec946627f338bc500d3d8d747"/></dir><dir name="Orderstatus"><file name="Values.php" hash="cbd19b0ff86f303aae19c61327e1dc54"/></dir><dir name="Pricefield"><file name="Values.php" hash="6b02dfa3fa93daafa8325d66a986b4ac"/></dir><dir name="Truefalse"><file name="Values.php" hash="e07f105d7d8dc9881690f162cd23472d"/></dir><dir name="Truefalsesecurity"><file name="Values.php" hash="509b5e1cc7cabbe179373bc0ed490499"/></dir></dir></dir><dir name="Block"><dir name="Adminhtml"><dir name="Field"><file name="Abstract.php" hash="a59d8aa3b55a773f94de2593bde9713c"/><file name="Exportfields.php" hash="9a389a3fea32173e571c00bf56cf1ea4"/><file name="Replacefields.php" hash="13ebad7efc8c4c88d1d4890806db133d"/><file name="Specialfields.php" hash="760716a50151f930d5be83b2442f1781"/><file name="Trackingkeys.php" hash="e32b2adc09b99df6d9fc12ca2c908e20"/></dir><file name="Hintlogo.php" hash="be78974a79e7cc59601254a8df0dc48b"/></dir><dir name="Tracking"><file name="Tracking.php" hash="8ca7432e620ed0b75219d67e093bfd84"/></dir></dir><dir name="Helper"><dir name="api"><dir name="1_0"><dir name="responses"><file name="GetManagedArticlePricesResponse.php" hash="9ad5adee1952b9408b442449791a1f34"/><file name="GetNewMarketplaceOrdersResponse.php" hash="cd5db953a84759b93a35a360956c4624"/><file name="GetServerTimeResponse.php" hash="07d157639b5bf715aa3f93b0d9e4b736"/><file name="Response.php" hash="c76ce62707a862e1c59346c668055b5d"/><file name="UpdateArticleResult.php" hash="a014c60be447fbb9cf48c947c8e9822f"/><file name="UpdateArticlesResponse.php" hash="338619d50391d91defb5c9d41370022f"/><file name="UpdateOrderResult.php" hash="0fbd88371624270a8cb2c4209a89cfac"/><file name="UpdateOrdersResponse.php" hash="b0ad5828da633b05e654da393b15526a"/></dir><dir name="thin"><file name="CPAddress.php" hash="885fb4517335421fbd8cbc882ae336b1"/><file name="CPArticle.php" hash="1adce1ce33acdd0185dee06010040b18"/><file name="CPArticleUpdate.php" hash="45f514823895c754010f8f11a1ff683a"/><file name="CPAuth.php" hash="cf5fe570dbd98e3e6339b20cec826b7b"/><file name="CPCancellation.php" hash="9bf808e265e09d166466313405a167fc"/><file name="CPCustomer.php" hash="62babdf11e9b4d80ae0afbbf96ba329d"/><file name="CPDelivery.php" hash="5d94e7262cdddd8415d668e6e4a18e04"/><file name="CPDiscount.php" hash="5d6f2766869134a86761c12230dc32d1"/><file name="CPManagedArticlePrice.php" hash="65c4c0df04b7c8d20294874de11640d6"/><file name="CPMoney.php" hash="952131eccc8470e107c78e15c94b6495"/><file name="CPOrder.php" hash="32623885f664e9b5871fc48b6ba0c801"/><file name="CPOrderHeader.php" hash="828377182e8197c304f230a783606993"/><file name="CPOrderItem.php" hash="dfe2440a08e3d0f13e638fc4090e6c52"/><file name="CPOrderStatus.php" hash="e0e767388dd9a1ab8be5a990f1ab1259"/><file name="CPOrderSummary.php" hash="fceaa6a79b5fc892062681f518fd0243"/><file name="CPPayment.php" hash="194e0639f634c621cff0719bd0f09620"/><file name="CPResponseHeader.php" hash="53930210d68046183e3be306996ea9b9"/><file name="CPShipping.php" hash="eaddceace28cdc6ba72434a6321d8c47"/></dir><file name="CPResultCodes.php" hash="955180ee33f14b4afa93f6eb1b5df53f"/><file name="ChannelPilotSellerAPI_v1_0.php" hash="ba60c5a18962caeed46480e178114d8c"/></dir></dir><dir name="handler"><file name="CPAbstractHandler.php" hash="ec299185e2a47a86251244130478c4eb"/><file name="CPCancellationHandler.php" hash="b4dd4b167a99c44000173bda98b4f91a"/><file name="CPDebugHandler.php" hash="4e1404f02bddf16683f20e25d3488d31"/><file name="CPDeliveryHandler.php" hash="33edfdb1717ae82b5b45d7bdaf829b70"/><file name="CPErrorHandler.php" hash="5d728c064c068fdf8354fa87882e4dba"/><file name="CPExportHandler.php" hash="acffcb3a0c9ca4dc7284d1b0abdffe48"/><file name="CPNewPriceHandler.php" hash="06e8b36560fec6bbe849fa8759238e54"/><file name="CPNewsHandler.php" hash="2c05c335f9d2396d592dffe90860d7f5"/><file name="CPOrderHandler.php" hash="864acf951fa772d7022f1a075246ecec"/><file name="CPPaymentHandler.php" hash="e1acf2241a22210ad67a4f822e17fcf3"/><file name="CPRegisterHandler.php" hash="928fc47221ad4d11f550d4f696a69686"/><file name="CPStatusHandler.php" hash="9fb5001b993f411841e16a3a051b9675"/></dir><dir name="responses"><file name="CPGetStatusHookResponse.php" hash="672609ebcaa23aa0de85aed04c7662d8"/><file name="CPHookResponse.php" hash="3728a311e8e19572e3974e1d7187fc8f"/><file name="CPRegisterHookResponse.php" hash="206de6433d0795ebdabff98129cc2fb7"/></dir><dir name="special"><file name="CustomerFunctions.php" hash="0d343d3c9c3cb87232c833e0772f730e"/></dir><file name="CPErrors.php" hash="3659c38a1ed3be4aa4ec03d93e68a84e"/><file name="Data.php" hash="b34933c6556d3849ad9b0a8f9bc3b26c"/><file name="Export.php" hash="e153154e3264fc3596e647bb87641fe0"/><file name="ExportData.php" hash="e8a12fe60dac3e35052e94969d95a572"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Source"><file name="Trackingmethod.php" hash="e3870e7f6897f88e6b6ac33dfffeb24a"/></dir></dir><dir name="Carrier"><file name="Cpshipping.php" hash="1595183cc57cda1c4f7abc75cc27933e"/></dir><dir name="Order"><file name="Item.php" hash="758099c29d9ec88b31f9f8d065f0ff18"/><file name="Shipment.php" hash="248010c4dbc7484de1ce3a9d99685e0f"/></dir><dir name="Resource"><dir name="Logs"><file name="Collection.php" hash="b552fa82d554eb8752ec94854c361a66"/></dir><dir name="Order"><dir name="Item"><file name="Collection.php" hash="ef17a696f0c8f49a8460541eb27f2d48"/></dir><dir name="Shipment"><file name="Collection.php" hash="bf5e880e16ad27da504873b07d06d1a5"/></dir><file name="Collection.php" hash="655a3a4dd24548485dbad6df8abfe249"/><file name="Item.php" hash="d9a3333dc0f6bad9afc6f23bca2897ea"/><file name="Shipment.php" hash="b3b33498200c9ddef0a028fcad4bd3cd"/></dir><dir name="Prices"><file name="Collection.php" hash="824ef9dca87c5c2a8a1502465f46b39d"/></dir><dir name="Registration"><file name="Collection.php" hash="ab135100c983dc514e70136f5966779d"/></dir><file name="Logs.php" hash="f01f3cbb33aba58d58cf831d68f84dcc"/><file name="Order.php" hash="6cdce0a2dccfec7410d3616c939fb7bf"/><file name="Prices.php" hash="e5555bd0233bbf7f5b22fc155996966a"/><file name="Registration.php" hash="85f8af50ab8771f82ec20818e29ef5c8"/></dir><file name="Abstract.php" hash="0e9349f1023527a77e59742dfdb21308"/><file name="Logs.php" hash="54604a639a93b1312fb46582ae023741"/><file name="Order.php" hash="b3a41a11b4cc6e8027ff0652721187c2"/><file name="Payment.php" hash="5160ffe0422a9a46dc2bd7a79e512b8b"/><file name="PaymentTypes.php" hash="b217cdabf427beadb8d74acff069af4d"/><file name="Paymenttypes.php" hash="b217cdabf427beadb8d74acff069af4d"/><file name="Prices.php" hash="65b65db0ad2f89e1d62663c26729bb6b"/><file name="Registration.php" hash="ee98f0e95b4a9abd40496518bc127501"/></dir><dir name="controllers"><file name="IndexController.php" hash="3f991e3399f18fc276c9e625313e0f51"/></dir><dir name="etc"><file name="adminhtml.xml" hash="62fad9ef0e77e858b74d2a7bdd6a6879"/><file name="config.xml" hash="5558a2903e995f79ea3934d7b3342218"/><file name="system.xml" hash="1b40ae5290f8cd3f81f9740a8ff98d28"/></dir><dir name="sql"><dir name="channelpilot_setup"><file name="mysql4-install-2.0.0.php" hash="d9f8715479855e4e9a255b61dbad48e7"/><file name="mysql4-upgrade-2.1.6-2.2.0.php" hash="ce14ffa26e1d414c032822797ad10214"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Channelpilotsolutions_Channelpilot.xml" hash="4cc80daa0c7f8dda239e41a6b17321bf"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="Channelpilotsolutions"><file name="channelpilot.xml" hash="ebc6b830d7a7ff2813ce621c2a4719e8"/></dir></dir><dir name="template"><dir name="Channelpilotsolutions"><file name="clicktracking_js.phtml" hash="8ab6a6c98301985878c2c24e3caab7fe"/><file name="salestracking_js.phtml" hash="c786826f6eb3edc8b1484389c4c4ab02"/><file name="tracking_image.phtml" hash="1e5bc29c73df11a3b08d43c77c6f3989"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="channelpilotsolutions"><file name="array_dropdown.phtml" hash="cb1230cd8a92ce0a0961f71b396736ec"/><file name="config_hint.phtml" hash="bab45579386a99fe4ccbfb1972ed08fc"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Channelpilotsolutions_Channelpilot.csv" hash="14e19cf146fdc5fd2d0f0e9b8d66ae0c"/></dir><dir name="de_CH"><file name="Channelpilotsolutions_Channelpilot.csv" hash="14e19cf146fdc5fd2d0f0e9b8d66ae0c"/></dir><dir name="de_AT"><file name="Channelpilotsolutions_Channelpilot.csv" hash="14e19cf146fdc5fd2d0f0e9b8d66ae0c"/></dir><dir name="fr_FR"><file name="Channelpilotsolutions_Channelpilot.csv" hash="23217faa0b1c623750bb91d1e324e082"/></dir><dir name="fr_CA"><file name="Channelpilotsolutions_Channelpilot.csv" hash="23217faa0b1c623750bb91d1e324e082"/></dir><dir name="en_AU"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_CA"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_GB"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_IE"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_NZ"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_US"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="es_AR"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_CL"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_CO"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_CR"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_ES"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_MX"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_PA"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_PE"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_VE"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir></target></contents>
37
  <compatible/>
38
  <dependencies/>
39
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Channelpilotsolutions_Channelpilot</name>
4
+ <version>2.2.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
27
  &lt;/ul&gt;&#xD;
28
  Just get more information about ChannelPilot: &lt;a href="http://www.channelpilot.com"&gt;www.channelpilot.com&lt;/a&gt;</description>
29
  <notes>- general bugfixes&#xD;
30
+ - ebay payment method</notes>
 
 
31
  <authors><author><name>ChannelPilot Solutions GmbH</name><user>auto-converted</user><email>info@channelpilot.com</email></author></authors>
32
+ <date>2015-08-31</date>
33
+ <time>11:21:45</time>
34
+ <contents><target name="magecommunity"><dir name="Channelpilotsolutions"><dir name="Channelpilot"><dir name="Adminhtml"><dir name="Model"><dir name="Articlenumber"><file name="Values.php" hash="4a920f99cf9443aaa2f8841d853cebec"/></dir><dir name="Cookiemode"><file name="Values.php" hash="1ec39f85bb7562c1b6a4614f759d9124"/></dir><dir name="Grossnet"><file name="Values.php" hash="11eaf553b0ec34299524ec6d5a9f1e13"/></dir><dir name="Imagenumber"><file name="Values.php" hash="010dbb2ec946627f338bc500d3d8d747"/></dir><dir name="Orderstatus"><file name="Values.php" hash="ca2eae99b1a05738fcd60ee79f1e5267"/></dir><dir name="Pricefield"><file name="Values.php" hash="6b02dfa3fa93daafa8325d66a986b4ac"/></dir><dir name="Truefalse"><file name="Values.php" hash="e07f105d7d8dc9881690f162cd23472d"/></dir><dir name="Truefalsesecurity"><file name="Values.php" hash="509b5e1cc7cabbe179373bc0ed490499"/></dir></dir></dir><dir name="Block"><dir name="Adminhtml"><dir name="Field"><file name="Abstract.php" hash="a59d8aa3b55a773f94de2593bde9713c"/><file name="Exportfields.php" hash="dc986d5971fa58cddf104a77225bc8f1"/><file name="Replacefields.php" hash="13ebad7efc8c4c88d1d4890806db133d"/><file name="Specialfields.php" hash="760716a50151f930d5be83b2442f1781"/><file name="Trackingkeys.php" hash="e32b2adc09b99df6d9fc12ca2c908e20"/></dir><file name="Hintlogo.php" hash="be78974a79e7cc59601254a8df0dc48b"/></dir><dir name="Tracking"><file name="Tracking.php" hash="8ca7432e620ed0b75219d67e093bfd84"/></dir></dir><dir name="Helper"><dir name="api"><dir name="1_0"><dir name="responses"><file name="GetManagedArticlePricesResponse.php" hash="9ad5adee1952b9408b442449791a1f34"/><file name="GetNewMarketplaceOrdersResponse.php" hash="cd5db953a84759b93a35a360956c4624"/><file name="GetServerTimeResponse.php" hash="07d157639b5bf715aa3f93b0d9e4b736"/><file name="Response.php" hash="c76ce62707a862e1c59346c668055b5d"/><file name="UpdateArticleResult.php" hash="a014c60be447fbb9cf48c947c8e9822f"/><file name="UpdateArticlesResponse.php" hash="338619d50391d91defb5c9d41370022f"/><file name="UpdateOrderResult.php" hash="0fbd88371624270a8cb2c4209a89cfac"/><file name="UpdateOrdersResponse.php" hash="b0ad5828da633b05e654da393b15526a"/></dir><dir name="thin"><file name="CPAddress.php" hash="885fb4517335421fbd8cbc882ae336b1"/><file name="CPArticle.php" hash="1adce1ce33acdd0185dee06010040b18"/><file name="CPArticleUpdate.php" hash="45f514823895c754010f8f11a1ff683a"/><file name="CPAuth.php" hash="cf5fe570dbd98e3e6339b20cec826b7b"/><file name="CPCancellation.php" hash="9bf808e265e09d166466313405a167fc"/><file name="CPCustomer.php" hash="62babdf11e9b4d80ae0afbbf96ba329d"/><file name="CPDelivery.php" hash="5d94e7262cdddd8415d668e6e4a18e04"/><file name="CPDiscount.php" hash="5d6f2766869134a86761c12230dc32d1"/><file name="CPManagedArticlePrice.php" hash="65c4c0df04b7c8d20294874de11640d6"/><file name="CPMoney.php" hash="952131eccc8470e107c78e15c94b6495"/><file name="CPOrder.php" hash="32623885f664e9b5871fc48b6ba0c801"/><file name="CPOrderHeader.php" hash="828377182e8197c304f230a783606993"/><file name="CPOrderItem.php" hash="dfe2440a08e3d0f13e638fc4090e6c52"/><file name="CPOrderStatus.php" hash="e0e767388dd9a1ab8be5a990f1ab1259"/><file name="CPOrderSummary.php" hash="fceaa6a79b5fc892062681f518fd0243"/><file name="CPPayment.php" hash="194e0639f634c621cff0719bd0f09620"/><file name="CPResponseHeader.php" hash="53930210d68046183e3be306996ea9b9"/><file name="CPShipping.php" hash="eaddceace28cdc6ba72434a6321d8c47"/></dir><file name="CPResultCodes.php" hash="955180ee33f14b4afa93f6eb1b5df53f"/><file name="ChannelPilotSellerAPI_v1_0.php" hash="ba60c5a18962caeed46480e178114d8c"/></dir></dir><dir name="handler"><file name="CPAbstractHandler.php" hash="ec299185e2a47a86251244130478c4eb"/><file name="CPCancellationHandler.php" hash="b4dd4b167a99c44000173bda98b4f91a"/><file name="CPDebugHandler.php" hash="4e1404f02bddf16683f20e25d3488d31"/><file name="CPDeliveryHandler.php" hash="33edfdb1717ae82b5b45d7bdaf829b70"/><file name="CPErrorHandler.php" hash="5d728c064c068fdf8354fa87882e4dba"/><file name="CPExportHandler.php" hash="78335f64debfcc87f9cc61920fa033b3"/><file name="CPNewPriceHandler.php" hash="06e8b36560fec6bbe849fa8759238e54"/><file name="CPNewsHandler.php" hash="2c05c335f9d2396d592dffe90860d7f5"/><file name="CPOrderHandler.php" hash="1cec61079aa81ef9aac9074b737d3db3"/><file name="CPPaymentHandler.php" hash="e1acf2241a22210ad67a4f822e17fcf3"/><file name="CPRegisterHandler.php" hash="928fc47221ad4d11f550d4f696a69686"/><file name="CPStatusHandler.php" hash="9fb5001b993f411841e16a3a051b9675"/></dir><dir name="responses"><file name="CPGetStatusHookResponse.php" hash="672609ebcaa23aa0de85aed04c7662d8"/><file name="CPHookResponse.php" hash="3728a311e8e19572e3974e1d7187fc8f"/><file name="CPRegisterHookResponse.php" hash="206de6433d0795ebdabff98129cc2fb7"/></dir><dir name="special"><file name="CustomerFunctions.php" hash="0d343d3c9c3cb87232c833e0772f730e"/></dir><file name="CPErrors.php" hash="3659c38a1ed3be4aa4ec03d93e68a84e"/><file name="Data.php" hash="2712029262ac439ca669a6fbf134584a"/><file name="Export.php" hash="e153154e3264fc3596e647bb87641fe0"/><file name="ExportData.php" hash="e8a12fe60dac3e35052e94969d95a572"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Source"><file name="Trackingmethod.php" hash="e3870e7f6897f88e6b6ac33dfffeb24a"/></dir></dir><dir name="Carrier"><file name="Cpshipping.php" hash="1595183cc57cda1c4f7abc75cc27933e"/></dir><dir name="Order"><file name="Item.php" hash="758099c29d9ec88b31f9f8d065f0ff18"/><file name="Shipment.php" hash="248010c4dbc7484de1ce3a9d99685e0f"/></dir><dir name="Resource"><dir name="Logs"><file name="Collection.php" hash="b552fa82d554eb8752ec94854c361a66"/></dir><dir name="Order"><dir name="Item"><file name="Collection.php" hash="ef17a696f0c8f49a8460541eb27f2d48"/></dir><dir name="Shipment"><file name="Collection.php" hash="bf5e880e16ad27da504873b07d06d1a5"/></dir><file name="Collection.php" hash="655a3a4dd24548485dbad6df8abfe249"/><file name="Item.php" hash="d9a3333dc0f6bad9afc6f23bca2897ea"/><file name="Shipment.php" hash="b3b33498200c9ddef0a028fcad4bd3cd"/></dir><dir name="Prices"><file name="Collection.php" hash="824ef9dca87c5c2a8a1502465f46b39d"/></dir><dir name="Registration"><file name="Collection.php" hash="ab135100c983dc514e70136f5966779d"/></dir><file name="Logs.php" hash="f01f3cbb33aba58d58cf831d68f84dcc"/><file name="Order.php" hash="6cdce0a2dccfec7410d3616c939fb7bf"/><file name="Prices.php" hash="e5555bd0233bbf7f5b22fc155996966a"/><file name="Registration.php" hash="85f8af50ab8771f82ec20818e29ef5c8"/></dir><file name="Abstract.php" hash="0e9349f1023527a77e59742dfdb21308"/><file name="Logs.php" hash="54604a639a93b1312fb46582ae023741"/><file name="Order.php" hash="b3a41a11b4cc6e8027ff0652721187c2"/><file name="Payment.php" hash="49742cfa63c4101b41a3901455180f82"/><file name="PaymentTypes.php" hash="b217cdabf427beadb8d74acff069af4d"/><file name="Paymenttypes.php" hash="b217cdabf427beadb8d74acff069af4d"/><file name="Prices.php" hash="65b65db0ad2f89e1d62663c26729bb6b"/><file name="Registration.php" hash="ee98f0e95b4a9abd40496518bc127501"/></dir><dir name="controllers"><file name="IndexController.php" hash="3f991e3399f18fc276c9e625313e0f51"/></dir><dir name="etc"><file name="adminhtml.xml" hash="62fad9ef0e77e858b74d2a7bdd6a6879"/><file name="config.xml" hash="48b7aeaecca697a9e15ba1f762c91b68"/><file name="system.xml" hash="1b40ae5290f8cd3f81f9740a8ff98d28"/></dir><dir name="sql"><dir name="channelpilot_setup"><file name="mysql4-install-2.0.0.php" hash="d9f8715479855e4e9a255b61dbad48e7"/><file name="mysql4-upgrade-1.0.0-2.0.0.php" hash="4fbbdd3a913e15920fa70d74e9fe57f8"/><file name="mysql4-upgrade-2.1.6-2.2.0.php" hash="ce14ffa26e1d414c032822797ad10214"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Channelpilotsolutions_Channelpilot.xml" hash="4cc80daa0c7f8dda239e41a6b17321bf"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="Channelpilotsolutions"><file name="channelpilot.xml" hash="ebc6b830d7a7ff2813ce621c2a4719e8"/></dir></dir><dir name="template"><dir name="Channelpilotsolutions"><file name="clicktracking_js.phtml" hash="8ab6a6c98301985878c2c24e3caab7fe"/><file name="gtm.phtml" hash="6e7c02091279257bdc5b2137bd5ab6ed"/><file name="salestracking_js.phtml" hash="69f7fdef776194f26e208fa0ed80ce7b"/><file name="tracking_image.phtml" hash="1e5bc29c73df11a3b08d43c77c6f3989"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="channelpilotsolutions"><file name="array_dropdown.phtml" hash="cb1230cd8a92ce0a0961f71b396736ec"/><file name="config_hint.phtml" hash="bab45579386a99fe4ccbfb1972ed08fc"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Channelpilotsolutions_Channelpilot.csv" hash="14e19cf146fdc5fd2d0f0e9b8d66ae0c"/></dir><dir name="de_CH"><file name="Channelpilotsolutions_Channelpilot.csv" hash="14e19cf146fdc5fd2d0f0e9b8d66ae0c"/></dir><dir name="de_AT"><file name="Channelpilotsolutions_Channelpilot.csv" hash="14e19cf146fdc5fd2d0f0e9b8d66ae0c"/></dir><dir name="fr_FR"><file name="Channelpilotsolutions_Channelpilot.csv" hash="23217faa0b1c623750bb91d1e324e082"/></dir><dir name="fr_CA"><file name="Channelpilotsolutions_Channelpilot.csv" hash="23217faa0b1c623750bb91d1e324e082"/></dir><dir name="en_AU"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_CA"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_GB"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_IE"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_NZ"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="en_US"><file name="Channelpilotsolutions_Channelpilot.csv" hash="d0c9795eb2cc5c9c8fd9387bee78126c"/></dir><dir name="es_AR"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_CL"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_CO"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_CR"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_ES"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_MX"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_PA"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_PE"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir><dir name="es_VE"><file name="Channelpilotsolutions_Channelpilot.csv" hash="e457ab4f2c03c46e8ce69bc6eb1dcc25"/></dir></target></contents>
35
  <compatible/>
36
  <dependencies/>
37
  </package>