Lengow_Export - Version 2.0.2

Version Notes

New version of Lengow's Connector

Download this release

Release Info

Developer Ludovic
Extension Lengow_Export
Version 2.0.2
Comparing to
See all releases


Code changes from version 2.0.1.3 to 2.0.2

Files changed (59) hide show
  1. app/code/community/Lengow/{Export/Block/.DS_Store → .DS_Store} +0 -0
  2. app/code/community/Lengow/Dashboard/etc/config.xml +1 -1
  3. app/code/community/Lengow/{Sync → Export}/.DS_Store +0 -0
  4. app/code/community/Lengow/Export/Helper/Data.php +14 -4
  5. app/code/community/Lengow/Export/Helper/Security.php +3 -0
  6. app/code/community/Lengow/Export/Model/.DS_Store +0 -0
  7. app/code/community/Lengow/Export/Model/Catalog/Product.php +32 -9
  8. app/code/community/Lengow/Export/Model/Generate.php +115 -68
  9. app/code/community/Lengow/Export/Model/Observer.php +1 -1
  10. app/code/community/Lengow/Export/Model/Source/.DS_Store +0 -0
  11. app/code/community/Lengow/Export/controllers/.DS_Store +0 -0
  12. app/code/community/Lengow/Export/controllers/Adminhtml/.DS_Store +0 -0
  13. app/code/community/Lengow/Export/controllers/Adminhtml/Lengow/ExportController.php +8 -8
  14. app/code/community/Lengow/Export/controllers/FeedController.php +9 -1
  15. app/code/community/Lengow/Export/etc/config.xml +4 -10
  16. app/code/community/Lengow/Export/etc/system.xml +10 -0
  17. app/code/community/Lengow/Feed/Block/Adminhtml/Feed/Grid.php +27 -5
  18. app/code/community/Lengow/Feed/Model/Feed.php +17 -2
  19. app/code/community/Lengow/Feed/controllers/Adminhtml/Lengow/FeedController.php +35 -22
  20. app/code/community/Lengow/Feed/etc/config.xml +1 -1
  21. app/code/community/Lengow/Sync/Block/.DS_Store +0 -0
  22. app/code/community/Lengow/Sync/Block/Adminhtml/Log/Grid.php +1 -1
  23. app/code/community/Lengow/Sync/Helper/Api.php +17 -0
  24. app/code/community/Lengow/Sync/Model/.DS_Store +0 -0
  25. app/code/community/Lengow/Sync/Model/Config.php +72 -0
  26. app/code/community/Lengow/Sync/Model/Connector.php +1 -0
  27. app/code/community/Lengow/Sync/Model/Customer/Customer.php +12 -4
  28. app/code/community/Lengow/Sync/Model/Import.php +60 -23
  29. app/code/community/Lengow/Sync/Model/Marketplace.php +38 -5
  30. app/code/community/Lengow/Sync/Model/Mysql4/.DS_Store +0 -0
  31. app/code/community/Lengow/Sync/Model/Observer.php +69 -18
  32. app/code/community/Lengow/Sync/Model/Order.php +93 -65
  33. app/code/community/Lengow/Sync/Model/Payment/.DS_Store +0 -0
  34. app/code/community/Lengow/Sync/Model/Payment/Method/Lengow.php +6 -6
  35. app/code/community/Lengow/Sync/controllers/.DS_Store +0 -0
  36. app/code/community/Lengow/Sync/controllers/Adminhtml/.DS_Store +0 -0
  37. app/code/community/Lengow/Sync/controllers/Adminhtml/Lengow/OrderController.php +77 -14
  38. app/code/community/Lengow/Sync/controllers/ApiController.php +7 -18
  39. app/code/community/Lengow/Sync/etc/config.xml +4 -2
  40. app/code/community/Lengow/Sync/etc/marketplaces.xml +267 -15
  41. app/code/community/Lengow/Sync/etc/system.xml +32 -12
  42. app/code/community/Lengow/Sync/sql/lengow_setup/mysql4-install-2.0.0.0.php +6 -3
  43. app/code/community/Lengow/Tracker/Block/.DS_Store +0 -0
  44. app/code/community/Lengow/Tracker/Block/Tag/Capsule.php +18 -4
  45. app/code/community/Lengow/Tracker/Block/Tag/Simple.php +6 -12
  46. app/code/community/Lengow/Tracker/etc/.DS_Store +0 -0
  47. app/code/community/Lengow/Tracker/etc/config.xml +1 -10
  48. app/code/community/Lengow/Tracker/etc/plugins.xml +5 -5
  49. app/code/community/Lengow/Tracker/etc/system.xml +3 -3
  50. app/design/adminhtml/default/default/layout/lengow.xml +1 -0
  51. app/design/adminhtml/default/default/template/lengow/.DS_Store +0 -0
  52. app/design/adminhtml/default/default/template/lengow/export/.DS_Store +0 -0
  53. app/design/adminhtml/default/default/template/lengow/feed/grid.phtml +7 -1
  54. app/design/adminhtml/default/default/template/lengow/sales/.DS_Store +0 -0
  55. app/design/frontend/base/default/layout/lengow.xml +8 -4
  56. app/design/frontend/base/default/template/lengow/tracker/simpletag.phtml +2 -2
  57. package.xml +5 -5
  58. skin/adminhtml/default/default/lengow/js/.DS_Store +0 -0
  59. skin/frontend/base/default/lengow/.DS_Store +0 -0
app/code/community/Lengow/{Export/Block/.DS_Store → .DS_Store} RENAMED
Binary file
app/code/community/Lengow/Dashboard/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Lengow_Dashboard>
5
- <version>2.0.1.3</version>
6
  </Lengow_Dashboard>
7
  </modules>
8
  <admin>
2
  <config>
3
  <modules>
4
  <Lengow_Dashboard>
5
+ <version>2.0.1.5</version>
6
  </Lengow_Dashboard>
7
  </modules>
8
  <admin>
app/code/community/Lengow/{Sync → Export}/.DS_Store RENAMED
Binary file
app/code/community/Lengow/Export/Helper/Data.php CHANGED
@@ -51,9 +51,10 @@ class Lengow_Export_Helper_Data extends Mage_Core_Helper_Abstract {
51
  *
52
  * @param string $value The content
53
  * @param boolean $convert If convert specials chars
 
54
  * @return string $value
55
  */
56
- public function cleanData($value, $convert = false) {
57
  if ($convert)
58
  $value = htmlentities($value);
59
  if(is_array($value))
@@ -69,8 +70,10 @@ class Lengow_Export_Helper_Data extends Mage_Core_Helper_Abstract {
69
  // Reject overly long 3 byte sequences and UTF-16 surrogates and replace with blank
70
  $value = preg_replace('/\xE0[\x80-\x9F][\x80-\xBF]' .
71
  '|\xED[\xA0-\xBF][\x80-\xBF]/S', '', $value);
72
- $pattern = '@<[\/\!]*?[^<>]*?>@si'; //nettoyage du code HTML
73
- $value = preg_replace($pattern, ' ', $value);
 
 
74
  $value = preg_replace('/[\s]+/', ' ', $value); //nettoyage des espaces multiples
75
  $value = trim($value);
76
  $value = str_replace('&nbsp;', ' ', $value);
@@ -89,7 +92,14 @@ class Lengow_Export_Helper_Data extends Mage_Core_Helper_Abstract {
89
  return $value;
90
  }
91
 
92
- function _convert($content) {
 
 
 
 
 
 
 
93
  if (!mb_check_encoding($content, 'UTF-8') OR !($content === mb_convert_encoding(mb_convert_encoding($content, 'UTF-32', 'UTF-8'), 'UTF-8', 'UTF-32'))) {
94
  $content = mb_convert_encoding($content, 'UTF-8');
95
  }
51
  *
52
  * @param string $value The content
53
  * @param boolean $convert If convert specials chars
54
+ * @param boolean $html Keep html
55
  * @return string $value
56
  */
57
+ public function cleanData($value, $convert = false, $html = false) {
58
  if ($convert)
59
  $value = htmlentities($value);
60
  if(is_array($value))
70
  // Reject overly long 3 byte sequences and UTF-16 surrogates and replace with blank
71
  $value = preg_replace('/\xE0[\x80-\x9F][\x80-\xBF]' .
72
  '|\xED[\xA0-\xBF][\x80-\xBF]/S', '', $value);
73
+ if(!$html) {
74
+ $pattern = '@<[\/\!]*?[^<>]*?>@si'; //nettoyage du code HTML
75
+ $value = preg_replace($pattern, ' ', $value);
76
+ }
77
  $value = preg_replace('/[\s]+/', ' ', $value); //nettoyage des espaces multiples
78
  $value = trim($value);
79
  $value = str_replace('&nbsp;', ' ', $value);
92
  return $value;
93
  }
94
 
95
+ public function convertHTML($html) {
96
+ $html = str_replace(array('"', "\r", "\n"),
97
+ array('"""', '', ''),
98
+ trim(nl2br($html)));
99
+ return $html;
100
+ }
101
+
102
+ protected function _convert($content) {
103
  if (!mb_check_encoding($content, 'UTF-8') OR !($content === mb_convert_encoding(mb_convert_encoding($content, 'UTF-32', 'UTF-8'), 'UTF-8', 'UTF-32'))) {
104
  $content = mb_convert_encoding($content, 'UTF-8');
105
  }
app/code/community/Lengow/Export/Helper/Security.php CHANGED
@@ -27,6 +27,9 @@ class Lengow_Export_Helper_Security extends Mage_Core_Helper_Abstract {
27
  '95.131.141.169' ,
28
  '95.131.141.170' ,
29
  '95.131.141.171' ,
 
 
 
30
  );
31
 
32
  /**
27
  '95.131.141.169' ,
28
  '95.131.141.170' ,
29
  '95.131.141.171' ,
30
+ '82.127.207.67' ,
31
+ '80.14.226.127' ,
32
+ '80.236.15.223' ,
33
  );
34
 
35
  /**
app/code/community/Lengow/Export/Model/.DS_Store CHANGED
Binary file
app/code/community/Lengow/Export/Model/Catalog/Product.php CHANGED
@@ -112,11 +112,13 @@ class Lengow_Export_Model_Catalog_Product extends Mage_Catalog_Model_Product {
112
  $productAttribute = $attribute->getProductAttribute();
113
  $productAttributeId = $productAttribute->getId();
114
  $attributeValue = $product_instance->getData($productAttribute->getAttributeCode());
115
- foreach($attribute->getPrices() as $priceChange) {
116
- if (is_array($price) && array_key_exists('value_index', $price) && $price['value_index'] == $attributeValue) {
117
- $configurableOldPrice += (float) ( $priceChange['is_percent'] ? ( ( (float) $priceChange['pricing_value'] ) * $price / 100 ) : $priceChange['pricing_value'] );
118
- $configurablePrice += (float) ( $priceChange['is_percent'] ? ( ( (float) $priceChange['pricing_value'] ) * $finalPrice / 100 ) : $priceChange['pricing_value'] );
119
- }
 
 
120
  }
121
  }
122
  }
@@ -135,6 +137,26 @@ class Lengow_Export_Model_Catalog_Product extends Mage_Catalog_Model_Product {
135
  $product_instance->setTaxPercent(null),
136
  $product_instance->getFinalPrice() + $configurablePrice
137
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  } else {
139
  $price_including_tax = Mage::helper('tax')->getPrice(
140
  $product_instance->setTaxPercent(null),
@@ -145,9 +167,9 @@ class Lengow_Export_Model_Catalog_Product extends Mage_Catalog_Model_Product {
145
  $product_instance->getFinalPrice()
146
  );
147
  }
148
- $discount_amount = $price_including_tax - $final_price_including_tax;
149
- $data['price-ttc'] = round($final_price_including_tax, 2);
150
- $data['price-before-discount'] = round($price_including_tax, 2);
151
  $data['discount-amount'] = $discount_amount > 0 ? round($discount_amount, 2) : '0';
152
  $data['discount-percent'] = $discount_amount > 0 ? round(($discount_amount * 100) / $price_including_tax, 0) : '0';
153
  $data['start-date-discount'] = $product_instance->getSpecialFromDate;
@@ -206,7 +228,8 @@ class Lengow_Export_Model_Catalog_Product extends Mage_Catalog_Model_Product {
206
  }
207
  $i++;
208
  }
209
- $c->clearInstance();
 
210
  }
211
  $data['category-breadcrumb'] = implode(' > ', $ariane);
212
  unset($categories, $category, $ariane);
112
  $productAttribute = $attribute->getProductAttribute();
113
  $productAttributeId = $productAttribute->getId();
114
  $attributeValue = $product_instance->getData($productAttribute->getAttributeCode());
115
+ if(count($attribute->getPrices()) > 0) {
116
+ foreach($attribute->getPrices() as $priceChange) {
117
+ if (is_array($price) && array_key_exists('value_index', $price) && $price['value_index'] == $attributeValue) {
118
+ $configurableOldPrice += (float) ( $priceChange['is_percent'] ? ( ( (float) $priceChange['pricing_value'] ) * $price / 100 ) : $priceChange['pricing_value'] );
119
+ $configurablePrice += (float) ( $priceChange['is_percent'] ? ( ( (float) $priceChange['pricing_value'] ) * $finalPrice / 100 ) : $priceChange['pricing_value'] );
120
+ }
121
+ }
122
  }
123
  }
124
  }
137
  $product_instance->setTaxPercent(null),
138
  $product_instance->getFinalPrice() + $configurablePrice
139
  );
140
+ } else if($product_instance->getTypeId() == 'grouped') {
141
+ $price = 0;
142
+ $final_price = 0;
143
+ $childs = Mage::getModel('catalog/product_type_grouped')->getChildrenIds($product_instance->getId());
144
+ $childs = $childs[Mage_Catalog_Model_Product_Link::LINK_TYPE_GROUPED];
145
+ foreach ($childs as $value) {
146
+ $product = Mage::getModel('export/catalog_product')->load($value);
147
+ $price += $product->getPrice();
148
+ $final_price += $product->getFinalPrice();
149
+ }
150
+ $price_including_tax = Mage::helper('tax')->getPrice(
151
+ $product_instance->setTaxPercent(null),
152
+ $price,
153
+ true
154
+ );
155
+ $final_price_including_tax = Mage::helper('tax')->getPrice(
156
+ $product_instance->setTaxPercent(null),
157
+ $final_price,
158
+ true
159
+ );
160
  } else {
161
  $price_including_tax = Mage::helper('tax')->getPrice(
162
  $product_instance->setTaxPercent(null),
167
  $product_instance->getFinalPrice()
168
  );
169
  }
170
+ $discount_amount = Mage::helper('directory')->currencyConvert($price_including_tax, $this->getOriginalCurrency(), $this->getCurrentCurrencyCode()) - Mage::helper('directory')->currencyConvert($final_price_including_tax, $this->getOriginalCurrency(), $this->getCurrentCurrencyCode());
171
+ $data['price-ttc'] = round(Mage::helper('directory')->currencyConvert($final_price_including_tax, $this->getOriginalCurrency(), $this->getCurrentCurrencyCode()), 2);
172
+ $data['price-before-discount'] = round(Mage::helper('directory')->currencyConvert($price_including_tax, $this->getOriginalCurrency(), $this->getCurrentCurrencyCode()), 2);
173
  $data['discount-amount'] = $discount_amount > 0 ? round($discount_amount, 2) : '0';
174
  $data['discount-percent'] = $discount_amount > 0 ? round(($discount_amount * 100) / $price_including_tax, 0) : '0';
175
  $data['start-date-discount'] = $product_instance->getSpecialFromDate;
228
  }
229
  $i++;
230
  }
231
+ if(method_exists($c, 'clearInstance'))
232
+ $c->clearInstance();
233
  }
234
  $data['category-breadcrumb'] = implode(' > ', $ariane);
235
  unset($categories, $category, $ariane);
app/code/community/Lengow/Export/Model/Generate.php CHANGED
@@ -5,7 +5,7 @@
5
  * @category Lengow
6
  * @package Lengow_Export
7
  * @author Ludovic Drin <ludovic@lengow.com>
8
- * @copyright 2013 Lengow SAS
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Lengow_Export_Model_Generate extends Varien_Object {
@@ -30,9 +30,9 @@ class Lengow_Export_Model_Generate extends Varien_Object {
30
 
31
  protected $_time = null;
32
 
33
- protected $_excludes = array('media_gallery',
34
- 'tier_price',
35
- 'short_description',
36
  'description',
37
  'quantity');
38
  /**
@@ -41,13 +41,13 @@ class Lengow_Export_Model_Generate extends Varien_Object {
41
  public static $DEFAULT_FIELDS = array('sku' => 'sku' ,
42
  'entity_id' => 'product-id' ,
43
  'parent-id' => 'parent-id' ,
44
- 'qty' => 'qty' ,
45
- 'name' => 'name' ,
46
- 'description' => 'description' ,
47
- 'short_description' => 'short_description' ,
48
- 'price-ttc' => 'price-ttc' ,
49
- 'shipping-name' => 'shipping-name' ,
50
- 'image-url-1' => 'image-url-1' ,
51
  'product-url' => 'product-url');
52
 
53
  /**
@@ -75,20 +75,20 @@ class Lengow_Export_Model_Generate extends Varien_Object {
75
  * @param varchar $status Status of product to export
76
  * @param boolean $export_child Export child of product
77
  * @param boolean $out_of_stock Export product out of stock
78
- *
79
  * @return Mage_Catalog_Model_Product
80
  */
81
- public function exec($id_store,
82
- $mode = null,
83
- $format = 'csv',
84
- $types = null,
85
- $status = null,
86
- $export_child = null,
87
- $out_of_stock = null,
88
- $selected_products = null,
89
- $stream = null,
90
- $limit = null,
91
- $offset = null,
92
  $ids_product = null) {
93
  $this->_id_store = $id_store;
94
  $this->_format = $format;
@@ -117,15 +117,23 @@ class Lengow_Export_Model_Generate extends Varien_Object {
117
  echo date('Y-m-d h:i:s') . ' - Find ' . $total_product . ' products<br />';
118
  flush();
119
  }
120
- // Generate data
121
  foreach($products as $p) {
122
  $array_data = array();
123
  $parent = false;
124
  $pi++;
125
  if($total_product < $pi)
126
  $last = true;
127
- $product = $this->_product_model->load($p['entity_id']);
128
- $product_instance = Mage::getModel('catalog/product')->load($p['entity_id']);
 
 
 
 
 
 
 
 
129
 
130
  $data = $product->getData();
131
  // Load first parent if exist
@@ -136,9 +144,13 @@ class Lengow_Export_Model_Generate extends Varien_Object {
136
  $product_type = 'simple';
137
  $variation_name = '';
138
  if($product_instance->getTypeId() == 'configurable') {
139
- $product_type = 'parent';
140
- $variations = $product_instance->getTypeInstance(true)
141
- ->getConfigurableAttributesAsArray($product_instance);
 
 
 
 
142
  if($variations) {
143
  foreach ($variations as $variation) {
144
  $variation_name .= $variation['frontend_label'] . ',';
@@ -149,15 +161,37 @@ class Lengow_Export_Model_Generate extends Varien_Object {
149
  if($product_instance->getTypeId() == 'simple') {
150
  $parents = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($p['entity_id']);
151
  if(!empty($parents)) {
152
- $parent_instance = Mage::getModel('catalog/product')
153
- ->getCollection()
154
- ->addAttributeToFilter('type_id', 'configurable')
155
- ->addAttributeToFilter('entity_id', array('in' => $parents))
156
- ->getFirstItem();
157
- if($parent_instance && $parent_instance->getId()) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  $parent_id = $parent_instance->getId();
159
- $parent = $this->_product_model->load($parent_id);
160
- $parent_instance = Mage::getModel('catalog/product')->load($parent_id);
 
 
 
 
 
 
 
 
161
  $configurable_instance = $parent_instance;
162
  $variations = $parent_instance->getTypeInstance(true)
163
  ->getConfigurableAttributesAsArray($parent_instance);
@@ -180,8 +214,16 @@ class Lengow_Export_Model_Generate extends Varien_Object {
180
  ->getFirstItem();
181
  if($parent_instance && $parent_instance->getId()) {
182
  //$parent_id = $parent_instance->getId();
183
- $parent = $this->_product_model->load($parent_id);
184
- $parent_instance = Mage::getModel('catalog/product')->load($parent_id);
 
 
 
 
 
 
 
 
185
  }
186
  }
187
  $qty = $product_instance->getData('stock_item');
@@ -201,16 +243,16 @@ class Lengow_Export_Model_Generate extends Varien_Object {
201
  $array_data = array_merge($array_data, $product->getImages($data['media_gallery']['images']));
202
  $array_data['name'] = $product_instance->getName();
203
  if($product_instance->getVisibility() == Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE && isset($parent_instance)) {
204
- $array_data['product-url'] = $parent_instance->getUrlInStore() ? $parent_instance->getUrlInStore() : $parent_instance->getProductUrl();
205
  $array_data['name'] = $parent_instance->getName();
206
- $array_data['description'] = $this->_helper->cleanData($parent_instance->getDescription());
207
- $array_data['short_description'] = $this->_helper->cleanData($parent_instance->getShortDescription());
208
  } else {
209
- $array_data['product-url'] = $product_instance->getUrlInStore() ? $product_instance->getUrlInStore() : $product_instance->getProductUrl();
210
- $array_data['description'] = $this->_helper->cleanData($product_instance->getDescription());
211
- $array_data['short_description'] = $this->_helper->cleanData($product_instance->getShortDescription());
212
  }
213
- $array_data['parent_id'] = $parent_id;
214
  // Product variation
215
  $array_data['product_type'] = $product_type;
216
  $array_data['product_variation'] = $variation_name;
@@ -220,8 +262,10 @@ class Lengow_Export_Model_Generate extends Varien_Object {
220
  if(!empty($attributes_to_export)) {
221
  foreach($attributes_to_export as $field => $attr) {
222
  if(!in_array($field, $this->_excludes) && !isset($array_data[$field])) {
223
- if($product_instance->getData($field) === null)
224
  $array_data[$attr] = '';
 
 
225
  else if($this->_config_model->get('performances/formatdata'))
226
  $array_data[$attr] = $this->_helper->cleanData($product_instance->getResource()->getAttribute($field)->getFrontend()->getValue($product_instance), true);
227
  else
@@ -242,19 +286,21 @@ class Lengow_Export_Model_Generate extends Varien_Object {
242
  $this->_write($feed->makeHeader());
243
  $first = false;
244
  }
245
- $this->_write($feed->makeData($array_data, array('last' => $last)));
246
  if(!$this->_stream) {
247
- if($pi % 20 == 0)
248
  echo date('Y-m-d h:i:s') .' - Export ' . $pi . ' products<br />';
249
  flush();
250
  }
251
  // Fix Sébastien Ledan
252
- $product->clearInstance();
253
- $product_instance->clearInstance();
254
- if($parent != null)
255
- $parent->clearInstance();
256
- if($parent_instance != null)
257
- $parent_instance->clearInstance();
 
 
258
  unset($array_data);
259
  }
260
  $this->_write($feed->makeFooter());
@@ -267,12 +313,12 @@ class Lengow_Export_Model_Generate extends Varien_Object {
267
  }
268
  }
269
 
270
- protected function _getProductsCollection($types = null,
271
- $status = null,
272
- $export_child = null,
273
- $out_of_stock = null,
274
- $selected_products = null,
275
- $limit = null,
276
  $offset = null,
277
  $ids_product = null) {
278
  // Filter types
@@ -289,7 +335,8 @@ class Lengow_Export_Model_Generate extends Varien_Object {
289
  ->getCollection()
290
  ->addAttributeToSelect('sku')
291
  ->addStoreFilter($this->_id_store)
292
- ->addAttributeToFilter('type_id', array('in' => $_types));
 
293
  // Filter status
294
  if(is_null($status))
295
  $status = $this->_config_model->get('global/productstatus');
@@ -298,7 +345,7 @@ class Lengow_Export_Model_Generate extends Varien_Object {
298
  else if($status == Mage_Catalog_Model_Product_Status::STATUS_DISABLED)
299
  $products->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_DISABLED));
300
  // Export only selected products
301
- if($selected_products) {
302
  $products->addAttributeToFilter('lengow_product', 1);
303
  }
304
  // Filter out of stock
@@ -310,7 +357,7 @@ class Lengow_Export_Model_Generate extends Varien_Object {
310
  $ids_product = explode(',', $ids_product);
311
  $products->addAttributeToFilter('entity_id', array('in' => $ids_product));
312
  }
313
- // Limit & Offset
314
  if($limit) {
315
  if($offset)
316
  $products->getSelect()->limit($limit, $offset);
@@ -338,7 +385,7 @@ class Lengow_Export_Model_Generate extends Varien_Object {
338
  return $sql;
339
  }
340
  }
341
-
342
  /**
343
  * Return attributes to export
344
  */
@@ -359,16 +406,16 @@ class Lengow_Export_Model_Generate extends Varien_Object {
359
  foreach ($attributes as $key=>$code) {
360
  $attribute = $product->getResource()->getAttribute($code);
361
  if($attribute instanceof Mage_Catalog_Model_Resource_Eav_Attribute && $attribute->getId() && $attribute->getFrontendInput() != 'weee') {
362
- $attributes[$key] = $code;
363
  }
364
  }
365
- }
366
  return $attributes;
367
  }
368
 
369
  /**
370
  * File generation
371
- */
372
 
373
  protected function _write($data) {
374
  if($this->_stream == false) {
5
  * @category Lengow
6
  * @package Lengow_Export
7
  * @author Ludovic Drin <ludovic@lengow.com>
8
+ * @copyright 2013 Lengow SAS
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Lengow_Export_Model_Generate extends Varien_Object {
30
 
31
  protected $_time = null;
32
 
33
+ protected $_excludes = array('media_gallery',
34
+ 'tier_price',
35
+ 'short_description',
36
  'description',
37
  'quantity');
38
  /**
41
  public static $DEFAULT_FIELDS = array('sku' => 'sku' ,
42
  'entity_id' => 'product-id' ,
43
  'parent-id' => 'parent-id' ,
44
+ 'qty' => 'qty' ,
45
+ 'name' => 'name' ,
46
+ 'description' => 'description' ,
47
+ 'short_description' => 'short_description' ,
48
+ 'price-ttc' => 'price-ttc' ,
49
+ 'shipping-name' => 'shipping-name' ,
50
+ 'image-url-1' => 'image-url-1' ,
51
  'product-url' => 'product-url');
52
 
53
  /**
75
  * @param varchar $status Status of product to export
76
  * @param boolean $export_child Export child of product
77
  * @param boolean $out_of_stock Export product out of stock
78
+ *
79
  * @return Mage_Catalog_Model_Product
80
  */
81
+ public function exec($id_store,
82
+ $mode = null,
83
+ $format = 'csv',
84
+ $types = null,
85
+ $status = null,
86
+ $export_child = null,
87
+ $out_of_stock = null,
88
+ $selected_products = null,
89
+ $stream = null,
90
+ $limit = null,
91
+ $offset = null,
92
  $ids_product = null) {
93
  $this->_id_store = $id_store;
94
  $this->_format = $format;
117
  echo date('Y-m-d h:i:s') . ' - Find ' . $total_product . ' products<br />';
118
  flush();
119
  }
120
+ // Generate data
121
  foreach($products as $p) {
122
  $array_data = array();
123
  $parent = false;
124
  $pi++;
125
  if($total_product < $pi)
126
  $last = true;
127
+ $product = $this->_product_model
128
+ ->setStoreId($this->_id_store)
129
+ ->setOriginalCurrency($this->getOriginalCurrency())
130
+ ->setCurrentCurrencyCode($this->getCurrentCurrencyCode())
131
+ ->load($p['entity_id']);
132
+ $product_instance = Mage::getModel('catalog/product')
133
+ ->setOriginalCurrency($this->getOriginalCurrency())
134
+ ->setCurrentCurrencyCode($this->getCurrentCurrencyCode())
135
+ ->setStoreId($this->_id_store)
136
+ ->load($p['entity_id']);
137
 
138
  $data = $product->getData();
139
  // Load first parent if exist
144
  $product_type = 'simple';
145
  $variation_name = '';
146
  if($product_instance->getTypeId() == 'configurable') {
147
+ $product_type = 'parent';
148
+ $variations = $product_instance
149
+ ->setOriginalCurrency($this->getOriginalCurrency())
150
+ ->setCurrentCurrencyCode($this->getCurrentCurrencyCode())
151
+ ->setStoreId($this->_id_store)
152
+ ->getTypeInstance(true)
153
+ ->getConfigurableAttributesAsArray($product_instance);
154
  if($variations) {
155
  foreach ($variations as $variation) {
156
  $variation_name .= $variation['frontend_label'] . ',';
161
  if($product_instance->getTypeId() == 'simple') {
162
  $parents = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($p['entity_id']);
163
  if(!empty($parents)) {
164
+ $parent_instance = Mage::getModel('catalog/product')->load($parents[0]);
165
+ // Exclude if parent is disabled
166
+ if(($parent_instance && $parent_instance->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) || $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
167
+ if(!$this->_stream) {
168
+ if($pi % 20 == 0)
169
+ echo date('Y-m-d h:i:s') .' - Export ' . $pi . ' products<br />';
170
+ flush();
171
+ }
172
+ if(method_exists($product, 'clearInstance')) {
173
+ $product->clearInstance();
174
+ if($parent != null)
175
+ $parent->clearInstance();
176
+ if($parent_instance != null)
177
+ $parent_instance->clearInstance();
178
+ }
179
+
180
+ unset($array_data);
181
+ continue;
182
+ }
183
+ if($parent_instance && $parent_instance->getId() && $parent_instance->getTypeId() == 'configurable') {
184
  $parent_id = $parent_instance->getId();
185
+ $parent = $this->_product_model
186
+ ->setOriginalCurrency($this->getOriginalCurrency())
187
+ ->setCurrentCurrencyCode($this->getCurrentCurrencyCode())
188
+ ->setStoreId($this->_id_store)
189
+ ->load($parent_id);
190
+ $parent_instance = Mage::getModel('catalog/product')
191
+ ->setOriginalCurrency($this->getOriginalCurrency())
192
+ ->setCurrentCurrencyCode($this->getCurrentCurrencyCode())
193
+ ->setStoreId($this->_id_store)
194
+ ->load($parent_id);
195
  $configurable_instance = $parent_instance;
196
  $variations = $parent_instance->getTypeInstance(true)
197
  ->getConfigurableAttributesAsArray($parent_instance);
214
  ->getFirstItem();
215
  if($parent_instance && $parent_instance->getId()) {
216
  //$parent_id = $parent_instance->getId();
217
+ $parent = $this->_product_model
218
+ ->setOriginalCurrency($this->getOriginalCurrency())
219
+ ->setCurrentCurrencyCode($this->getCurrentCurrencyCode())
220
+ ->setStoreId($this->_id_store)
221
+ ->load($parent_id);
222
+ $parent_instance = Mage::getModel('catalog/product')
223
+ ->setOriginalCurrency($this->getOriginalCurrency())
224
+ ->setCurrentCurrencyCode($this->getCurrentCurrencyCode())
225
+ ->setStoreId($this->_id_store)
226
+ ->load($parent_id);
227
  }
228
  }
229
  $qty = $product_instance->getData('stock_item');
243
  $array_data = array_merge($array_data, $product->getImages($data['media_gallery']['images']));
244
  $array_data['name'] = $product_instance->getName();
245
  if($product_instance->getVisibility() == Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE && isset($parent_instance)) {
246
+ $array_data['product-url'] = $parent_instance->getUrlInStore() ? $parent_instance->getUrlInStore() : $parent_instance->getProductUrl();
247
  $array_data['name'] = $parent_instance->getName();
248
+ $array_data['description'] = $this->_helper->cleanData($parent_instance->getDescription(), false, $this->_config_model->get('data/keephtml'));
249
+ $array_data['short_description'] = $this->_helper->cleanData($parent_instance->getShortDescription(), false, $this->_config_model->get('data/keephtml'));
250
  } else {
251
+ $array_data['product-url'] = $product_instance->getUrlInStore() ? $product_instance->getUrlInStore() : $product_instance->getProductUrl();
252
+ $array_data['description'] = $this->_helper->cleanData($product_instance->getDescription(), false, $this->_config_model->get('data/keephtml'));
253
+ $array_data['short_description'] = $this->_helper->cleanData($product_instance->getShortDescription(), false, $this->_config_model->get('data/keephtml'));
254
  }
255
+ $array_data['parent_id'] = $parent_id;
256
  // Product variation
257
  $array_data['product_type'] = $product_type;
258
  $array_data['product_variation'] = $variation_name;
262
  if(!empty($attributes_to_export)) {
263
  foreach($attributes_to_export as $field => $attr) {
264
  if(!in_array($field, $this->_excludes) && !isset($array_data[$field])) {
265
+ if($product_instance->getData($field) === null)
266
  $array_data[$attr] = '';
267
+ else if(is_array($product_instance->getData($field)))
268
+ $array_data[$attr] = implode(',', $product_instance->getData($field));
269
  else if($this->_config_model->get('performances/formatdata'))
270
  $array_data[$attr] = $this->_helper->cleanData($product_instance->getResource()->getAttribute($field)->getFrontend()->getValue($product_instance), true);
271
  else
286
  $this->_write($feed->makeHeader());
287
  $first = false;
288
  }
289
+ $this->_write($feed->makeData($array_data, array('last' => $last)));
290
  if(!$this->_stream) {
291
+ if($pi % 20 == 0)
292
  echo date('Y-m-d h:i:s') .' - Export ' . $pi . ' products<br />';
293
  flush();
294
  }
295
  // Fix Sébastien Ledan
296
+ if(method_exists($product, 'clearInstance')) {
297
+ $product->clearInstance();
298
+ $product_instance->clearInstance();
299
+ if($parent != null)
300
+ $parent->clearInstance();
301
+ if($parent_instance != null)
302
+ $parent_instance->clearInstance();
303
+ }
304
  unset($array_data);
305
  }
306
  $this->_write($feed->makeFooter());
313
  }
314
  }
315
 
316
+ protected function _getProductsCollection($types = null,
317
+ $status = null,
318
+ $export_child = null,
319
+ $out_of_stock = null,
320
+ $selected_products = null,
321
+ $limit = null,
322
  $offset = null,
323
  $ids_product = null) {
324
  // Filter types
335
  ->getCollection()
336
  ->addAttributeToSelect('sku')
337
  ->addStoreFilter($this->_id_store)
338
+ ->addAttributeToFilter('type_id', array('in' => $_types))
339
+ ->joinField('store_id', Mage::getConfig()->getTablePrefix() . 'catalog_category_product_index', 'store_id', 'product_id=entity_id', '{{table}}.store_id = '.$this->_id_store, 'left');
340
  // Filter status
341
  if(is_null($status))
342
  $status = $this->_config_model->get('global/productstatus');
345
  else if($status == Mage_Catalog_Model_Product_Status::STATUS_DISABLED)
346
  $products->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_DISABLED));
347
  // Export only selected products
348
+ if($selected_products) {
349
  $products->addAttributeToFilter('lengow_product', 1);
350
  }
351
  // Filter out of stock
357
  $ids_product = explode(',', $ids_product);
358
  $products->addAttributeToFilter('entity_id', array('in' => $ids_product));
359
  }
360
+ // Limit & Offset
361
  if($limit) {
362
  if($offset)
363
  $products->getSelect()->limit($limit, $offset);
385
  return $sql;
386
  }
387
  }
388
+
389
  /**
390
  * Return attributes to export
391
  */
406
  foreach ($attributes as $key=>$code) {
407
  $attribute = $product->getResource()->getAttribute($code);
408
  if($attribute instanceof Mage_Catalog_Model_Resource_Eav_Attribute && $attribute->getId() && $attribute->getFrontendInput() != 'weee') {
409
+ $attributes[$key] = $code;
410
  }
411
  }
412
+ }
413
  return $attributes;
414
  }
415
 
416
  /**
417
  * File generation
418
+ */
419
 
420
  protected function _write($data) {
421
  if($this->_stream == false) {
app/code/community/Lengow/Export/Model/Observer.php CHANGED
@@ -17,7 +17,7 @@ class Lengow_Export_Model_Observer {
17
  foreach($store_collection as $store) {
18
  try {
19
  if(Mage::getStoreConfig('export/performances/active_cron', $store)) {
20
- $generate = Mage::getSingleton('export/generate');
21
  $format =Mage::getStoreConfig('export/data/format', $store);
22
  $generate->exec($store->getId(), null, $format, null, null, null, null, null, false, false);
23
  }
17
  foreach($store_collection as $store) {
18
  try {
19
  if(Mage::getStoreConfig('export/performances/active_cron', $store)) {
20
+ $generate = Mage::getModel('export/generate');
21
  $format =Mage::getStoreConfig('export/data/format', $store);
22
  $generate->exec($store->getId(), null, $format, null, null, null, null, null, false, false);
23
  }
app/code/community/Lengow/Export/Model/Source/.DS_Store DELETED
Binary file
app/code/community/Lengow/Export/controllers/.DS_Store DELETED
Binary file
app/code/community/Lengow/Export/controllers/Adminhtml/.DS_Store DELETED
Binary file
app/code/community/Lengow/Export/controllers/Adminhtml/Lengow/ExportController.php CHANGED
@@ -5,17 +5,17 @@
5
  * @category Lengow
6
  * @package Lengow_Export
7
  * @author Ludovic Drin <ludovic@lengow.com>
8
- * @copyright 2013 Lengow SAS
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Lengow_Export_Adminhtml_Lengow_ExportController extends Mage_Adminhtml_Controller_Action {
12
-
13
  public function indexAction() {
14
  $this->loadLayout();
15
- $this->renderLayout();
16
  return $this;
17
  }
18
-
19
  /**
20
  * Product grid for AJAX request
21
  */
@@ -25,7 +25,7 @@ class Lengow_Export_Adminhtml_Lengow_ExportController extends Mage_Adminhtml_Con
25
  $this->getLayout()->createBlock('export/adminhtml_product_grid')->toHtml()
26
  );
27
  }
28
-
29
  public function massPublishAction() {
30
  $_product_ids = (array) $this->getRequest()->getParam('product');
31
  $_store_id = (int)$this->getRequest()->getParam('store', 0);
@@ -40,7 +40,7 @@ class Lengow_Export_Adminhtml_Lengow_ExportController extends Mage_Adminhtml_Con
40
  'store_id' => $_store_id,
41
  'lengow_product' => $_publish));
42
  $resource->saveAttribute($product,'lengow_product');
43
-
44
  }
45
  $this->_getSession()->addSuccess(
46
  Mage::helper('export')->__('Total of %d record(s) were successfully updated', count($_product_ids))
@@ -55,10 +55,10 @@ class Lengow_Export_Adminhtml_Lengow_ExportController extends Mage_Adminhtml_Con
55
 
56
  $this->_redirect('*/*/', array('store'=> $_store_id));
57
  }
58
-
59
 
60
  protected function _getSession() {
61
  return Mage::getSingleton('adminhtml/session');
62
  }
63
-
64
  }
5
  * @category Lengow
6
  * @package Lengow_Export
7
  * @author Ludovic Drin <ludovic@lengow.com>
8
+ * @copyright 2013 Lengow SAS
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Lengow_Export_Adminhtml_Lengow_ExportController extends Mage_Adminhtml_Controller_Action {
12
+
13
  public function indexAction() {
14
  $this->loadLayout();
15
+ $this->renderLayout();
16
  return $this;
17
  }
18
+
19
  /**
20
  * Product grid for AJAX request
21
  */
25
  $this->getLayout()->createBlock('export/adminhtml_product_grid')->toHtml()
26
  );
27
  }
28
+
29
  public function massPublishAction() {
30
  $_product_ids = (array) $this->getRequest()->getParam('product');
31
  $_store_id = (int)$this->getRequest()->getParam('store', 0);
40
  'store_id' => $_store_id,
41
  'lengow_product' => $_publish));
42
  $resource->saveAttribute($product,'lengow_product');
43
+
44
  }
45
  $this->_getSession()->addSuccess(
46
  Mage::helper('export')->__('Total of %d record(s) were successfully updated', count($_product_ids))
55
 
56
  $this->_redirect('*/*/', array('store'=> $_store_id));
57
  }
58
+
59
 
60
  protected function _getSession() {
61
  return Mage::getSingleton('adminhtml/session');
62
  }
63
+
64
  }
app/code/community/Lengow/Export/controllers/FeedController.php CHANGED
@@ -25,8 +25,13 @@ class Lengow_Export_FeedController extends Mage_Core_Controller_Front_Action {
25
  }
26
  $generate = Mage::getSingleton('export/generate');
27
  $generate->setCurrentStore(Mage::app()->getStore()->getId());
 
 
 
 
 
28
  $id_store = (integer) $this->getRequest()->getParam('store', Mage::app()->getStore()->getId());
29
- Mage::app()->setCurrentStore($id_store);
30
  $format = (string) $this->getRequest()->getParam('format', 'csv');
31
  $types = $this->getRequest()->getParam('product_type', null);
32
  $export_child = $this->getRequest()->getParam('export_child', null);
@@ -45,6 +50,9 @@ class Lengow_Export_FeedController extends Mage_Core_Controller_Front_Action {
45
  // translation now works
46
  Mage::app()->getTranslator()->init('frontend', true);
47
  }
 
 
 
48
  $generate->exec($id_store, $mode, $format, $types, $status, $export_child, $out_of_stock, $selected_products, $stream, $limit, $offset, $ids_product);
49
  } else {
50
  echo Mage::helper('export')->__('Unauthorised IP : %s', $_SERVER['REMOTE_ADDR']);
25
  }
26
  $generate = Mage::getSingleton('export/generate');
27
  $generate->setCurrentStore(Mage::app()->getStore()->getId());
28
+ $_default_store = Mage::getModel('core/store')->load(Mage::app()
29
+ ->getWebsite(true)
30
+ ->getDefaultGroup()
31
+ ->getDefaultStoreId());
32
+ $generate->setOriginalCurrency($_default_store->getCurrentCurrencyCode());
33
  $id_store = (integer) $this->getRequest()->getParam('store', Mage::app()->getStore()->getId());
34
+ Mage::app()->getStore()->setCurrentStore($id_store);
35
  $format = (string) $this->getRequest()->getParam('format', 'csv');
36
  $types = $this->getRequest()->getParam('product_type', null);
37
  $export_child = $this->getRequest()->getParam('export_child', null);
50
  // translation now works
51
  Mage::app()->getTranslator()->init('frontend', true);
52
  }
53
+ if($currency = $this->getRequest()->getParam('currency', null)) {
54
+ $generate->setCurrentCurrencyCode($currency);
55
+ }
56
  $generate->exec($id_store, $mode, $format, $types, $status, $export_child, $out_of_stock, $selected_products, $stream, $limit, $offset, $ids_product);
57
  } else {
58
  echo Mage::helper('export')->__('Unauthorised IP : %s', $_SERVER['REMOTE_ADDR']);
app/code/community/Lengow/Export/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Lengow_Export>
5
- <version>2.0.1.3</version>
6
  </Lengow_Export>
7
  </modules>
8
  <admin>
@@ -77,7 +77,7 @@
77
  </catalog_product_new_action>
78
  </events>
79
  </global>
80
- <!--<frontend>
81
  <routers>
82
  <lengow>
83
  <use>standard</use>
@@ -87,14 +87,7 @@
87
  </args>
88
  </lengow>
89
  </routers>
90
- <layout>
91
- <updates>
92
- <export>
93
- <file>lengow.xml</file>
94
- </export>
95
- </updates>
96
- </layout>
97
- </frontend>-->
98
  <adminhtml>
99
  <translate>
100
  <modules>
@@ -174,6 +167,7 @@
174
  <formatdata>0</formatdata>
175
  <levelcategory>5</levelcategory>
176
  <count_images>5</count_images>
 
177
  </data>
178
  <performances>
179
  <usesavefile>0</usesavefile>
2
  <config>
3
  <modules>
4
  <Lengow_Export>
5
+ <version>2.0.1.5</version>
6
  </Lengow_Export>
7
  </modules>
8
  <admin>
77
  </catalog_product_new_action>
78
  </events>
79
  </global>
80
+ <frontend>
81
  <routers>
82
  <lengow>
83
  <use>standard</use>
87
  </args>
88
  </lengow>
89
  </routers>
90
+ </frontend>
 
 
 
 
 
 
 
91
  <adminhtml>
92
  <translate>
93
  <modules>
167
  <formatdata>0</formatdata>
168
  <levelcategory>5</levelcategory>
169
  <count_images>5</count_images>
170
+ <keephtml>0</keephtml>
171
  </data>
172
  <performances>
173
  <usesavefile>0</usesavefile>
app/code/community/Lengow/Export/etc/system.xml CHANGED
@@ -132,6 +132,16 @@
132
  <show_in_store>1</show_in_store>
133
  <source_model>adminhtml/system_config_source_yesno</source_model>
134
  </formatdata>
 
 
 
 
 
 
 
 
 
 
135
  <shipping_price_based_on>
136
  <label>Country shipping</label>
137
  <comment>Default country for shipping cost</comment>
132
  <show_in_store>1</show_in_store>
133
  <source_model>adminhtml/system_config_source_yesno</source_model>
134
  </formatdata>
135
+ <keephtml>
136
+ <label>Keep html</label>
137
+ <comment><![CDATA[Keep html chars in descrption]]></comment>
138
+ <frontend_type>select</frontend_type>
139
+ <sort_order>20</sort_order>
140
+ <show_in_default>1</show_in_default>
141
+ <show_in_website>1</show_in_website>
142
+ <show_in_store>1</show_in_store>
143
+ <source_model>adminhtml/system_config_source_yesno</source_model>
144
+ </keephtml>
145
  <shipping_price_based_on>
146
  <label>Country shipping</label>
147
  <comment>Default country for shipping cost</comment>
app/code/community/Lengow/Feed/Block/Adminhtml/Feed/Grid.php CHANGED
@@ -27,9 +27,25 @@ class Lengow_Feed_Block_Adminhtml_Feed_Grid extends Mage_Adminhtml_Block_Widget_
27
 
28
  // Set datas
29
  $this->setData('id_client', $this->_config_model->get('tracker/general/login'));
30
- $this->setData('id_group', $this->_config_model->get('tracker/general/group'));
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  $this->setData('api_key', $this->_config_model->get('tracker/general/api_key'));
32
- $this->setData('form_url', $this->getUrl('*/*/migrate', array('' => '')));
 
 
 
33
  $this->setData('json_feed', $this->_config_model->get('feed/general/json_feed'));
34
 
35
  }
@@ -38,6 +54,7 @@ class Lengow_Feed_Block_Adminhtml_Feed_Grid extends Mage_Adminhtml_Block_Widget_
38
  $storeId = (int) $this->getRequest()->getParam('store', 0);
39
  return Mage::app()->getStore($storeId);
40
  }
 
41
 
42
  protected function _prepareCollection() {
43
  $connector = Mage::helper('feed/data')->getConnector($this->getData('id_client'), $this->getData('api_key'));
@@ -64,7 +81,7 @@ class Lengow_Feed_Block_Adminhtml_Feed_Grid extends Mage_Adminhtml_Block_Widget_
64
  $obj_feed->setData('product_out_stock', $data_feeds->{$key}->product_out_stock);
65
  $obj_feed->setData('product_type', $data_feeds->{$key}->product_type);
66
  $obj_feed->setData('product_status', $data_feeds->{$key}->product_status);
67
- $obj_feed->setData('product_child', $data_feeds->{$key}->product_child);
68
  $obj_feed->setData('format', $data_feeds->{$key}->format);
69
  } else {
70
  // Apply default parameters
@@ -107,7 +124,7 @@ class Lengow_Feed_Block_Adminhtml_Feed_Grid extends Mage_Adminhtml_Block_Widget_
107
  'sortable' => false,
108
  ));
109
  $this->addColumn('url', array(
110
- 'header' => Mage::helper('feed')->__('Flux actuel'),
111
  'index' => 'url',
112
  'width' => '100px',
113
  'filter' => false,
@@ -170,7 +187,7 @@ class Lengow_Feed_Block_Adminhtml_Feed_Grid extends Mage_Adminhtml_Block_Widget_
170
  'renderer' => 'feed/adminhtml_feed_renderer_select',
171
  ));*/
172
  $this->addColumn('format', array(
173
- 'header' => Mage::helper('feed')->__('Export format'),
174
  'index' => 'format',
175
  'width' => '50px',
176
  'options' => Mage::getModel('export/system_config_source_format')->toSelectArray(),
@@ -200,5 +217,10 @@ class Lengow_Feed_Block_Adminhtml_Feed_Grid extends Mage_Adminhtml_Block_Widget_
200
 
201
  public function getRowUrl($row) {
202
  return '';
 
 
 
 
 
203
  }
204
  }
27
 
28
  // Set datas
29
  $this->setData('id_client', $this->_config_model->get('tracker/general/login'));
30
+ $_lengow_ids_group = array();
31
+ $_store_id = $this->getRequest()->getParam('store');
32
+ /*if(!$_store_id) {
33
+ $store_collection = Mage::getResourceModel('core/store_collection')
34
+ ->addFieldToFilter('is_active', 1);
35
+ foreach($store_collection as $store) {
36
+ if(Mage::getModel('sync/config')->setStore($store->getId())->getConfig('tracker/general/group'))
37
+ $_lengow_ids_group = array_merge($this->_getGroups(Mage::getModel('sync/config')->setStore($store->getId())->getConfig('tracker/general/group')), $_lengow_ids_group);
38
+ }
39
+ $_group = implode(',', $_lengow_ids_group);
40
+ } else {*/
41
+ $_group = Mage::getModel('sync/config')->setStore($_store_id)->getConfig('tracker/general/group');
42
+ //}
43
+ $this->setData('id_group', $_group);
44
  $this->setData('api_key', $this->_config_model->get('tracker/general/api_key'));
45
+ $args = array();
46
+ if(!empty($_store_id))
47
+ $args['store'] = $_store_id;
48
+ $this->setData('form_url', $this->getUrl('*/*/migrate', $args));
49
  $this->setData('json_feed', $this->_config_model->get('feed/general/json_feed'));
50
 
51
  }
54
  $storeId = (int) $this->getRequest()->getParam('store', 0);
55
  return Mage::app()->getStore($storeId);
56
  }
57
+
58
 
59
  protected function _prepareCollection() {
60
  $connector = Mage::helper('feed/data')->getConnector($this->getData('id_client'), $this->getData('api_key'));
81
  $obj_feed->setData('product_out_stock', $data_feeds->{$key}->product_out_stock);
82
  $obj_feed->setData('product_type', $data_feeds->{$key}->product_type);
83
  $obj_feed->setData('product_status', $data_feeds->{$key}->product_status);
84
+ $obj_feed->setData('product_child', (!empty($data_feeds->{$key}->product_child) ? $data_feeds->{$key}->product_child : ''));
85
  $obj_feed->setData('format', $data_feeds->{$key}->format);
86
  } else {
87
  // Apply default parameters
124
  'sortable' => false,
125
  ));
126
  $this->addColumn('url', array(
127
+ 'header' => Mage::helper('feed')->__('Current Feed'),
128
  'index' => 'url',
129
  'width' => '100px',
130
  'filter' => false,
187
  'renderer' => 'feed/adminhtml_feed_renderer_select',
188
  ));*/
189
  $this->addColumn('format', array(
190
+ 'header' => Mage::helper('feed')->__('Format export'),
191
  'index' => 'format',
192
  'width' => '50px',
193
  'options' => Mage::getModel('export/system_config_source_format')->toSelectArray(),
217
 
218
  public function getRowUrl($row) {
219
  return '';
220
+ }
221
+
222
+ private function _getGroups($data) {
223
+ $_groups = trim(str_replace(array("\r\n", ';', '-', '|', ' '), ';', $data), ',');
224
+ return explode(',', $_groups);
225
  }
226
  }
app/code/community/Lengow/Feed/Model/Feed.php CHANGED
@@ -55,6 +55,12 @@ class Lengow_Feed_Model_Feed extends Varien_Object {
55
  */
56
  protected $_url;
57
 
 
 
 
 
 
 
58
  protected $_idClient;
59
  protected $_idGroup;
60
  protected $_api_key;
@@ -82,7 +88,9 @@ class Lengow_Feed_Model_Feed extends Varien_Object {
82
  $this->_config_model = Mage::getSingleton('feed/config');
83
 
84
  $this->_idClient = $this->_config_model->get('tracker/general/login');
85
- $this->_idGroup = $this->_config_model->get('tracker/general/group');
 
 
86
  $this->_api_key = $this->_config_model->get('tracker/general/api_key');
87
  parent::__construct();
88
  }
@@ -97,7 +105,8 @@ class Lengow_Feed_Model_Feed extends Varien_Object {
97
  $params .= '/product_status/' . $this->_product_status;
98
  //$params .= '/product_child/' . $this->_product_child;
99
  $params .= '/format/' . $this->_format;
100
- $params .= '/store/' . Mage::app()->getStore()->getId();
 
101
 
102
  $new_flow = Mage::getUrl('lengow/feed/index') . $params;
103
  $this->_url = $new_flow;
@@ -115,7 +124,13 @@ class Lengow_Feed_Model_Feed extends Varien_Object {
115
  'urlFlux' => $this->_url,
116
  'idFlux' => $this->_id
117
  );
 
 
118
  return $connector->api('updateRootFeed', $args);
119
  }
120
 
 
 
 
 
121
  }
55
  */
56
  protected $_url;
57
 
58
+ /**
59
+ *
60
+ * @var integer ID store
61
+ */
62
+ protected $_id_store;
63
+
64
  protected $_idClient;
65
  protected $_idGroup;
66
  protected $_api_key;
88
  $this->_config_model = Mage::getSingleton('feed/config');
89
 
90
  $this->_idClient = $this->_config_model->get('tracker/general/login');
91
+ $this->_idGroup = $args['group_id'];
92
+ $this->_id_store = $args['store_id'];
93
+ //$this->_config_model->get('tracker/general/group');
94
  $this->_api_key = $this->_config_model->get('tracker/general/api_key');
95
  parent::__construct();
96
  }
105
  $params .= '/product_status/' . $this->_product_status;
106
  //$params .= '/product_child/' . $this->_product_child;
107
  $params .= '/format/' . $this->_format;
108
+ if($this->_id_store != 0)
109
+ $params .= '/store/' . $this->_id_store;
110
 
111
  $new_flow = Mage::getUrl('lengow/feed/index') . $params;
112
  $this->_url = $new_flow;
124
  'urlFlux' => $this->_url,
125
  'idFlux' => $this->_id
126
  );
127
+ Mage::helper('sync/data')->log('Test udate group ' . $this->_idGroup . ' : ' . $this->_url);
128
+ return true;
129
  return $connector->api('updateRootFeed', $args);
130
  }
131
 
132
+ private function _cleanGroup($data) {
133
+ return trim(str_replace(array("\r\n", ';', '-', '|', ' '), ';', $data), ',');
134
+ }
135
+
136
  }
app/code/community/Lengow/Feed/controllers/Adminhtml/Lengow/FeedController.php CHANGED
@@ -42,6 +42,10 @@ class Lengow_Feed_Adminhtml_Lengow_FeedController extends Mage_Adminhtml_Control
42
  $product_status = $this->getRequest()->getParam('product_status');
43
  //$product_child = $this->getRequest()->getParam('product_child');
44
  $format = $this->getRequest()->getParam('format');
 
 
 
 
45
 
46
  if($this->getRequest()->getParam('submit')) {
47
  $feed_ids = array($this->getRequest()->getParam('submit'));
@@ -50,35 +54,44 @@ class Lengow_Feed_Adminhtml_Lengow_FeedController extends Mage_Adminhtml_Control
50
  $error = false;
51
  $message = '';
52
  $data_feeds = json_decode(Mage::getSingleton('feed/config')->get('feed/general/json_feed'));
53
-
54
- foreach($feed_ids as $feed_id) {
55
-
56
- $args = array(
57
- 'feed_id' => $feed_id,
58
- 'selected_products' => $selected_products[$feed_id],
59
- 'product_out_stock' => $product_out_stock[$feed_id],
60
- 'product_type' => $product_type[$feed_id],
61
- 'product_status' => $product_status[$feed_id],
62
- //'product_child' => $product_child[$feed_id],
63
- 'format' => $format[$feed_id]);
64
-
65
- $feed = Mage::getModel('feed/feed', $args);
66
- if(!$feed->update()) {
67
- $error = true;
68
- $message .= Mage::helper('feed')->__('Error update feed %s', '#' . $feed_id . '<br />');
69
- } else {
70
- $data_feeds->{$feed_id} = $args;
 
 
 
 
 
71
  }
 
 
 
 
72
  }
73
 
74
- Mage::getConfig()->saveConfig('feed/general/json_feed', json_encode($data_feeds));
75
-
76
  if($error)
77
  Mage::getSingleton('core/session')->addError($message);
78
  else
79
  Mage::getSingleton('core/session')->addSuccess(Mage::helper('feed')->__('Update success'));
80
-
81
- $this->_redirect('*/*/index');
 
 
82
  }
83
 
84
  }
42
  $product_status = $this->getRequest()->getParam('product_status');
43
  //$product_child = $this->getRequest()->getParam('product_child');
44
  $format = $this->getRequest()->getParam('format');
45
+ $_lengow_ids_group = array();
46
+ $_store_id = $this->getRequest()->getParam('store');
47
+ Mage::helper('sync/data')->log('Test store : ' . $_store_id);
48
+ $_group = Mage::getModel('sync/config')->setStore($_store_id)->getConfig('tracker/general/group');
49
 
50
  if($this->getRequest()->getParam('submit')) {
51
  $feed_ids = array($this->getRequest()->getParam('submit'));
54
  $error = false;
55
  $message = '';
56
  $data_feeds = json_decode(Mage::getSingleton('feed/config')->get('feed/general/json_feed'));
57
+ if(empty($data_feeds))
58
+ $data_feeds = new stdClass;
59
+ if(!empty($feed_ids)) {
60
+ foreach($feed_ids as $feed_id) {
61
+
62
+ $args = array(
63
+ 'feed_id' => $feed_id,
64
+ 'group_id' => $_group,
65
+ 'store_id' => $_store_id,
66
+ 'selected_products' => $selected_products[$feed_id],
67
+ 'product_out_stock' => $product_out_stock[$feed_id],
68
+ 'product_type' => $product_type[$feed_id],
69
+ 'product_status' => $product_status[$feed_id],
70
+ //'product_child' => $product_child[$feed_id],
71
+ 'format' => $format[$feed_id]);
72
+
73
+ $feed = Mage::getModel('feed/feed', $args);
74
+ if(!$feed->update()) {
75
+ $error = true;
76
+ $message .= Mage::helper('feed')->__('Error update feed %s', '#' . $feed_id . '<br />');
77
+ } else {
78
+ $data_feeds->{$feed_id} = $args;
79
+ }
80
  }
81
+ Mage::getConfig()->saveConfig('feed/general/json_feed', json_encode($data_feeds));
82
+ } else {
83
+ $error = 'true';
84
+ $message = Mage::helper('feed')->__('');
85
  }
86
 
 
 
87
  if($error)
88
  Mage::getSingleton('core/session')->addError($message);
89
  else
90
  Mage::getSingleton('core/session')->addSuccess(Mage::helper('feed')->__('Update success'));
91
+ if(!empty($_store_id))
92
+ $this->_redirect('*/*/index/', array('store' => $_store_id));
93
+ else
94
+ $this->_redirect('*/*/index');
95
  }
96
 
97
  }
app/code/community/Lengow/Feed/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Lengow_Feed>
5
- <version>2.0.1.3</version>
6
  </Lengow_Feed>
7
  </modules>
8
  <admin>
2
  <config>
3
  <modules>
4
  <Lengow_Feed>
5
+ <version>2.0.1.5</version>
6
  </Lengow_Feed>
7
  </modules>
8
  <admin>
app/code/community/Lengow/Sync/Block/.DS_Store DELETED
Binary file
app/code/community/Lengow/Sync/Block/Adminhtml/Log/Grid.php CHANGED
@@ -14,7 +14,7 @@ class Lengow_Sync_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_G
14
  parent::__construct();
15
  $this->setId('sales_sync_log_grid');
16
  $this->setUseAjax(true);
17
- $this->setDefaultSort('date');
18
  $this->setDefaultDir('DESC');
19
  $this->setSaveParametersInSession(true);
20
  }
14
  parent::__construct();
15
  $this->setId('sales_sync_log_grid');
16
  $this->setUseAjax(true);
17
+ $this->setDefaultSort('id');
18
  $this->setDefaultDir('DESC');
19
  $this->setSaveParametersInSession(true);
20
  }
app/code/community/Lengow/Sync/Helper/Api.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Lengow sync helper data
4
+ *
5
+ * @category Lengow
6
+ * @package Lengow_Sync
7
+ * @author Ludovic Drin <ludovic@lengow.com>
8
+ * @copyright 2014 Lengow SAS
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ */
11
+ class Lengow_Sync_Helper_Api extends Mage_Core_Helper_Abstract {
12
+
13
+ public function getVersion() {
14
+ return (string) Mage::getConfig()->getNode()->modules->Lengow_Sync->version;
15
+ }
16
+
17
+ }
app/code/community/Lengow/Sync/Model/.DS_Store DELETED
Binary file
app/code/community/Lengow/Sync/Model/Config.php CHANGED
@@ -19,6 +19,8 @@ class Lengow_Sync_Model_Config extends Varien_Object {
19
 
20
  protected $_id_store;
21
 
 
 
22
  public static $ADDRESS_ATTRIBUTES = array(
23
  'prefix' => 'na',
24
  'firstname' => 'firstname',
@@ -100,5 +102,75 @@ class Lengow_Sync_Model_Config extends Varien_Object {
100
  Mage::getModel('core/config')->saveConfig('sync/hidden/last_synchro', date('Y-m-d'));
101
  }
102
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
 
104
  }
19
 
20
  protected $_id_store;
21
 
22
+ protected $_file;
23
+
24
  public static $ADDRESS_ATTRIBUTES = array(
25
  'prefix' => 'na',
26
  'firstname' => 'firstname',
102
  Mage::getModel('core/config')->saveConfig('sync/hidden/last_synchro', date('Y-m-d'));
103
  }
104
  }
105
+
106
+ /**
107
+ * Check if import can be started
108
+ *
109
+ * @return boolean.
110
+ */
111
+ public function importCanStart() {
112
+ $timestamp = $this->readFlagFile();
113
+ if($timestamp !== false) {
114
+ $this->createFlagFile();
115
+ return true;
116
+ }
117
+ if((time() - (integer) $timestamp) < (60*25)) {
118
+ return false;
119
+ } else {
120
+ $this->createFlagFile();
121
+ return true;
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Create file flag.
127
+ *
128
+ * @return boolean.
129
+ */
130
+ public function readFlagFile() {
131
+ $file_path = Mage::getBaseDir('media') . DS . 'lengow' . DS;
132
+ if(is_file($file_path . 'import.flag')) {
133
+ $this->_file = Mage::getModel('sync/file');
134
+ $this->_file->checkAndCreateFolder($file_path);
135
+ $this->_file->cd($file_path);
136
+ $this->_file->streamOpen('import.flag', 'r+');
137
+ $this->_file->streamLock();
138
+ return $this->_file->streamRead(4096);
139
+ } else {
140
+ return false;
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Create file flag.
146
+ *
147
+ * @return boolean.
148
+ */
149
+ public function createFlagFile($clean = false) {
150
+ if($clean)
151
+ $_time = 0;
152
+ else
153
+ $_time = time();
154
+ $file_path = Mage::getBaseDir('media') . DS . 'lengow' . DS;
155
+ $this->_file->streamUnlock();
156
+ $this->_file->streamClose();
157
+ $this->_file->streamOpen('import.flag', 'w+');
158
+ $this->_file->streamLock();
159
+ $this->_file->streamWrite($_time);
160
+ Mage::helper('sync/data')->log('Write on file log : ' . $_time);
161
+ }
162
+
163
+ /**
164
+ * Clean file flag.
165
+ *
166
+ * @return boolean.
167
+ */
168
+ public function cleanFlagFile() {
169
+ $file_path = Mage::getBaseDir('media') . DS . 'lengow' . DS;
170
+ if(is_file($file_path . 'import.flag'))
171
+ $this->createFlagFile(true);
172
+ $this->_file->streamUnlock();
173
+ $this->_file->streamClose();
174
+ }
175
 
176
  }
app/code/community/Lengow/Sync/Model/Connector.php CHANGED
@@ -48,6 +48,7 @@ class Lengow_Sync_Model_Connector {
48
  * Default options for curl.
49
  */
50
  public static $CURL_OPTS = array(
 
51
  CURLOPT_CONNECTTIMEOUT => 10,
52
  CURLOPT_RETURNTRANSFER => true,
53
  CURLOPT_TIMEOUT => 300,
48
  * Default options for curl.
49
  */
50
  public static $CURL_OPTS = array(
51
+ //CURLOPT_SSL_VERIFYPEER => false, // Unquote if you want desactivate ssl check
52
  CURLOPT_CONNECTTIMEOUT => 10,
53
  CURLOPT_RETURNTRANSFER => true,
54
  CURLOPT_TIMEOUT => 300,
app/code/community/Lengow/Sync/Model/Customer/Customer.php CHANGED
@@ -15,17 +15,20 @@ class Lengow_Sync_Model_Customer_Customer extends Mage_Customer_Model_Customer {
15
  *
16
  * @param $xml_node SimpleXMLElement
17
  */
18
- public function setFromNode(SimpleXMLElement $xml_node) {
 
19
  $array = Mage::helper('sync')->xmlToAssoc($xml_node);
20
  if(empty($array['billing_address']['billing_email']))
21
  $array['billing_address']['billing_email'] = 'no-mail-' . $array['order_id'] . '@' . $array['marketplace'] . '.com';
22
  if(empty($array['billing_address']['billing_firstname']))
23
  $array['billing_address']['billing_firstname'] = '__';
24
- $this->setWebsiteId(Mage::app()->getDefaultStoreView()->getWebsiteId())
 
 
25
  ->loadByEmail($array['billing_address']['billing_email']);
26
  if(!$this->getId()) {
27
  $this->setImportMode(true);
28
- $this->setWebsiteId(Mage::app()->getDefaultStoreView()->getWebsiteId());
29
  $this->setConfirmation(null);
30
  $this->setForceConfirmed(true);
31
  $this->setPasswordHash($this->hashPassword($this->generatePassword(8)));
@@ -58,11 +61,16 @@ class Lengow_Sync_Model_Customer_Customer extends Mage_Customer_Model_Customer {
58
  $address->setIsDefaultShipping(true);
59
  }
60
  Mage::helper('core')->copyFieldset('lengow_convert_' . $type . '_address', 'to_' . $type . '_address', $data, $address);
61
- // Fix address 2
62
  if($type == 'shipping')
63
  $type = 'delivery';
64
  $address_1 = $data[$type . '_address'];
65
  $address_2 = $data[$type . '_address_2'];
 
 
 
 
 
 
66
  if(!empty($address_2))
67
  $address_1 = $address_1 . "\n" . $address_2;
68
  $address_3 = $data[$type . '_address_complement'];
15
  *
16
  * @param $xml_node SimpleXMLElement
17
  */
18
+ public function setFromNode(SimpleXMLElement $xml_node, $id_store) {
19
+ $id_store = Mage::getModel('core/store')->load($id_store)->getWebsiteId();
20
  $array = Mage::helper('sync')->xmlToAssoc($xml_node);
21
  if(empty($array['billing_address']['billing_email']))
22
  $array['billing_address']['billing_email'] = 'no-mail-' . $array['order_id'] . '@' . $array['marketplace'] . '.com';
23
  if(empty($array['billing_address']['billing_firstname']))
24
  $array['billing_address']['billing_firstname'] = '__';
25
+ if(empty($array['delivery_address']['delivery_firstname']))
26
+ $array['delivery_address']['delivery_firstname'] = '__';
27
+ $this->setWebsiteId($id_store)
28
  ->loadByEmail($array['billing_address']['billing_email']);
29
  if(!$this->getId()) {
30
  $this->setImportMode(true);
31
+ $this->setWebsiteId($id_store);
32
  $this->setConfirmation(null);
33
  $this->setForceConfirmed(true);
34
  $this->setPasswordHash($this->hashPassword($this->generatePassword(8)));
61
  $address->setIsDefaultShipping(true);
62
  }
63
  Mage::helper('core')->copyFieldset('lengow_convert_' . $type . '_address', 'to_' . $type . '_address', $data, $address);
 
64
  if($type == 'shipping')
65
  $type = 'delivery';
66
  $address_1 = $data[$type . '_address'];
67
  $address_2 = $data[$type . '_address_2'];
68
+ // Fix address 1
69
+ if(empty($address_1) && !empty($address_2)) {
70
+ $address_1 = $address_2;
71
+ $address_2 = null;
72
+ }
73
+ // Fix address 2
74
  if(!empty($address_2))
75
  $address_1 = $address_1 . "\n" . $address_2;
76
  $address_3 = $data[$type . '_address_complement'];
app/code/community/Lengow/Sync/Model/Import.php CHANGED
@@ -73,7 +73,8 @@ class Lengow_Sync_Model_Import extends Varien_Object {
73
  if(Mage::app()->getStore()->getCode() != 'admin')
74
  Mage::app()->setCurrentStore('admin');
75
  $this->_helper = Mage::helper('sync/data');
76
- $this->_config = Mage::getSingleton('sync/config');
 
77
  $this->_checkVersionMarketplaceXML();
78
  $connector = Mage::getSingleton('sync/connector');
79
  self::$import_start = true;
@@ -86,23 +87,33 @@ class Lengow_Sync_Model_Import extends Varien_Object {
86
  'id_group' => $this->_config->getConfig('tracker/general/group'),
87
  'state' => 'plugin'));
88
  if(!is_object($orders)) {
89
- $this->_helper->log('Error on lengow webservice');
90
- return false;
 
 
 
91
  } else {
92
  $find_count_orders = count($orders->orders->order);
93
  $this->_helper->log('Find ' . $find_count_orders . ' order' . ($find_count_orders > 1 ? 's' : ''));
94
  }
95
  //LengowCore::debug($orders);
96
  $count_orders = (integer) $orders->orders_count->count_total;
 
 
 
 
 
 
 
97
  if($count_orders == 0) {
98
  $this->_helper->log('No orders to import between ' . $args['dateFrom'] . ' and ' . $args['dateTo'], $this->force_log_output);
99
  return false;
100
  }
101
- $model_order = Mage::getModel('sync/order');
102
  foreach($orders->orders->order as $key => $data) {
103
  $lengow_order = $data;
104
  $lengow_order_id = (string) $lengow_order->order_id;
105
- if($this->_config->isDebugMode()) {
106
  $lengow_order_id = $lengow_order_id . time();
107
  }
108
  $marketplace = Mage::getModel('sync/marketplace');
@@ -123,10 +134,14 @@ class Lengow_Sync_Model_Import extends Varien_Object {
123
  $this->_config->getOrderState($lengow_status);
124
  // Update status' order only if in process or shipped
125
  if($order_imported->getState() != $this->_config->getOrderState($lengow_status)) {
126
- // Change state process to shipped
127
- if($order_imported->getState() == $this->_config->getOrderState('processing')
 
 
 
 
128
  && $lengow_order->order_status->lengow == 'shipped') {
129
- $order_imported->toShip($order,
130
  (string) $lengow_order->tracking_informations->tracking_carrier,
131
  (string) $lengow_order->tracking_informations->tracking_method,
132
  (string) $lengow_order->tracking_informations->tracking_number);
@@ -135,7 +150,7 @@ class Lengow_Sync_Model_Import extends Varien_Object {
135
  } else if(($order_imported->current_state == $this->_config->getOrderState('process') // Change state process or shipped to cancel
136
  || $order_imported->current_state == $this->_config->getOrderState('shipped'))
137
  && $lengow_order->order_status->lengow == 'canceled') {
138
- $order_imported->toCancel();
139
  $this->_helper->log('Order ' . $lengow_order_id . ' : update state to cancel');
140
  $count_orders_updated++;
141
  }
@@ -145,19 +160,36 @@ class Lengow_Sync_Model_Import extends Varien_Object {
145
  $lengow_order_state = (string) $lengow_order->order_status->marketplace;
146
  $id_order_magento = (string) $lengow_order->order_external_id;
147
  if(($marketplace->getStateLengow($lengow_order_state) == 'processing'
148
- || $marketplace->getStateLengow($lengow_order_state) == 'shipped') && !$id_order_magento) {
149
- ////try {
150
- $order = Mage::getModel('sync/order');
 
 
 
 
 
 
 
 
 
 
 
151
  // Create or Update customer with addresses
152
  $customer = Mage::getModel('sync/customer_customer');
153
- $customer->setFromNode($data);
 
 
 
 
 
 
 
154
  // Create quote
155
  if(!$quote = $order->createQuote($data, $customer)) {
156
  $this->_helper->log('Order ' . $lengow_order_id . ' : create order fail');
157
  continue;
158
  }
159
- // Create order
160
- $order = $order->makeOrder($data, $quote);
161
  if($order) {
162
  // Change order date
163
  if($this->_config->get('orders/date_import')) {
@@ -184,19 +216,24 @@ class Lengow_Sync_Model_Import extends Varien_Object {
184
  }
185
  $count_orders_added++;
186
  $this->_helper->log('Order ' . $lengow_order_id . ' : import success (' . $order->getId() . ')');
 
 
 
 
 
 
 
 
 
 
 
 
187
  }
188
- // Clear session
189
- Mage::getSingleton('checkout/session')->clear();
190
- ////*} catch(Exception $e) {
191
- //$this->_helper->log($e->getMessage(),$orderLw['IdOrder']);
192
- //Erase session for the next order
193
- //$this->getSession()->clear();
194
- //}*////
195
  } else {
196
  if($id_order_magento) {
197
  $this->_helper->log('Order ' . $lengow_order_id . ' : already imported in Magento with order ID ' . $id_order_magento);
198
  } else {
199
- $this->_helper->log('Order ' . $lengow_order_id . ' : order\'s status not available to import');
200
  }
201
  }
202
  }
73
  if(Mage::app()->getStore()->getCode() != 'admin')
74
  Mage::app()->setCurrentStore('admin');
75
  $this->_helper = Mage::helper('sync/data');
76
+ $this->_config = Mage::getSingleton('sync/config')
77
+ ->setStore($args['id_store']);
78
  $this->_checkVersionMarketplaceXML();
79
  $connector = Mage::getSingleton('sync/connector');
80
  self::$import_start = true;
87
  'id_group' => $this->_config->getConfig('tracker/general/group'),
88
  'state' => 'plugin'));
89
  if(!is_object($orders)) {
90
+ $error = $this->_helper->__('Error on lengow webservice');
91
+ $this->_helper->log($error);
92
+ return array('new' => 0,
93
+ 'update' => 0,
94
+ 'error' => $error);
95
  } else {
96
  $find_count_orders = count($orders->orders->order);
97
  $this->_helper->log('Find ' . $find_count_orders . ' order' . ($find_count_orders > 1 ? 's' : ''));
98
  }
99
  //LengowCore::debug($orders);
100
  $count_orders = (integer) $orders->orders_count->count_total;
101
+ if(isset($orders->error) && (string) $orders->error == 'No Way') {
102
+ $error = $this->_helper->__('API\'s connection refused with IP %s', (string) $orders->ip);
103
+ $this->_helper->log($error);
104
+ return array('new' => 0,
105
+ 'update' => 0,
106
+ 'error' => $error);
107
+ }
108
  if($count_orders == 0) {
109
  $this->_helper->log('No orders to import between ' . $args['dateFrom'] . ' and ' . $args['dateTo'], $this->force_log_output);
110
  return false;
111
  }
112
+ $model_order = Mage::getModel('sync/order', $args['id_store']);
113
  foreach($orders->orders->order as $key => $data) {
114
  $lengow_order = $data;
115
  $lengow_order_id = (string) $lengow_order->order_id;
116
+ if($this->_config->isDebugMode() && !$this->getForceUpdate()) {
117
  $lengow_order_id = $lengow_order_id . time();
118
  }
119
  $marketplace = Mage::getModel('sync/marketplace');
134
  $this->_config->getOrderState($lengow_status);
135
  // Update status' order only if in process or shipped
136
  if($order_imported->getState() != $this->_config->getOrderState($lengow_status)) {
137
+ if($order_imported->getState() == $this->_config->getOrderState('new') // Change state process to processing
138
+ && $lengow_order->order_status->lengow == 'shipped') {
139
+ $model_order->toInvoice($order_imported);
140
+ $this->_helper->log('Order ' . $lengow_order_id . ' : update state to processing');
141
+ $count_orders_updated++;
142
+ } else if($order_imported->getState() == $this->_config->getOrderState('processing') // Change state process to shipped
143
  && $lengow_order->order_status->lengow == 'shipped') {
144
+ $model_order->toShip($order_imported,
145
  (string) $lengow_order->tracking_informations->tracking_carrier,
146
  (string) $lengow_order->tracking_informations->tracking_method,
147
  (string) $lengow_order->tracking_informations->tracking_number);
150
  } else if(($order_imported->current_state == $this->_config->getOrderState('process') // Change state process or shipped to cancel
151
  || $order_imported->current_state == $this->_config->getOrderState('shipped'))
152
  && $lengow_order->order_status->lengow == 'canceled') {
153
+ $model_order->toCancel($order_imported);
154
  $this->_helper->log('Order ' . $lengow_order_id . ' : update state to cancel');
155
  $count_orders_updated++;
156
  }
160
  $lengow_order_state = (string) $lengow_order->order_status->marketplace;
161
  $id_order_magento = (string) $lengow_order->order_external_id;
162
  if(($marketplace->getStateLengow($lengow_order_state) == 'processing'
163
+ || $marketplace->getStateLengow($lengow_order_state) == 'shipped'
164
+ || ($marketplace->getStateLengow($lengow_order_state) == 'new' && $this->_config->get('orders/pending'))) && !$id_order_magento) {
165
+ // Check payment status
166
+ $lengow_order_payment_status = (string) $lengow_order->order_payment->payment_status;
167
+ // Break new order if not in pending payment
168
+ $_to_order = true;
169
+ if($marketplace->getStateLengow($lengow_order_state) == 'new' && $this->_config->get('orders/pending')) {
170
+ $_to_order = false;
171
+ if(empty($lengow_order_payment_status) || !$marketplace->getStatePaymentLengow($lengow_order_payment_status) == 'pending') {
172
+ $this->_helper->log('Order ' . $lengow_order_id . ' : order\'s status ( ' . $lengow_order_state . ' - ' . $lengow_order_payment_status . ') not available to import');
173
+ continue;
174
+ }
175
+ }
176
+ $order = Mage::getModel('sync/order', $args['id_store']);
177
  // Create or Update customer with addresses
178
  $customer = Mage::getModel('sync/customer_customer');
179
+ $customer->setFromNode($data, $args['id_store']);
180
+ // Create order
181
+ $payment_status = '';
182
+ if(!$this->_config->get('orders/processing_fee')) {
183
+ $data->order_amount = new SimpleXMLElement('<order_amount><![CDATA[' . ((float) $data->order_amount - (float) $data->order_processing_fee) . ']]></order_amount>');
184
+ $data->order_processing_fee = new SimpleXMLElement('<order_processing_fee><![CDATA[ ]]></order_processing_fee>');
185
+ $this->_helper->log('Order ' . $lengow_order_id . ' : rewrite amount without processing fee');
186
+ }
187
  // Create quote
188
  if(!$quote = $order->createQuote($data, $customer)) {
189
  $this->_helper->log('Order ' . $lengow_order_id . ' : create order fail');
190
  continue;
191
  }
192
+ $order = $order->makeOrder($data, $quote, $_to_order);
 
193
  if($order) {
194
  // Change order date
195
  if($this->_config->get('orders/date_import')) {
216
  }
217
  $count_orders_added++;
218
  $this->_helper->log('Order ' . $lengow_order_id . ' : import success (' . $order->getId() . ')');
219
+ if($lengow_order->order_status->lengow == 'shipped') {
220
+ $id_flux = (integer) $lengow_order->idFlux;
221
+ $model_order = Mage::getModel('sync/order', $args['id_store']);
222
+ $order_imported = $model_order->getOrderByIdLengow($lengow_order_id, $id_flux);
223
+ $model_order->toShip($order,
224
+ (string) $lengow_order->tracking_informations->tracking_carrier,
225
+ (string) $lengow_order->tracking_informations->tracking_method,
226
+ (string) $lengow_order->tracking_informations->tracking_number);
227
+ $this->_helper->log('Order ' . $lengow_order_id . ' : update state to shipped');
228
+ }
229
+ // Clear session
230
+ Mage::getSingleton('checkout/session')->clear();
231
  }
 
 
 
 
 
 
 
232
  } else {
233
  if($id_order_magento) {
234
  $this->_helper->log('Order ' . $lengow_order_id . ' : already imported in Magento with order ID ' . $id_order_magento);
235
  } else {
236
+ $this->_helper->log('Order ' . $lengow_order_id . ' : order\'s status ( ' . $lengow_order_state . ') not available to import');
237
  }
238
  }
239
  }
app/code/community/Lengow/Sync/Model/Marketplace.php CHANGED
@@ -41,7 +41,10 @@ class Lengow_Sync_Model_Marketplace {
41
  public $states_lengow = array();
42
  public $states = array();
43
  public $actions = array();
 
 
44
  protected $_config;
 
45
 
46
 
47
  /**
@@ -57,6 +60,7 @@ class Lengow_Sync_Model_Marketplace {
57
  if(!empty($object)) {
58
  $this->object = $object[0];
59
  $this->api_url = (string) $this->object->api;
 
60
  foreach($this->object->states->state as $state) {
61
  $this->states_lengow[(string) $state['name']] = (string) $state->lengow;
62
  $this->states[(string) $state->lengow] = (string) $state['name'];
@@ -79,6 +83,13 @@ class Lengow_Sync_Model_Marketplace {
79
  }
80
  }
81
  }
 
 
 
 
 
 
 
82
  $this->is_loaded = true;
83
  }
84
  }
@@ -100,7 +111,7 @@ class Lengow_Sync_Model_Marketplace {
100
  * @return string The lengow state
101
  */
102
  public function getStateLengow($name) {
103
- return $this->states_lengow[$name];
104
  }
105
 
106
  /**
@@ -111,7 +122,29 @@ class Lengow_Sync_Model_Marketplace {
111
  * @return string The marketplace state
112
  */
113
  public function getState($name) {
114
- return $this->states[$name];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
116
 
117
  /**
@@ -177,7 +210,7 @@ class Lengow_Sync_Model_Marketplace {
177
  if(!empty($trackings)) {
178
  $first_track = $trackings[0];
179
  $gets[$param['name']] = array(
180
- 'value' => $this->_matchCarrier($param, $first_track->getCarrierCode()),
181
  'require' => (array_key_exists('require', $param) ? explode(' ', $param['require']) : array())
182
  );
183
  }
@@ -262,10 +295,10 @@ class Lengow_Sync_Model_Marketplace {
262
  *
263
  * @return string The matching carrier name
264
  */
265
- private function _matchCarrier($param, $name) {
266
  // No match
267
  if(!isset($param['accepted_values']))
268
- return $name;
269
  // Exact match
270
  foreach($param['accepted_values'] as $value) {
271
  $value = (string) $value;
41
  public $states_lengow = array();
42
  public $states = array();
43
  public $actions = array();
44
+ public $payments = array();
45
+ public $payments_lengow = array();
46
  protected $_config;
47
+ const MARKETPLACE_STATUS_NO_MATCH = -1;
48
 
49
 
50
  /**
60
  if(!empty($object)) {
61
  $this->object = $object[0];
62
  $this->api_url = (string) $this->object->api;
63
+ // States
64
  foreach($this->object->states->state as $state) {
65
  $this->states_lengow[(string) $state['name']] = (string) $state->lengow;
66
  $this->states[(string) $state->lengow] = (string) $state['name'];
83
  }
84
  }
85
  }
86
+ // Payment
87
+ if(count($this->object->payments)) {
88
+ foreach($this->object->payments->payment as $payment) {
89
+ $this->payment_lengow[(string) $payment['name']] = (string) $payment->lengow;
90
+ $this->payment[(string) $payment->lengow] = (string) $payment['name'];
91
+ }
92
+ }
93
  $this->is_loaded = true;
94
  }
95
  }
111
  * @return string The lengow state
112
  */
113
  public function getStateLengow($name) {
114
+ return array_key_exists($name, $this->states_lengow) ? $this->states_lengow[$name] : self::MARKETPLACE_STATUS_NO_MATCH;
115
  }
116
 
117
  /**
122
  * @return string The marketplace state
123
  */
124
  public function getState($name) {
125
+ return array_key_exists($name, $this->states) ? $this->states[$name] : self::MARKETPLACE_STATUS_NO_MATCH;
126
+ }
127
+
128
+ /**
129
+ * Get the real lengow's payment
130
+ *
131
+ * @param string $name The payment state
132
+ *
133
+ * @return string The lengow payment state
134
+ */
135
+ public function getStatePaymentLengow($name) {
136
+ return array_key_exists($name, $this->payments_lengow) ? $this->payments_lengow[$name] : self::MARKETPLACE_STATUS_NO_MATCH;
137
+ }
138
+
139
+ /**
140
+ * Get the marketplace's payment
141
+ *
142
+ * @param string $name The lengow payment
143
+ *
144
+ * @return string The marketplace payment
145
+ */
146
+ public function getStatePayment($name) {
147
+ return array_key_exists($name, $this->payments) ? $this->payments[$name] : self::MARKETPLACE_STATUS_NO_MATCH;
148
  }
149
 
150
  /**
210
  if(!empty($trackings)) {
211
  $first_track = $trackings[0];
212
  $gets[$param['name']] = array(
213
+ 'value' => $this->_matchCarrier($param, $first_track->getCarrierCode(), $first_track->getTitle()),
214
  'require' => (array_key_exists('require', $param) ? explode(' ', $param['require']) : array())
215
  );
216
  }
295
  *
296
  * @return string The matching carrier name
297
  */
298
+ private function _matchCarrier($param, $name, $title) {
299
  // No match
300
  if(!isset($param['accepted_values']))
301
+ return $title;
302
  // Exact match
303
  foreach($param['accepted_values'] as $value) {
304
  $value = (string) $value;
app/code/community/Lengow/Sync/Model/Mysql4/.DS_Store DELETED
Binary file
app/code/community/Lengow/Sync/Model/Observer.php CHANGED
@@ -10,24 +10,71 @@
10
  */
11
  class Lengow_Sync_Model_Observer {
12
 
13
- public function import($observer) {
14
- try {
15
- $_config = Mage::getSingleton('sync/config');
16
- if($_config->getConfig('sync/orders/cron')) {
17
- $import = Mage::getModel('sync/import');
18
- $days = Mage::getModel('sync/config')->setStore(Mage::app()->getStore()->getId())
19
- ->getConfig('sync/orders/period');
20
- $date_from = date('Y-m-d', strtotime(date('Y-m-d') . '-' . $days . 'days'));
21
- $date_to = date('Y-m-d');
22
- $import = Mage::getModel('sync/import');
23
- $result = $import->exec('orders', array('dateFrom' => $date_from,
24
- 'dateTo' => $date_to));
25
- }
26
- } catch (Exception $e) {
27
- Mage::throwException($e);
28
- }
29
- return $this;
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  public function salesOrderShipmentSaveAfter(Varien_Event_Observer $observer) {
33
  $shipment = $observer->getEvent()->getShipment();
@@ -68,4 +115,8 @@ class Lengow_Sync_Model_Observer {
68
  }
69
  }
70
 
 
 
 
 
71
  }
10
  */
11
  class Lengow_Sync_Model_Observer {
12
 
13
+ public function import($observer) {
14
+ //if(!Mage::getSingelton('sync/config')->importCanStart()) {
15
+ // Mage::helper('sync/data')->log('##Error cron import : import is already started##');
16
+ //} else {
17
+ Mage::helper('sync/data')->log('##Start cron import##');
18
+ $_default_store = Mage::getModel('core/store')->load(Mage::app()
19
+ ->getWebsite(true)
20
+ ->getDefaultGroup()
21
+ ->getDefaultStoreId());
22
+ $_current_id_store = $_default_store->getId();
23
+ $_lengow_id_user_global = Mage::getModel('sync/config')->setStore($_current_id_store)->getConfig('tracker/general/login');
24
+ $_lengow_id_group_global = $this->_cleanGroup(Mage::getModel('sync/config')->setStore($_current_id_store)->getConfig('tracker/general/group'));
25
+ $result_new = 0;
26
+ $result_update = 0;
27
+ $result_new = 0;
28
+ $_default_is_imported = false;
29
+ $import = Mage::getModel('sync/import');
30
+ // Import default shop if configured
31
+ if($_lengow_id_user_global && $_lengow_id_group_global) {
32
+ try {
33
+ $_default_is_imported = true;
34
+ Mage::helper('sync/data')->log('Start cron import in store ' . $_default_store->getName() . '(' . $_default_store->getId() . ')');
35
+ $days = Mage::getModel('sync/config')->setStore($_default_store->getId())
36
+ ->getConfig('sync/orders/period');
37
+ $date_from = date('Y-m-d', strtotime(date('Y-m-d') . '-' . $days . 'days'));
38
+ $date_to = date('Y-m-d');
39
+ $result = $import->exec('orders', array('dateFrom' => $date_from,
40
+ 'dateTo' => $date_to,
41
+ 'id_store' => $_current_id_store));
42
+ $result_new = $result['new'];
43
+ $result_update = $result['update'];
44
+ } catch(Exception $e) {
45
+ Mage::helper('sync/data')->log('Error : ' . $e->getMessage());
46
+ }
47
+ }
48
+ $store_collection = Mage::getResourceModel('core/store_collection')
49
+ ->addFieldToFilter('is_active', 1);
50
+ // Import different view if is different
51
+ foreach($store_collection as $store) {
52
+ try {
53
+ $_lengow_id_user_current = Mage::getModel('sync/config')->setStore($store->getId())->getConfig('tracker/general/login');
54
+ $_lengow_id_group_current = $this->_cleanGroup(Mage::getModel('sync/config')->setStore($store->getId())->getConfig('tracker/general/group'));
55
+ if(($_lengow_id_user_current != $_lengow_id_user_global || $_lengow_id_group_current != $_lengow_id_group_global)
56
+ && $_lengow_id_user_current && $_lengow_id_group_current) {
57
+ if($store->getId() != $_current_id_store || !$_default_is_imported) {
58
+ Mage::helper('sync/data')->log('Start cron import in store ' . $store->getName() . '(' . $store->getId() . ')');
59
+ $days = Mage::getModel('sync/config')->setStore($store->getId())
60
+ ->getConfig('sync/orders/period');
61
+ $date_from = date('Y-m-d', strtotime(date('Y-m-d') . '-' . $days . 'days'));
62
+ $date_to = date('Y-m-d');
63
+ $import = Mage::getModel('sync/import');
64
+ $result = $import->exec('orders', array('dateFrom' => $date_from,
65
+ 'dateTo' => $date_to,
66
+ 'id_store' => $store->getId()));
67
+ $result_new += $result['new'];
68
+ $result_update += $result['update'];
69
+ }
70
+ }
71
+ } catch(Exception $e) {
72
+ Mage::helper('sync/data')->log('Error : ' . $e->getMessage());
73
+ }
74
+ }
75
+ Mage::helper('sync/data')->log('##End cron import##');
76
+ //}
77
+ }
78
 
79
  public function salesOrderShipmentSaveAfter(Varien_Event_Observer $observer) {
80
  $shipment = $observer->getEvent()->getShipment();
115
  }
116
  }
117
 
118
+ private function _cleanGroup($data) {
119
+ return trim(str_replace(array("\r\n", ';', '-', '|', ' '), ';', $data), ',');
120
+ }
121
+
122
  }
app/code/community/Lengow/Sync/Model/Order.php CHANGED
@@ -5,43 +5,53 @@
5
  * @category Lengow
6
  * @package Lengow_Sync
7
  * @author Ludovic Drin <ludovic@lengow.com>
8
- * @copyright 2013 Lengow SAS
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
12
-
13
  protected $_countryCollection;
14
  protected $_config;
15
-
16
  protected $_canInvoice = false;
17
  protected $_canShip = false;
18
  protected $_canCancel = false;
19
  protected $_canRefund = false;
20
-
21
  protected $_hasInvoices = false;
22
  protected $_hasShipments = false;
23
  protected $_isCanceled = false;
24
  protected $_isRefunded = false;
25
-
26
- public function isAlreadyImported($id_lengow, $id_flux) {
 
 
 
 
 
 
 
27
  $order = Mage::getModel('sales/order')->getCollection()
28
  ->addAttributeToFilter('order_id_lengow', $id_lengow)
29
- ->addAttributeToSelect('order_id_lengow');
 
 
30
  if(count($order) > 0)
31
  return true;
32
  else
33
  return false;
34
  }
35
-
36
  public function getOrderByIdLengow($id_lengow, $id_flux) {
37
  $order = Mage::getModel('sales/order')->getCollection()
38
  ->addAttributeToFilter('order_id_lengow', $id_lengow)
 
39
  ->addAttributeToSelect('entity_id')
40
  ->getData();
41
- if(count($order))
42
- return Mage::getModel('sync/order')->load($order[0]);
43
  }
44
-
45
  /**
46
  * Retrieve config singleton
47
  *
@@ -53,23 +63,23 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
53
  }
54
  return $this->_config;
55
  }
56
-
57
  /**
58
  * Create quote
59
  *
60
  * @param Varien_Object $lengowItem
61
  */
62
  public function createQuote(SimpleXMLelement $data, Lengow_Sync_Model_Customer_Customer $customer) {
63
- $quote = new Mage_Sales_Model_Quote();
64
  $quote->setIsMultiShipping(false)
65
  ->setCheckoutMethod(Mage_Checkout_Model_Type_Onepage::METHOD_CUSTOMER)
66
  ->setCustomerId($customer->getId())
67
  ->setCustomerEmail($customer->getEmail())
68
  ->setCustomerIsGuest(false)
69
- ->setCustomerGroupId($this->getConfig()->get('customer_type'))
70
  ->setCustomerFirstname($customer->getFirstname())
71
  ->setCustomerLastname($customer->getLastname())
72
- ->setStore(Mage::app()->getDefaultStoreView());
73
  // Add products to quote with data from Lengow
74
  foreach($data->cart->products->product as $lengow_product) {
75
  if(!$quote = $this->addItemToQuote($lengow_product, $quote, (string) $data->order_id)) {
@@ -78,7 +88,7 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
78
  }
79
  // Set billing Address
80
  $billing_address = $quote->getBillingAddress();
81
- $billing_address->setShouldIgnoreValidation(true);
82
  $customer_billing_address = Mage::getModel('customer/address')->load($customer->getDefaultBilling());
83
  $billing_address->importCustomerAddress($customer_billing_address)->setSaveInAddressBook(0);
84
  // Set shipping Address
@@ -121,7 +131,7 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
121
  $quote->save();
122
  return $quote;
123
  }
124
-
125
  /**
126
  * Add item to quote
127
  *
@@ -129,9 +139,9 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
129
  * @param Mage_Sales_Mode_Quote
130
  * @return Mage_Sales_Mode_Quote
131
  */
132
- public function addItemToQuote(SimpleXMLelement $lengow_product, Mage_Sales_Model_Quote $quote, $order_id) {
133
  // TODO add while
134
- $quote->setIsSuperMode(true);
135
  $product_model = Mage::getModel('catalog/product');
136
  $sku = (string) $lengow_product->sku;
137
  $sku = str_replace('\_', '_', $sku);
@@ -152,29 +162,29 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
152
  $product->load($collection[0]['entity_id']);
153
  }
154
  }
155
- if(!$product->getId()) {
156
  $product = $product_model->load($product_model->getIdBySku($sku));
157
- if(!$product->getId()) {
158
  $sku = (string) $lengow_product->idMP;
159
  $sku = str_replace('\_', '_', $sku);
160
  $product = $product_model->load($product_model->getIdBySku($sku));
161
- if(!$product->getId()) {
162
  $sku = (string) $lengow_product->idLengow;
163
  $sku = str_replace('\_', '_', $sku);
164
  $product = $product_model->load($product_model->getIdBySku($sku));
165
- if(!$product->getId()) {
166
  $sku = (string) $lengow_product->sku;
167
  $sku = str_replace('\_', '_', $sku);
168
  $product = $product_model->load($sku);
169
- if(!$product->getId()) {
170
  $sku = (string) $lengow_product->idMP;
171
  $sku = str_replace('\_', '_', $sku);
172
  $product = $product_model->load($sku);
173
- if(!$product->getId()) {
174
  $sku = (string) $lengow_product->idLengow;
175
  $sku = str_replace('\_', '_', $sku);
176
  $product = $product_model->load($sku);
177
- if(!$product->getId()) {
178
  Mage::helper('sync')->log('Order ' . $order_id . ' : Product ' . (string) $lengow_product->sku . ' doesn\'t exist');
179
  return false;
180
  }
@@ -196,21 +206,21 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
196
  $title_from_lengow = $this->getConfig()->setStore($quote->getStore()->getStoreId())->get('orders/title');
197
  if($title_from_lengow)
198
  $quote_item->setName((string) $lengow_product->title);
199
- $quote->addItem($quote_item);
200
  return $quote;
201
  }
202
-
203
  /**
204
  * Create order
205
- *
206
  * @param Mage_Sales_Model_Quote
207
- * @return Mage_Sales_Model_Order
208
  */
209
- public function makeOrder(SimpleXMLelement $data, Mage_Sales_Model_Quote $quote) {
210
- try {
211
- $order = false;
212
  $store = $quote->getStore();
213
- $grand_total = 0;
214
  if (!Mage::helper('tax')->priceIncludesTax($store)) {
215
  $grand_total = $quote->getGrandTotal();
216
  }
@@ -226,20 +236,24 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
226
  'total_paid_lengow' => (float) $data->order_amount ,
227
  'carrier_lengow' => (string) $data->tracking_informations->tracking_carrier ,
228
  'carrier_method_lengow' => (string) $data->tracking_informations->tracking_method ,
 
 
 
 
229
  );
230
  $service = Mage::getModel('sales/service_quote', $quote);
231
  $service->setOrderData($additional_data);
232
  $order = false;
233
- if(method_exists($service, 'submitAll')) {
234
  $service->submitAll();
235
  $order = $service->getOrder();
236
  } else {
237
  $order = $service->submit();
238
  }
239
- $order->setIsFromLengow(true)
240
- ->save();
241
  // Re-ajuste cents
242
- // Conversion Tax Include > Tax Exclude > Tax Include maybe make 0.01 amount error
243
  if (!Mage::helper('tax')->priceIncludesTax($store)) {
244
 
245
  if($order->getBaseShippingInclTax() != (float) $data->order_shipping) {
@@ -253,10 +267,11 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
253
  }
254
  $order->save();
255
  }
256
- $order = $this->toInvoice($order);
 
257
  // FIX fields amount & taxes
258
  $products = Mage::getResourceModel('sales/order_item_collection')
259
- ->setOrderFilter($order->getId());
260
  foreach($products as $product) {
261
  $product->setBaseOriginalPrice($product->getOriginalPrice());
262
  $product->setBaseTaxAmount($product->getTaxAmount());
@@ -274,13 +289,13 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
274
  $order->save();
275
  } catch (Exception $e){
276
  Mage::helper('sync')->log('Error create order : ' . $e->getMessage());
277
- }
278
- return $order;
279
  }
280
-
281
  /**
282
  * Create invoice
283
- *
284
  * @param Mage_Sales_Model_Order
285
  * @return Lengow_Sync_Model_Order
286
  */
@@ -296,10 +311,10 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
296
  $transactionSave->save();
297
  $this->_hasInvoices = true;
298
  }
299
- }
300
  return $order;
301
  }
302
-
303
  /**
304
  * Ship order
305
  *
@@ -307,7 +322,7 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
307
  * @return Lengow_Sync_Model_Order
308
  */
309
  public function toShip($order, $carrier = null, $title = '', $tracking = '') {
310
- if($this->_canShip && $order->canShip()) {
311
  $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment();
312
  if($shipment) {
313
  $shipment->register();
@@ -318,17 +333,30 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
318
  $transactionSave->save();
319
  $this->_hasShipments = true;
320
  // Add tracking information
321
- if($tracking)
322
- $ship = Mage::getModel('sales/order_shipment_api')
323
- ->addTrack($shipment->getIncrementId() ,
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  $carrier ,
325
  $title ,
326
- $tracking);
327
  }
328
- }
329
  return $this;
330
  }
331
-
332
  /**
333
  * Cancel order
334
  *
@@ -340,10 +368,10 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
340
  $order->cancel();
341
  $this->_isCanceled = true;
342
  }
343
-
344
  return $this;
345
  }
346
-
347
  /**
348
  * Refund order
349
  *
@@ -352,17 +380,17 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
352
  */
353
  public function toRefund(Lengow_Sync_Model_Order $order) {
354
  if($this->_canRefund && $order->canCreditmemo()) {
355
- $invoice_id = $order->getInvoiceCollection()->getFirstItem()->getId();
356
  if(!$invoice_id) {
357
- return $this;
358
- }
359
  $invoice = Mage::getModel('sales/order_invoice')->load($invoice_id)->setOrder($order);
360
  $service = Mage::getModel('sales/service_order', $order);
361
- $creditmemo = $service->prepareInvoiceCreditmemo($invoice);
362
  $backToStock = array();
363
  foreach($order->getAllItems() as $item) {
364
  $backToStock[$item->getId()] = true;
365
- }
366
  // Process back to stock flags
367
  foreach ($creditmemo->getAllItems() as $creditmemoItem) {
368
  $orderItem = $creditmemoItem->getOrderItem();
@@ -372,8 +400,8 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
372
  } else {
373
  $creditmemoItem->setBackToStock(false);
374
  }
375
- }
376
- $creditmemo->register();
377
  $transactionSave = Mage::getModel('core/resource_transaction')
378
  ->addObject($creditmemo)
379
  ->addObject($creditmemo->getOrder());
@@ -382,13 +410,13 @@ class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
382
  }
383
  $transactionSave->save();
384
  $this->_isRefunded = true;
385
- }
386
  return $this;
387
  }
388
-
389
  /**
390
  * Retrieve country id based on country name
391
- *
392
  * @param string $country_name
393
  * @return string
394
  */
5
  * @category Lengow
6
  * @package Lengow_Sync
7
  * @author Ludovic Drin <ludovic@lengow.com>
8
+ * @copyright 2013 Lengow SAS
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Lengow_Sync_Model_Order extends Mage_Sales_Model_Order {
12
+
13
  protected $_countryCollection;
14
  protected $_config;
15
+
16
  protected $_canInvoice = false;
17
  protected $_canShip = false;
18
  protected $_canCancel = false;
19
  protected $_canRefund = false;
20
+
21
  protected $_hasInvoices = false;
22
  protected $_hasShipments = false;
23
  protected $_isCanceled = false;
24
  protected $_isRefunded = false;
25
+
26
+ private $_store;
27
+
28
+ public function __construct($id_store) {
29
+ $this->_store = Mage::getModel('core/store')->load($id_store);
30
+ parent::__construct();
31
+ }
32
+
33
+ public function isAlreadyImported($id_lengow, $id_flux) {
34
  $order = Mage::getModel('sales/order')->getCollection()
35
  ->addAttributeToFilter('order_id_lengow', $id_lengow)
36
+ ->addAttributeToFilter('feed_id_lengow', $id_flux)
37
+ ->addAttributeToSelect('order_id_lengow')
38
+ ->getData();;
39
  if(count($order) > 0)
40
  return true;
41
  else
42
  return false;
43
  }
44
+
45
  public function getOrderByIdLengow($id_lengow, $id_flux) {
46
  $order = Mage::getModel('sales/order')->getCollection()
47
  ->addAttributeToFilter('order_id_lengow', $id_lengow)
48
+ ->addAttributeToFilter('feed_id_lengow', $id_flux)
49
  ->addAttributeToSelect('entity_id')
50
  ->getData();
51
+ if(isset($order[0]['entity_id']))
52
+ return Mage::getModel('sales/order')->load($order[0]['entity_id']);
53
  }
54
+
55
  /**
56
  * Retrieve config singleton
57
  *
63
  }
64
  return $this->_config;
65
  }
66
+
67
  /**
68
  * Create quote
69
  *
70
  * @param Varien_Object $lengowItem
71
  */
72
  public function createQuote(SimpleXMLelement $data, Lengow_Sync_Model_Customer_Customer $customer) {
73
+ $quote = Mage::getModel('sales/quote');
74
  $quote->setIsMultiShipping(false)
75
  ->setCheckoutMethod(Mage_Checkout_Model_Type_Onepage::METHOD_CUSTOMER)
76
  ->setCustomerId($customer->getId())
77
  ->setCustomerEmail($customer->getEmail())
78
  ->setCustomerIsGuest(false)
79
+ ->setCustomerGroupId($this->getConfig()->get('orders/customer_group'))
80
  ->setCustomerFirstname($customer->getFirstname())
81
  ->setCustomerLastname($customer->getLastname())
82
+ ->setStore($this->_store);
83
  // Add products to quote with data from Lengow
84
  foreach($data->cart->products->product as $lengow_product) {
85
  if(!$quote = $this->addItemToQuote($lengow_product, $quote, (string) $data->order_id)) {
88
  }
89
  // Set billing Address
90
  $billing_address = $quote->getBillingAddress();
91
+ $billing_address->setShouldIgnoreValidation(true);
92
  $customer_billing_address = Mage::getModel('customer/address')->load($customer->getDefaultBilling());
93
  $billing_address->importCustomerAddress($customer_billing_address)->setSaveInAddressBook(0);
94
  // Set shipping Address
131
  $quote->save();
132
  return $quote;
133
  }
134
+
135
  /**
136
  * Add item to quote
137
  *
139
  * @param Mage_Sales_Mode_Quote
140
  * @return Mage_Sales_Mode_Quote
141
  */
142
+ public function addItemToQuote(SimpleXMLelement $lengow_product, $quote, $order_id) {
143
  // TODO add while
144
+ $quote->setIsSuperMode(true);
145
  $product_model = Mage::getModel('catalog/product');
146
  $sku = (string) $lengow_product->sku;
147
  $sku = str_replace('\_', '_', $sku);
162
  $product->load($collection[0]['entity_id']);
163
  }
164
  }
165
+ if(!empty($sku) && !$product->getId()) {
166
  $product = $product_model->load($product_model->getIdBySku($sku));
167
+ if(!empty($sku) && !$product->getId()) {
168
  $sku = (string) $lengow_product->idMP;
169
  $sku = str_replace('\_', '_', $sku);
170
  $product = $product_model->load($product_model->getIdBySku($sku));
171
+ if(!empty($sku) && !$product->getId()) {
172
  $sku = (string) $lengow_product->idLengow;
173
  $sku = str_replace('\_', '_', $sku);
174
  $product = $product_model->load($product_model->getIdBySku($sku));
175
+ if(!empty($sku) && !$product->getId()) {
176
  $sku = (string) $lengow_product->sku;
177
  $sku = str_replace('\_', '_', $sku);
178
  $product = $product_model->load($sku);
179
+ if(!empty($sku) && !$product->getId()) {
180
  $sku = (string) $lengow_product->idMP;
181
  $sku = str_replace('\_', '_', $sku);
182
  $product = $product_model->load($sku);
183
+ if(!empty($sku) && !$product->getId()) {
184
  $sku = (string) $lengow_product->idLengow;
185
  $sku = str_replace('\_', '_', $sku);
186
  $product = $product_model->load($sku);
187
+ if(!empty($sku) && !$product->getId()) {
188
  Mage::helper('sync')->log('Order ' . $order_id . ' : Product ' . (string) $lengow_product->sku . ' doesn\'t exist');
189
  return false;
190
  }
206
  $title_from_lengow = $this->getConfig()->setStore($quote->getStore()->getStoreId())->get('orders/title');
207
  if($title_from_lengow)
208
  $quote_item->setName((string) $lengow_product->title);
209
+ $quote->addItem($quote_item);
210
  return $quote;
211
  }
212
+
213
  /**
214
  * Create order
215
+ *
216
  * @param Mage_Sales_Model_Quote
217
+ * @return Mage_Sales_Model_Order
218
  */
219
+ public function makeOrder(SimpleXMLelement $data, Mage_Sales_Model_Quote $quote, $invoice = true) {
220
+ try {
221
+ $order = false;
222
  $store = $quote->getStore();
223
+ $grand_total = 0;
224
  if (!Mage::helper('tax')->priceIncludesTax($store)) {
225
  $grand_total = $quote->getGrandTotal();
226
  }
236
  'total_paid_lengow' => (float) $data->order_amount ,
237
  'carrier_lengow' => (string) $data->tracking_informations->tracking_carrier ,
238
  'carrier_method_lengow' => (string) $data->tracking_informations->tracking_method ,
239
+ 'global_currency_code' => (string) $data->order_currency ,
240
+ 'base_currency_code' => (string) $data->order_currency ,
241
+ 'store_currency_code' => (string) $data->order_currency ,
242
+ 'order_currency_code' => (string) $data->order_currency ,
243
  );
244
  $service = Mage::getModel('sales/service_quote', $quote);
245
  $service->setOrderData($additional_data);
246
  $order = false;
247
+ if(method_exists($service, 'submitAll')) {
248
  $service->submitAll();
249
  $order = $service->getOrder();
250
  } else {
251
  $order = $service->submit();
252
  }
253
+ $order->setIsFromLengow(true)
254
+ ->save();
255
  // Re-ajuste cents
256
+ // Conversion Tax Include > Tax Exclude > Tax Include maybe make 0.01 amount error
257
  if (!Mage::helper('tax')->priceIncludesTax($store)) {
258
 
259
  if($order->getBaseShippingInclTax() != (float) $data->order_shipping) {
267
  }
268
  $order->save();
269
  }
270
+ if($invoice)
271
+ $order = $this->toInvoice($order);
272
  // FIX fields amount & taxes
273
  $products = Mage::getResourceModel('sales/order_item_collection')
274
+ ->setOrderFilter($order->getId());
275
  foreach($products as $product) {
276
  $product->setBaseOriginalPrice($product->getOriginalPrice());
277
  $product->setBaseTaxAmount($product->getTaxAmount());
289
  $order->save();
290
  } catch (Exception $e){
291
  Mage::helper('sync')->log('Error create order : ' . $e->getMessage());
292
+ }
293
+ return $order;
294
  }
295
+
296
  /**
297
  * Create invoice
298
+ *
299
  * @param Mage_Sales_Model_Order
300
  * @return Lengow_Sync_Model_Order
301
  */
311
  $transactionSave->save();
312
  $this->_hasInvoices = true;
313
  }
314
+ }
315
  return $order;
316
  }
317
+
318
  /**
319
  * Ship order
320
  *
322
  * @return Lengow_Sync_Model_Order
323
  */
324
  public function toShip($order, $carrier = null, $title = '', $tracking = '') {
325
+ if($order->canShip()) {
326
  $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment();
327
  if($shipment) {
328
  $shipment->register();
333
  $transactionSave->save();
334
  $this->_hasShipments = true;
335
  // Add tracking information
336
+ if($tracking) {
337
+ $shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipment->getIncrementId());
338
+ $track = Mage::getModel('sales/order_shipment_track')
339
+ ->setNumber($tracking)
340
+ ->setCarrierCode($carrier)
341
+ ->setTitle($title);
342
+ $shipment->addTrack($track);
343
+ }
344
+ try {
345
+ $shipment->save();
346
+ $track->save();
347
+ } catch (Mage_Core_Exception $e) {
348
+ Mage::helper('sync')->log('Error create shipment : ' . $e->getMessage());
349
+ }
350
+ /*$ship = Mage::getModel('sales/order_shipment_api')
351
+ ->addTrack($shipment->getIncrementId() ,
352
  $carrier ,
353
  $title ,
354
+ $tracking); */
355
  }
356
+ }
357
  return $this;
358
  }
359
+
360
  /**
361
  * Cancel order
362
  *
368
  $order->cancel();
369
  $this->_isCanceled = true;
370
  }
371
+
372
  return $this;
373
  }
374
+
375
  /**
376
  * Refund order
377
  *
380
  */
381
  public function toRefund(Lengow_Sync_Model_Order $order) {
382
  if($this->_canRefund && $order->canCreditmemo()) {
383
+ $invoice_id = $order->getInvoiceCollection()->getFirstItem()->getId();
384
  if(!$invoice_id) {
385
+ return $this;
386
+ }
387
  $invoice = Mage::getModel('sales/order_invoice')->load($invoice_id)->setOrder($order);
388
  $service = Mage::getModel('sales/service_order', $order);
389
+ $creditmemo = $service->prepareInvoiceCreditmemo($invoice);
390
  $backToStock = array();
391
  foreach($order->getAllItems() as $item) {
392
  $backToStock[$item->getId()] = true;
393
+ }
394
  // Process back to stock flags
395
  foreach ($creditmemo->getAllItems() as $creditmemoItem) {
396
  $orderItem = $creditmemoItem->getOrderItem();
400
  } else {
401
  $creditmemoItem->setBackToStock(false);
402
  }
403
+ }
404
+ $creditmemo->register();
405
  $transactionSave = Mage::getModel('core/resource_transaction')
406
  ->addObject($creditmemo)
407
  ->addObject($creditmemo->getOrder());
410
  }
411
  $transactionSave->save();
412
  $this->_isRefunded = true;
413
+ }
414
  return $this;
415
  }
416
+
417
  /**
418
  * Retrieve country id based on country name
419
+ *
420
  * @param string $country_name
421
  * @return string
422
  */
app/code/community/Lengow/Sync/Model/Payment/.DS_Store DELETED
Binary file
app/code/community/Lengow/Sync/Model/Payment/Method/Lengow.php CHANGED
@@ -5,12 +5,12 @@
5
  * @category Lengow
6
  * @package Lengow_Sync
7
  * @author Ludovic Drin <ludovic@lengow.com>
8
- * @copyright 2013 Lengow SAS
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Lengow_Sync_Model_Payment_Method_Lengow extends Mage_Payment_Model_Method_Abstract {
12
-
13
- protected $_code = 'lengow';
14
  protected $_infoBlockType = 'sync/payment_info_purchaseorder';
15
 
16
  /**
@@ -27,14 +27,14 @@ class Lengow_Sync_Model_Payment_Method_Lengow extends Mage_Payment_Model_Method_
27
  return $this;
28
  }
29
 
30
- /**
31
  * Check whether payment method can be used
32
  * @param Mage_Sales_Model_Quote
33
  * @return bool
34
  */
35
  public function isAvailable($quote = null) {
36
  if(Mage::getSingleton('checkout/session')->getIsFromlengow())
37
- return true;
38
  return false;
39
- }
40
  }
5
  * @category Lengow
6
  * @package Lengow_Sync
7
  * @author Ludovic Drin <ludovic@lengow.com>
8
+ * @copyright 2013 Lengow SAS
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Lengow_Sync_Model_Payment_Method_Lengow extends Mage_Payment_Model_Method_Abstract {
12
+
13
+ protected $_code = 'lengow';
14
  protected $_infoBlockType = 'sync/payment_info_purchaseorder';
15
 
16
  /**
27
  return $this;
28
  }
29
 
30
+ /**
31
  * Check whether payment method can be used
32
  * @param Mage_Sales_Model_Quote
33
  * @return bool
34
  */
35
  public function isAvailable($quote = null) {
36
  if(Mage::getSingleton('checkout/session')->getIsFromlengow())
37
+ return true;
38
  return false;
39
+ }
40
  }
app/code/community/Lengow/Sync/controllers/.DS_Store DELETED
Binary file
app/code/community/Lengow/Sync/controllers/Adminhtml/.DS_Store DELETED
Binary file
app/code/community/Lengow/Sync/controllers/Adminhtml/Lengow/OrderController.php CHANGED
@@ -50,24 +50,87 @@ class Lengow_Sync_Adminhtml_Lengow_OrderController extends Mage_Adminhtml_Contro
50
  }
51
 
52
  public function importAction() {
53
- try {
54
- $days = Mage::getModel('sync/config')->setStore(Mage::app()->getStore()->getId())
55
- ->getConfig('sync/orders/period');
56
- $date_from = date('Y-m-d', strtotime(date('Y-m-d') . '-' . $days . 'days'));
57
- $date_to = date('Y-m-d');
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  $import = Mage::getModel('sync/import');
59
- $result = $import->exec('orders', array('dateFrom' => $date_from,
60
- 'dateTo' => $date_to));
61
- if($result['new'] > 0)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  $this->_getSession()->addSuccess(Mage::helper('sync')->__('%d orders are imported', $result['new']));
63
- if($result['update'] > 0)
64
  $this->_getSession()->addSuccess(Mage::helper('sync')->__('%d orders are updated', $result['update']));
65
- if($result['new'] == 0 && $result['update'] == 0)
66
  $this->_getSession()->addSuccess(Mage::helper('sync')->__('No order available to import'));
67
- } catch(Exception $e) {
68
- $this->_getSession()->addError($e->getMessage());
69
- }
70
- $this->_redirect("*/*/index");
 
 
 
71
  }
72
 
73
  }
50
  }
51
 
52
  public function importAction() {
53
+ //if(!Mage::getSingleton('sync/config')->importCanStart()) {
54
+ // Mage::helper('sync/data')->log('##Error manuel import : import is already started##');
55
+ // $this->_getSession()->addError(Mage::helper('sync')->__('Import is already started'));
56
+ // $this->_redirect('*/*/index');
57
+ //} else {
58
+ Mage::helper('sync/data')->log('##Start manual import##');
59
+ $_force_update = $this->getRequest()->getParam('update');
60
+ $_default_store = Mage::getModel('core/store')->load(Mage::app()
61
+ ->getWebsite(true)
62
+ ->getDefaultGroup()
63
+ ->getDefaultStoreId());
64
+ $_current_id_store = $_default_store->getId();
65
+ $_lengow_id_user_global = Mage::getModel('sync/config')->setStore($_current_id_store)->getConfig('tracker/general/login');
66
+ $_lengow_id_group_global = $this->_cleanGroup(Mage::getModel('sync/config')->setStore($_current_id_store)->getConfig('tracker/general/group'));
67
+ $result_new = 0;
68
+ $result_update = 0;
69
+ $result_new = 0;
70
+ $_default_is_imported = false;
71
  $import = Mage::getModel('sync/import');
72
+ $import->setForceUpdate($_force_update);
73
+ // Import default shop if configured
74
+ if($_lengow_id_user_global && $_lengow_id_group_global) {
75
+ try {
76
+ $_default_is_imported = true;
77
+ Mage::helper('sync/data')->log('Start manual import in store ' . $_default_store->getName() . '(' . $_default_store->getId() . ')');
78
+ $days = Mage::getModel('sync/config')->setStore($_default_store->getId())
79
+ ->getConfig('sync/orders/period');
80
+ $date_from = date('Y-m-d', strtotime(date('Y-m-d') . '-' . $days . 'days'));
81
+ $date_to = date('Y-m-d');
82
+ $result = $import->exec('orders', array('dateFrom' => $date_from,
83
+ 'dateTo' => $date_to,
84
+ 'id_store' => $_current_id_store));
85
+ $result_new = $result['new'];
86
+ $result_update = $result['update'];
87
+ } catch(Exception $e) {
88
+ $this->_getSession()->addError($e->getMessage());
89
+ Mage::helper('sync/data')->log('Error ' . $e->getMessage() . '');
90
+ }
91
+ }
92
+ $store_collection = Mage::getResourceModel('core/store_collection')
93
+ ->addFieldToFilter('is_active', 1);
94
+ // Import different view if is different
95
+ foreach($store_collection as $store) {
96
+ try {
97
+ $_lengow_id_user_current = Mage::getModel('sync/config')->setStore($store->getId())->getConfig('tracker/general/login');
98
+ $_lengow_id_group_current = $this->_cleanGroup(Mage::getModel('sync/config')->setStore($store->getId())->getConfig('tracker/general/group'));
99
+ if(($_lengow_id_user_current != $_lengow_id_user_global || $_lengow_id_group_current != $_lengow_id_group_global)
100
+ && $_lengow_id_user_current && $_lengow_id_group_current) {
101
+ if($store->getId() != $_current_id_store || !$_default_is_imported) {
102
+ Mage::helper('sync/data')->log('Start manual import in store ' . $store->getName() . '(' . $store->getId() . ')');
103
+ $days = Mage::getModel('sync/config')->setStore($store->getId())
104
+ ->getConfig('sync/orders/period');
105
+ $date_from = date('Y-m-d', strtotime(date('Y-m-d') . '-' . $days . 'days'));
106
+ $date_to = date('Y-m-d');
107
+ $import = Mage::getModel('sync/import');
108
+ $import->setForceUpdate($_force_update);
109
+ $result = $import->exec('orders', array('dateFrom' => $date_from,
110
+ 'dateTo' => $date_to,
111
+ 'id_store' => $store->getId()));
112
+ $result_new += $result['new'];
113
+ $result_update += $result['update'];
114
+ }
115
+ }
116
+ } catch(Exception $e) {
117
+ $this->_getSession()->addError($e->getMessage());
118
+ Mage::helper('sync/data')->log('Error ' . $e->getMessage() . '');
119
+ }
120
+ }
121
+ if($result_new > 0)
122
  $this->_getSession()->addSuccess(Mage::helper('sync')->__('%d orders are imported', $result['new']));
123
+ if($result_update > 0)
124
  $this->_getSession()->addSuccess(Mage::helper('sync')->__('%d orders are updated', $result['update']));
125
+ if($result_new == 0 && $result_update == 0)
126
  $this->_getSession()->addSuccess(Mage::helper('sync')->__('No order available to import'));
127
+ Mage::helper('sync/data')->log('##End manual import##');
128
+ $this->_redirect('*/*/index');
129
+ //}
130
+ }
131
+
132
+ private function _cleanGroup($data) {
133
+ return trim(str_replace(array("\r\n", ';', '-', '|', ' '), ';', $data), ',');
134
  }
135
 
136
  }
app/code/community/Lengow/Sync/controllers/ApiController.php CHANGED
@@ -14,27 +14,16 @@ class Lengow_Sync_ApiController extends Mage_Core_Controller_Front_Action {
14
  echo 'Please specify an action';
15
  }
16
 
17
- public function taxAction() {
18
- $helper = Mage::helper('export/security');
19
- if($helper->checkIp()) {
20
- $id_order = $this->getRequest()->getParam('id');
21
- $new_tax = $this->getRequest()->getParam('rate');
22
- if($order = Mage::getModel('sales/order')->load($id_order)) {
23
- if($order->hasFromLengow()) {
24
- $this->_rebuildOrder($order);
25
- }
26
- } else {
27
- echo 'Order not find';
28
- }
29
  } else {
30
  echo 'Unauthorised ip : ' . $_SERVER['REMOTE_ADDR'];
31
  }
32
  }
33
 
34
- private function _rebuildOrder($order) {
35
- }
36
-
37
- private function _rebuildInvoice($order) {
38
-
39
- }
40
  }
14
  echo 'Please specify an action';
15
  }
16
 
17
+ public function checkAction() {
18
+ $_helper_export = Mage::helper('export/security');
19
+ $_helper_api = Mage::helper('sync/api');
20
+ if($_helper_export->checkIp()) {
21
+ $return = array('magento_version' => Mage::getVersion(),
22
+ 'lengow_version' => $_helper_api->getVersion());
23
+ echo Mage::helper('core')->jsonEncode($return);
 
 
 
 
 
24
  } else {
25
  echo 'Unauthorised ip : ' . $_SERVER['REMOTE_ADDR'];
26
  }
27
  }
28
 
 
 
 
 
 
 
29
  }
app/code/community/Lengow/Sync/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Lengow_Sync>
5
- <version>2.0.1.3</version>
6
  </Lengow_Sync>
7
  </modules>
8
  <admin>
@@ -11,7 +11,7 @@
11
  <use>admin</use>
12
  <args>
13
  <module>Lengow_Sync</module>
14
- <frontName>lengows</frontName>
15
  </args>
16
  </sync>
17
  <adminhtml>
@@ -236,6 +236,8 @@
236
  <orders>
237
  <period>3</period>
238
  <customer_group>0</customer_group>
 
 
239
  </orders>
240
  <hidden>
241
  <last_synchro>0000-00-00</last_synchro>
2
  <config>
3
  <modules>
4
  <Lengow_Sync>
5
+ <version>2.0.1.5</version>
6
  </Lengow_Sync>
7
  </modules>
8
  <admin>
11
  <use>admin</use>
12
  <args>
13
  <module>Lengow_Sync</module>
14
+ <frontName>lengow</frontName>
15
  </args>
16
  </sync>
17
  <adminhtml>
236
  <orders>
237
  <period>3</period>
238
  <customer_group>0</customer_group>
239
+ <pending>0</pending>
240
+ <processing_fee>1</processing_fee>
241
  </orders>
242
  <hidden>
243
  <last_synchro>0000-00-00</last_synchro>
app/code/community/Lengow/Sync/etc/marketplaces.xml CHANGED
@@ -134,6 +134,9 @@
134
  <state name="CLOSED">
135
  <lengow>shipped</lengow>
136
  </state>
 
 
 
137
  </states>
138
  <additional_params>
139
  <param usedby="shipped">
@@ -154,7 +157,7 @@
154
  <value>GLS</value>
155
  <value>DHL</value>
156
  <value>Courrier Suivi</value>
157
- </accepted_values>
158
  </param>
159
  </additional_params>
160
  </marketplace>
@@ -202,11 +205,11 @@
202
  </state>
203
  </states>
204
  <additional_params>
205
- <param usedby="shipped">
206
  <type>tracking</type>
207
  <name>colis_idTracking</name>
208
  </param>
209
- <param usedby="shipped">
210
  <type>carrier</type>
211
  <name>transporteur</name>
212
  </param>
@@ -218,6 +221,9 @@
218
  <state name="New">
219
  <lengow>new</lengow>
220
  </state>
 
 
 
221
  <state name="ToShip">
222
  <actions>
223
  <action type="shipped">shippedOrder</action>
@@ -227,7 +233,36 @@
227
  <state name="Shipped">
228
  <lengow>shipped</lengow>
229
  </state>
 
 
 
 
 
 
230
  </states>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  <additional_params>
232
  <param usedby="shipped">
233
  <type>tracking</type>
@@ -238,7 +273,7 @@
238
  <marketplace name="cdiscount">
239
  <api>https://wsdl.lengow.com/wsdl/cdiscount/#ID_FLUX#/#ORDER_ID#/#ACTION#.xml</api>
240
  <states>
241
- <state name="WaintingForSellerAcceptation">
242
  <actions>
243
  <action type="accept">acceptOrder</action>
244
  <action type="refuse">refuseOrder</action>
@@ -282,23 +317,32 @@
282
  <state name="AutomaticCancellation">
283
  <lengow>canceled</lengow>
284
  </state>
 
 
 
 
 
 
 
 
 
285
  <state name="RefusedBySeller">
286
  <lengow>canceled</lengow>
287
  </state>
288
  <state name="PickedUp">
289
  <lengow>shipped</lengow>
290
- </state>
291
  </states>
292
  <additional_params>
293
- <param usedby="shipped">
294
  <type>tracking</type>
295
  <name>TrackingColis</name>
296
  </param>
297
- <param usedby="shipped">
298
  <type>carrier</type>
299
  <name>Transporteur</name>
300
  <accepted_values>
301
- <value label="La Poste">LAPOSTE</value>
302
  <value label="DHL">DHL</value>
303
  <value label="Fedex">FEDEX</value>
304
  <value label="GLS">GLS</value>
@@ -529,7 +573,7 @@
529
  <states>
530
  <state name="new">
531
  <lengow>new</lengow>
532
- </state>
533
  <state name="processing">
534
  <actions>
535
  <action type="refuse">refuseOrder</action>
@@ -576,7 +620,7 @@
576
  <marketplace name="pixplace">
577
  <states>
578
  <state name="accepted">
579
- <lengow>shipped</lengow>
580
  </state>
581
  <state name="processing">
582
  <lengow>processing</lengow>
@@ -638,7 +682,7 @@
638
  <name>TrackingColis</name>
639
  </param>
640
  </additional_params>
641
- </marketplace>
642
  <marketplace name="leoo">
643
  <states>
644
  <state name="Confirmé">
@@ -682,7 +726,7 @@
682
  <name>Transporteur</name>
683
  </param>
684
  </additional_params>
685
- </marketplace>
686
  <marketplace name="ecopresto">
687
  <api>https://wsdl.lengow.com/wsdl/ecopresto/#ID_FLUX#/#ORDER_ID#/#ACTION#.xml</api>
688
  <states>
@@ -691,7 +735,7 @@
691
  </state>
692
  <state name="processing">
693
  <actions>
694
- <action type="shipped">shipped</action>
695
  </actions>
696
  <lengow>processing</lengow>
697
  </state>
@@ -717,7 +761,7 @@
717
  </accepted_values>
718
  </param>
719
  </additional_params>
720
- </marketplace>
721
  <marketplace name="ecitizen">
722
  <states>
723
  <state name="processing">
@@ -728,7 +772,7 @@
728
  </state>
729
  </states>
730
  </marketplace>
731
- <marketplace name="godsavethekid">
732
  <states>
733
  <state name="RECEIVED">
734
  <lengow>new</lengow>
@@ -768,4 +812,212 @@
768
  </state>
769
  </states>
770
  </marketplace>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
771
  </marketplaces>
134
  <state name="CLOSED">
135
  <lengow>shipped</lengow>
136
  </state>
137
+ <state name="CANCELLED">
138
+ <lengow>canceled</lengow>
139
+ </state>
140
  </states>
141
  <additional_params>
142
  <param usedby="shipped">
157
  <value>GLS</value>
158
  <value>DHL</value>
159
  <value>Courrier Suivi</value>
160
+ </accepted_values>
161
  </param>
162
  </additional_params>
163
  </marketplace>
205
  </state>
206
  </states>
207
  <additional_params>
208
+ <param usedby="shipped" require="carrier">
209
  <type>tracking</type>
210
  <name>colis_idTracking</name>
211
  </param>
212
+ <param usedby="shipped" require="tracking">
213
  <type>carrier</type>
214
  <name>transporteur</name>
215
  </param>
221
  <state name="New">
222
  <lengow>new</lengow>
223
  </state>
224
+ <state name="new">
225
+ <lengow>new</lengow>
226
+ </state>
227
  <state name="ToShip">
228
  <actions>
229
  <action type="shipped">shippedOrder</action>
233
  <state name="Shipped">
234
  <lengow>shipped</lengow>
235
  </state>
236
+ <state name="Completed">
237
+ <lengow>shipped</lengow>
238
+ </state>
239
+ <state name="Cancelled">
240
+ <lengow>canceled</lengow>
241
+ </state>
242
  </states>
243
+ <payments>
244
+ <payment name="NoPaymentFailure">
245
+ <lengow>complete</lengow>
246
+ </payment>
247
+ <payment name="PayPalPaymentInProcess">
248
+ <lengow>pending</lengow>
249
+ </payment>
250
+ <payment name="PayPalPaymentInProcess">
251
+ <lengow>pending</lengow>
252
+ </payment>
253
+ <payment name="MoneyXferAcceptedInCheckout">
254
+ <lengow>pending</lengow>
255
+ </payment>
256
+ <payment name="Complete">
257
+ <lengow>complete</lengow>
258
+ </payment>
259
+ <payment name="Incomplete">
260
+ <lengow>pending</lengow>
261
+ </payment>
262
+ <payment name="PaymentInProcess">
263
+ <lengow>pending</lengow>
264
+ </payment>
265
+ </payments>
266
  <additional_params>
267
  <param usedby="shipped">
268
  <type>tracking</type>
273
  <marketplace name="cdiscount">
274
  <api>https://wsdl.lengow.com/wsdl/cdiscount/#ID_FLUX#/#ORDER_ID#/#ACTION#.xml</api>
275
  <states>
276
+ <state name="WaitingForSellerAcceptation">
277
  <actions>
278
  <action type="accept">acceptOrder</action>
279
  <action type="refuse">refuseOrder</action>
317
  <state name="AutomaticCancellation">
318
  <lengow>canceled</lengow>
319
  </state>
320
+ <state name="CancelledBeforePaymentByCustomer">
321
+ <lengow>canceled</lengow>
322
+ </state>
323
+ <state name="CancelledBeforeNotificationByCustomer">
324
+ <lengow>canceled</lengow>
325
+ </state>
326
+ <state name="CancellationRequestPending">
327
+ <lengow>canceled</lengow>
328
+ </state>
329
  <state name="RefusedBySeller">
330
  <lengow>canceled</lengow>
331
  </state>
332
  <state name="PickedUp">
333
  <lengow>shipped</lengow>
334
+ </state>
335
  </states>
336
  <additional_params>
337
+ <param usedby="shipped" require="carrier">
338
  <type>tracking</type>
339
  <name>TrackingColis</name>
340
  </param>
341
+ <param usedby="shipped" require="tracking">
342
  <type>carrier</type>
343
  <name>Transporteur</name>
344
  <accepted_values>
345
+ <value label="La Poste" default="true">LAPOSTE</value>
346
  <value label="DHL">DHL</value>
347
  <value label="Fedex">FEDEX</value>
348
  <value label="GLS">GLS</value>
573
  <states>
574
  <state name="new">
575
  <lengow>new</lengow>
576
+ </state>
577
  <state name="processing">
578
  <actions>
579
  <action type="refuse">refuseOrder</action>
620
  <marketplace name="pixplace">
621
  <states>
622
  <state name="accepted">
623
+ <lengow>processing</lengow>
624
  </state>
625
  <state name="processing">
626
  <lengow>processing</lengow>
682
  <name>TrackingColis</name>
683
  </param>
684
  </additional_params>
685
+ </marketplace>
686
  <marketplace name="leoo">
687
  <states>
688
  <state name="Confirmé">
726
  <name>Transporteur</name>
727
  </param>
728
  </additional_params>
729
+ </marketplace>
730
  <marketplace name="ecopresto">
731
  <api>https://wsdl.lengow.com/wsdl/ecopresto/#ID_FLUX#/#ORDER_ID#/#ACTION#.xml</api>
732
  <states>
735
  </state>
736
  <state name="processing">
737
  <actions>
738
+ <action type="shipped">setTracking</action>
739
  </actions>
740
  <lengow>processing</lengow>
741
  </state>
761
  </accepted_values>
762
  </param>
763
  </additional_params>
764
+ </marketplace>
765
  <marketplace name="ecitizen">
766
  <states>
767
  <state name="processing">
772
  </state>
773
  </states>
774
  </marketplace>
775
+ <marketplace name="godsavethekids">
776
  <states>
777
  <state name="RECEIVED">
778
  <lengow>new</lengow>
812
  </state>
813
  </states>
814
  </marketplace>
815
+ <marketplace name="mistergooddeal">
816
+ <api>https://wsdl.lengow.com/wsdl/mistergooddeal/#ID_FLUX#/#ORDER_ID#/#ACTION#.xml</api>
817
+ <states>
818
+ <state name="RECEIVED">
819
+ <lengow>new</lengow>
820
+ </state>
821
+ <state name="STAGING">
822
+ <lengow>new</lengow>
823
+ </state>
824
+ <state name="WAITING_ACCEPTANCE">
825
+ <lengow>new</lengow>
826
+ <actions>
827
+ <action type="accept">accept</action>
828
+ <action type="refuse">canceled</action>
829
+ </actions>
830
+ </state>
831
+ <state name="WAITING_DEBIT">
832
+ <lengow>new</lengow>
833
+ </state>
834
+ <state name="WAITING_DEBIT_PAYMENT">
835
+ <lengow>new</lengow>
836
+ </state>
837
+ <state name="SHIPPING">
838
+ <lengow>processing</lengow>
839
+ <actions>
840
+ <action type="shipped">shipped</action>
841
+ </actions>
842
+ </state>
843
+ <state name="RECEIVED">
844
+ <lengow>shipped</lengow>
845
+ </state>
846
+ <state name="SHIPPED">
847
+ <lengow>shipped</lengow>
848
+ </state>
849
+ <state name="CANCELED">
850
+ <lengow>canceled</lengow>
851
+ </state>
852
+ <state name="CLOSED">
853
+ <lengow>shipped</lengow>
854
+ </state>
855
+ <state name="REFUSED">
856
+ <lengow>canceled</lengow>
857
+ </state>
858
+ <state name="INCIDENT_OPEN">
859
+ <lengow>processing</lengow>
860
+ </state>
861
+ <state name="INCIDENT_CLOSED">
862
+ <lengow>processing</lengow>
863
+ </state>
864
+ <state name="WAITING_REFUND">
865
+ <lengow>processing</lengow>
866
+ </state>
867
+ <state name="WAITING_REFUND_PAYMENT">
868
+ <lengow>processing</lengow>
869
+ </state>
870
+ <state name="REFUNDED">
871
+ <lengow>canceled</lengow>
872
+ </state>
873
+ </states>
874
+ </marketplace>
875
+ <marketplace name="rakuten_de">
876
+ <api>https://wsdl.lengow.com/wsdl/rakutende/#ID_FLUX#/#ORDER_ID#/#ACTION#.xml</api>
877
+ <states>
878
+ <state name="pending">
879
+ <lengow>new</lengow>
880
+ </state>
881
+ <state name="editable">
882
+ <lengow>processing</lengow>
883
+ <actions>
884
+ <action type="shipped">shipped</action>
885
+ </actions>
886
+ </state>
887
+ <state name="shipped">
888
+ <lengow>shipped</lengow>
889
+ </state>
890
+ <state name="payout">
891
+ <lengow>shipped</lengow>
892
+ </state>
893
+ <state name="cancelled">
894
+ <lengow>canceled</lengow>
895
+ </state>
896
+ </states>
897
+ </marketplace>
898
+ <marketplace name="spartoo">
899
+ <api>https://wsdl.lengow.com/wsdl/spartoo/#ID_FLUX#/#ORDER_ID#/#ACTION#.xml</api>
900
+ <states>
901
+ <state name="0">
902
+ <lengow>new</lengow>
903
+ </state>
904
+ <state name="1">
905
+ <actions>
906
+ <action type="accept">processing</action>
907
+ <action type="cancel">canceled</action>
908
+ <action type="refund">refund</action>
909
+ </actions>
910
+ <lengow>new</lengow>
911
+ </state>
912
+ <state name="11">
913
+ <lengow>new</lengow>
914
+ <actions>
915
+ <action type="accept">processing</action>
916
+ <action type="cancel">canceled</action>
917
+ <action type="refund">refund</action>
918
+ </actions>
919
+ </state>
920
+ <state name="2">
921
+ <actions>
922
+ <action type="shipped" method="post">shipped</action>
923
+ <action type="cancel">canceled</action>
924
+ <action type="refund">refund</action>
925
+ </actions>
926
+ <lengow>processing</lengow>
927
+ </state>
928
+ <state name="3">
929
+ <lengow>shipped</lengow>
930
+ </state>
931
+ <state name="4">
932
+ <lengow>canceled</lengow>
933
+ </state>
934
+ <state name="41">
935
+ <lengow>canceled</lengow>
936
+ </state>
937
+ </states>
938
+ <additional_params>
939
+ <param usedby="shipped">
940
+ <type>tracking</type>
941
+ <name>tracking_number</name>
942
+ </param>
943
+ </additional_params>
944
+ </marketplace>
945
+ <marketplace name="zalando">
946
+ <api>http://wsdl.lengow.com/wsdl/zalando/#ID_FLUX#/#ORDER_ID#/#ACTION#.xml</api>
947
+ <states>
948
+ <state name="New">
949
+ <lengow>new</lengow>
950
+ </state>
951
+ <state name="Approved">
952
+ <actions>
953
+ <action type="shipped" method="post">SHIPPED</action>
954
+ <action type="cancel" method="post">ZALANDO_CANCELED</action>
955
+ <action type="refund" method="post">NO_INVENTORY_CANCELED</action>
956
+ </actions>
957
+ <lengow>processing</lengow>
958
+ </state>
959
+ <state name="Shipped">
960
+ <actions>
961
+ <action type="returned" method="post">RETURNED</action>
962
+ </actions>
963
+ <lengow>shipped</lengow>
964
+ </state>
965
+ <state name="Returned">
966
+ <lengow>canceled</lengow>
967
+ </state>
968
+ <state name="canceled">
969
+ <lengow>canceled</lengow>
970
+ </state>
971
+ </states>
972
+ <additional_params>
973
+ <param usedby="shipped cancel refund returned">
974
+ <type>client_token</type>
975
+ <name>token</name>
976
+ </param>
977
+ <param usedby="shipped cancel refund returned">
978
+ <type>action</type>
979
+ <name>action</name>
980
+ </param>
981
+ <param usedby="shipped cancel refund returned">
982
+ <type>sku</type>
983
+ <name>sku</name>
984
+ </param>
985
+ <param usedby="shipped cancel refund returned">
986
+ <type>quantity</type>
987
+ <name>quantity</name>
988
+ </param>
989
+ <param usedby="shipped cancel refund returned">
990
+ <type>line</type>
991
+ <name>line</name>
992
+ </param>
993
+ <param usedby="shipped">
994
+ <type>tracking</type>
995
+ <name>trackingNumber</name>
996
+ </param>
997
+ <param usedby="shipped">
998
+ <type>return_tracking</type>
999
+ <name>returnTrackingNumber</name>
1000
+ </param>
1001
+ <param usedby="returned">
1002
+ <type>return_code</type>
1003
+ <name>returnReasonCode</name>
1004
+ </param>
1005
+ </additional_params>
1006
+ </marketplace>
1007
+ <marketplace name="placedumariage">
1008
+ <states>
1009
+ <state name="partielle">
1010
+ <lengow>new</lengow>
1011
+ </state>
1012
+ <state name="complète">
1013
+ <lengow>new</lengow>
1014
+ </state>
1015
+ <state name="expédiée">
1016
+ <lengow>shipped</lengow>
1017
+ </state>
1018
+ <state name="annulée">
1019
+ <lengow>canceled</lengow>
1020
+ </state>
1021
+ </states>
1022
+ </marketplace>
1023
  </marketplaces>
app/code/community/Lengow/Sync/etc/system.xml CHANGED
@@ -27,8 +27,8 @@
27
  <label>Import orders from x days</label>
28
  <sort_order>20</sort_order>
29
  <show_in_default>1</show_in_default>
30
- <show_in_website>1</show_in_website>
31
- <show_in_store>1</show_in_store>
32
  <comment>Choose period for Sync order</comment>
33
  </period>
34
  <customer_group>
@@ -36,8 +36,8 @@
36
  <frontend_type>select</frontend_type>
37
  <sort_order>30</sort_order>
38
  <show_in_default>1</show_in_default>
39
- <show_in_website>1</show_in_website>
40
- <show_in_store>1</show_in_store>
41
  <source_model>sync/system_config_source_customer_group</source_model>
42
  </customer_group>
43
  <date_import>
@@ -45,8 +45,8 @@
45
  <frontend_type>select</frontend_type>
46
  <sort_order>40</sort_order>
47
  <show_in_default>1</show_in_default>
48
- <show_in_website>1</show_in_website>
49
- <show_in_store>1</show_in_store>
50
  <source_model>adminhtml/system_config_source_yesno</source_model>
51
  <comment>To change the date of import's order with the date of marketplace</comment>
52
  </date_import>
@@ -55,8 +55,8 @@
55
  <frontend_type>select</frontend_type>
56
  <sort_order>40</sort_order>
57
  <show_in_default>1</show_in_default>
58
- <show_in_website>1</show_in_website>
59
- <show_in_store>1</show_in_store>
60
  <source_model>adminhtml/system_config_source_yesno</source_model>
61
  <comment>Enable import every 30 minutes</comment>
62
  </cron>
@@ -66,17 +66,37 @@
66
  <frontend_type>select</frontend_type>
67
  <sort_order>50</sort_order>
68
  <show_in_default>1</show_in_default>
69
- <show_in_website>1</show_in_website>
70
- <show_in_store>1</show_in_store>
71
  <source_model>adminhtml/system_config_source_yesno</source_model>
72
  </title>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  <debug>
74
  <label>Debug mode</label>
75
  <frontend_type>select</frontend_type>
76
  <sort_order>60</sort_order>
77
  <show_in_default>1</show_in_default>
78
- <show_in_website>1</show_in_website>
79
- <show_in_store>1</show_in_store>
80
  <source_model>adminhtml/system_config_source_yesno</source_model>
81
  <comment>Only for preproduction's mode : no sync orders with Lengow, import orders every time</comment>
82
  </debug>
27
  <label>Import orders from x days</label>
28
  <sort_order>20</sort_order>
29
  <show_in_default>1</show_in_default>
30
+ <show_in_website>0</show_in_website>
31
+ <show_in_store>0</show_in_store>
32
  <comment>Choose period for Sync order</comment>
33
  </period>
34
  <customer_group>
36
  <frontend_type>select</frontend_type>
37
  <sort_order>30</sort_order>
38
  <show_in_default>1</show_in_default>
39
+ <show_in_website>0</show_in_website>
40
+ <show_in_store>0</show_in_store>
41
  <source_model>sync/system_config_source_customer_group</source_model>
42
  </customer_group>
43
  <date_import>
45
  <frontend_type>select</frontend_type>
46
  <sort_order>40</sort_order>
47
  <show_in_default>1</show_in_default>
48
+ <show_in_website>0</show_in_website>
49
+ <show_in_store>0</show_in_store>
50
  <source_model>adminhtml/system_config_source_yesno</source_model>
51
  <comment>To change the date of import's order with the date of marketplace</comment>
52
  </date_import>
55
  <frontend_type>select</frontend_type>
56
  <sort_order>40</sort_order>
57
  <show_in_default>1</show_in_default>
58
+ <show_in_website>0</show_in_website>
59
+ <show_in_store>0</show_in_store>
60
  <source_model>adminhtml/system_config_source_yesno</source_model>
61
  <comment>Enable import every 30 minutes</comment>
62
  </cron>
66
  <frontend_type>select</frontend_type>
67
  <sort_order>50</sort_order>
68
  <show_in_default>1</show_in_default>
69
+ <show_in_website>0</show_in_website>
70
+ <show_in_store>0</show_in_store>
71
  <source_model>adminhtml/system_config_source_yesno</source_model>
72
  </title>
73
+ <pending>
74
+ <label>Import order in pending payment</label>
75
+ <comment>Import an order in pendinf payment (like check or money order)</comment>
76
+ <frontend_type>select</frontend_type>
77
+ <sort_order>50</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>0</show_in_website>
80
+ <show_in_store>0</show_in_store>
81
+ <source_model>adminhtml/system_config_source_yesno</source_model>
82
+ </pending>
83
+ <processing_fee>
84
+ <label>Import processing fee from Marketplace</label>
85
+ <comment>Import the processing fee</comment>
86
+ <frontend_type>select</frontend_type>
87
+ <sort_order>50</sort_order>
88
+ <show_in_default>1</show_in_default>
89
+ <show_in_website>0</show_in_website>
90
+ <show_in_store>0</show_in_store>
91
+ <source_model>adminhtml/system_config_source_yesno</source_model>
92
+ </processing_fee>
93
  <debug>
94
  <label>Debug mode</label>
95
  <frontend_type>select</frontend_type>
96
  <sort_order>60</sort_order>
97
  <show_in_default>1</show_in_default>
98
+ <show_in_website>0</show_in_website>
99
+ <show_in_store>0</show_in_store>
100
  <source_model>adminhtml/system_config_source_yesno</source_model>
101
  <comment>Only for preproduction's mode : no sync orders with Lengow, import orders every time</comment>
102
  </debug>
app/code/community/Lengow/Sync/sql/lengow_setup/mysql4-install-2.0.0.0.php CHANGED
@@ -153,15 +153,14 @@ $installer = new Mage_Catalog_Model_Resource_Eav_Mysql4_Setup('core_setup');
153
 
154
  $entity_id = $installer->getEntityTypeId('catalog_product');
155
  $attribute = $installer->getAttribute($entity_id,'lengow_product');
156
-
157
- if(!$attribute)
158
  $installer->addAttribute('catalog_product', 'lengow_product', array(
159
  'type' => 'int',
160
  'backend' => '',
161
  'frontend' => '',
162
  'label' => 'Publish on Lengow',
163
  'input' => 'boolean',
164
- 'global' => 1,
165
  'visible' => 1,
166
  'required' => 0,
167
  'user_defined' => 1,
@@ -173,6 +172,10 @@ if(!$attribute)
173
  'unique' => 0,
174
  'used_in_product_listing' => 1
175
  ));
 
 
 
 
176
  // TODO use Mage ORM
177
  $installer->run(
178
  "CREATE TABLE IF NOT EXISTS `{$this->getTable('lengow_log')}` (
153
 
154
  $entity_id = $installer->getEntityTypeId('catalog_product');
155
  $attribute = $installer->getAttribute($entity_id,'lengow_product');
156
+ if(!$attribute) {
 
157
  $installer->addAttribute('catalog_product', 'lengow_product', array(
158
  'type' => 'int',
159
  'backend' => '',
160
  'frontend' => '',
161
  'label' => 'Publish on Lengow',
162
  'input' => 'boolean',
163
+ 'global' => 0,
164
  'visible' => 1,
165
  'required' => 0,
166
  'user_defined' => 1,
172
  'unique' => 0,
173
  'used_in_product_listing' => 1
174
  ));
175
+ } else {
176
+ // Update attribute
177
+ $attribute->setIsGlobal(0)->save();
178
+ }
179
  // TODO use Mage ORM
180
  $installer->run(
181
  "CREATE TABLE IF NOT EXISTS `{$this->getTable('lengow_log')}` (
app/code/community/Lengow/Tracker/Block/.DS_Store DELETED
Binary file
app/code/community/Lengow/Tracker/Block/Tag/Capsule.php CHANGED
@@ -76,7 +76,7 @@ class Lengow_Tracker_Block_Tag_Capsule extends Mage_Core_Block_Template {
76
 
77
  // Order id - Lead / Payment / Confirmation
78
  if (self::$_CURRENT_PAGE_TYPE == self::LENGOW_TRACK_PAGE_CONFIRMATION) {
79
- self::$_ID_ORDER = Mage::getSingleton('checkout/session')->getLastOrderId();
80
  }
81
 
82
  // Ids Products - Page / Listpage / Basket / Payment / Confirmation
@@ -139,7 +139,7 @@ class Lengow_Tracker_Block_Tag_Capsule extends Mage_Core_Block_Template {
139
  return '';
140
  }
141
 
142
- protected function _getCurrentProductsIds() {
143
  $config = Mage::getModel('tracker/config');
144
  $ids = array();
145
  $products = $this->_getProductCollection()->getData();
@@ -148,7 +148,7 @@ class Lengow_Tracker_Block_Tag_Capsule extends Mage_Core_Block_Template {
148
  $ids[] = $product[$config->get('tag/identifiant')];
149
  }
150
  }
151
- return implode('|', $ids);
152
  }
153
 
154
  /**
@@ -194,10 +194,24 @@ class Lengow_Tracker_Block_Tag_Capsule extends Mage_Core_Block_Template {
194
  $layer->setCurrentCategory($origCategory);
195
  }
196
  }
197
-
198
  return $this->_productCollection;
199
  }
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  /**
202
  * Get catalog layer model
203
  *
76
 
77
  // Order id - Lead / Payment / Confirmation
78
  if (self::$_CURRENT_PAGE_TYPE == self::LENGOW_TRACK_PAGE_CONFIRMATION) {
79
+ self::$_ID_ORDER = Mage::getSingleton('checkout/session')->getLastRealOrderId();
80
  }
81
 
82
  // Ids Products - Page / Listpage / Basket / Payment / Confirmation
139
  return '';
140
  }
141
 
142
+ protected function _getCurrentProductsIds($implode = true) {
143
  $config = Mage::getModel('tracker/config');
144
  $ids = array();
145
  $products = $this->_getProductCollection()->getData();
148
  $ids[] = $product[$config->get('tag/identifiant')];
149
  }
150
  }
151
+ return $implode ? implode('|', $ids) : $ids;
152
  }
153
 
154
  /**
194
  $layer->setCurrentCategory($origCategory);
195
  }
196
  }
 
197
  return $this->_productCollection;
198
  }
199
 
200
+ protected function _beforeToHtml() {
201
+ if(self::$_CURRENT_PAGE_TYPE == self::LENGOW_TRACK_PAGE_LIST) {
202
+ $config = Mage::getModel('tracker/config');
203
+ $_list = $this->getLayout()->getBlock('product_list');
204
+ $_products = $_list->getLoadedProductCollection();
205
+ if($_products) {
206
+ foreach ($_products as $product) {
207
+ $ids[] = $product[$config->get('tag/identifiant')];
208
+ }
209
+ }
210
+ $this->setData('ids_products', implode('|', $ids));
211
+ }
212
+ parent::_beforeToHtml();
213
+ }
214
+
215
  /**
216
  * Get catalog layer model
217
  *
app/code/community/Lengow/Tracker/Block/Tag/Simple.php CHANGED
@@ -11,17 +11,11 @@
11
  class Lengow_Tracker_Block_Tag_Simple extends Mage_Core_Block_Template {
12
 
13
  protected $_config_model;
14
- protected $_id_client;
15
- protected $_id_group;
16
- protected $_id_order;
17
- protected $_total_paid;
18
- protected $_mode_paiement;
19
- protected $_ids_products;
20
 
21
  public function __construct() {
22
  $this->_config_model = Mage::getSingleton('tracker/config');
23
- $this->_id_client = $this->_config_model->get('general/login');
24
- $this->_id_group = $this->_config_model->get('general/group');
25
  }
26
 
27
  protected function _prepareLayout() {
@@ -30,10 +24,10 @@ class Lengow_Tracker_Block_Tag_Simple extends Mage_Core_Block_Template {
30
  if(Mage::app()->getRequest()->getActionName() == 'success') {
31
  $order_id = Mage::getSingleton('checkout/session')->getLastOrderId();
32
  $order = Mage::getModel('sales/order')->load($order_id);
33
- $this->_mode_paiement = $order->getPayment()->getMethodInstance()->getCode();
34
- $this->_id_order = $order_id;
35
- $this->_total_paid = $order->getGrandTotal();
36
- $this->_ids_products = $tracker_model->getIdsProducts($order);
37
  $this->setTemplate('lengow/tracker/simpletag.phtml');
38
  }
39
  return $this;
11
  class Lengow_Tracker_Block_Tag_Simple extends Mage_Core_Block_Template {
12
 
13
  protected $_config_model;
 
 
 
 
 
 
14
 
15
  public function __construct() {
16
  $this->_config_model = Mage::getSingleton('tracker/config');
17
+ $this->setData('id_client', $this->_config_model->get('general/login'));
18
+ $this->setData('id_group', $this->_config_model->get('general/group'));
19
  }
20
 
21
  protected function _prepareLayout() {
24
  if(Mage::app()->getRequest()->getActionName() == 'success') {
25
  $order_id = Mage::getSingleton('checkout/session')->getLastOrderId();
26
  $order = Mage::getModel('sales/order')->load($order_id);
27
+ $this->setData('mode_paiement', $order->getPayment()->getMethodInstance()->getCode());
28
+ $this->setData('id_order', $order_id);
29
+ $this->setData('total_paid', $order->getGrandTotal());
30
+ $this->setData('ids_products', $tracker_model->getIdsProducts($order));
31
  $this->setTemplate('lengow/tracker/simpletag.phtml');
32
  }
33
  return $this;
app/code/community/Lengow/Tracker/etc/.DS_Store DELETED
Binary file
app/code/community/Lengow/Tracker/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Lengow_Tracker>
5
- <version>2.0.1.3</version>
6
  </Lengow_Tracker>
7
  </modules>
8
  <global>
@@ -54,15 +54,6 @@
54
  </routers>
55
  </admin>
56
  <frontend>
57
- <routers>
58
- <lengow>
59
- <use>standard</use>
60
- <args>
61
- <module>Lengow_Tracker</module>
62
- <frontName>lengow</frontName>
63
- </args>
64
- </lengow>
65
- </routers>
66
  <layout>
67
  <updates>
68
  <tracker>
2
  <config>
3
  <modules>
4
  <Lengow_Tracker>
5
+ <version>2.0.1.5</version>
6
  </Lengow_Tracker>
7
  </modules>
8
  <global>
54
  </routers>
55
  </admin>
56
  <frontend>
 
 
 
 
 
 
 
 
 
57
  <layout>
58
  <updates>
59
  <tracker>
app/code/community/Lengow/Tracker/etc/plugins.xml CHANGED
@@ -1,12 +1,12 @@
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
  <plugins>
3
  <plugin name="prestashop">
4
- <version>2.0.4.1</version>
5
- <release_date>2014-01-30</release_date>
6
  </plugin>
7
  <plugin name="magento">
8
  <version>2.0.1.3</version>
9
- <release_date>2014-03-17</release_date>
10
  </plugin>
11
  <plugin name="woomcommerce">
12
  <version>1.0.0.0</version>
@@ -14,6 +14,6 @@
14
  </plugin>
15
  <plugin name="drupal">
16
  <version>0.1.0.0</version>
17
- <release_date>2014-01-30</release_date>
18
  </plugin>
19
- </plugins>
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
  <plugins>
3
  <plugin name="prestashop">
4
+ <version>2.0.5</version>
5
+ <release_date>2014-04-08</release_date>
6
  </plugin>
7
  <plugin name="magento">
8
  <version>2.0.1.3</version>
9
+ <release_date>2014-04-25</release_date>
10
  </plugin>
11
  <plugin name="woomcommerce">
12
  <version>1.0.0.0</version>
14
  </plugin>
15
  <plugin name="drupal">
16
  <version>0.1.0.0</version>
17
+ <release_date>2014-03-05</release_date>
18
  </plugin>
19
+ </plugins>
app/code/community/Lengow/Tracker/etc/system.xml CHANGED
@@ -38,7 +38,7 @@
38
  <frontend_type>text</frontend_type>
39
  <sort_order>3</sort_order>
40
  <show_in_default>1</show_in_default>
41
- <show_in_website>1</show_in_website>
42
  <show_in_store>1</show_in_store>
43
  </login>
44
  <group>
@@ -47,7 +47,7 @@
47
  <frontend_type>text</frontend_type>
48
  <sort_order>5</sort_order>
49
  <show_in_default>1</show_in_default>
50
- <show_in_website>1</show_in_website>
51
  <show_in_store>1</show_in_store>
52
  </group>
53
  <api_key>
@@ -56,7 +56,7 @@
56
  <sort_order>20</sort_order>
57
  <show_in_default>1</show_in_default>
58
  <show_in_website>0</show_in_website>
59
- <show_in_store>0</show_in_store>
60
  </api_key>
61
  </fields>
62
  </general>
38
  <frontend_type>text</frontend_type>
39
  <sort_order>3</sort_order>
40
  <show_in_default>1</show_in_default>
41
+ <show_in_website>0</show_in_website>
42
  <show_in_store>1</show_in_store>
43
  </login>
44
  <group>
47
  <frontend_type>text</frontend_type>
48
  <sort_order>5</sort_order>
49
  <show_in_default>1</show_in_default>
50
+ <show_in_website>0</show_in_website>
51
  <show_in_store>1</show_in_store>
52
  </group>
53
  <api_key>
56
  <sort_order>20</sort_order>
57
  <show_in_default>1</show_in_default>
58
  <show_in_website>0</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
  </api_key>
61
  </fields>
62
  </general>
app/design/adminhtml/default/default/layout/lengow.xml CHANGED
@@ -23,6 +23,7 @@
23
  <block type="sync/adminhtml_log" name="manageorders.log.grid.container"></block>
24
  </reference>
25
  </adminhtml_lengow_log_index>
 
26
  <adminhtml_lengow_export_index>
27
  <reference name="head">
28
  <action method="setTitle" translate="title">
23
  <block type="sync/adminhtml_log" name="manageorders.log.grid.container"></block>
24
  </reference>
25
  </adminhtml_lengow_log_index>
26
+
27
  <adminhtml_lengow_export_index>
28
  <reference name="head">
29
  <action method="setTitle" translate="title">
app/design/adminhtml/default/default/template/lengow/.DS_Store DELETED
Binary file
app/design/adminhtml/default/default/template/lengow/export/.DS_Store DELETED
Binary file
app/design/adminhtml/default/default/template/lengow/feed/grid.phtml CHANGED
@@ -21,8 +21,14 @@
21
  <?php if (!$this->isSingleStoreMode()): ?>
22
  <?php echo $this->getChildHtml('store_switcher'); ?>
23
  <?php endif; ?>
 
 
 
 
 
 
24
  <div>
25
- <form method="post" id="form_grid_feed" action="<?php echo $this->getUrl('*/*/migrate', array('' => '')); ?>">
26
  <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
27
  <?php echo $this->getGridHtml() ?>
28
  </form>
21
  <?php if (!$this->isSingleStoreMode()): ?>
22
  <?php echo $this->getChildHtml('store_switcher'); ?>
23
  <?php endif; ?>
24
+ <?php
25
+ $_store_id = $this->getRequest()->getParam('store');
26
+ $args = array();
27
+ if(!empty($_store_id))
28
+ $args['store'] = $_store_id;
29
+ ?>
30
  <div>
31
+ <form method="post" id="form_grid_feed" action="<?php echo $this->getUrl('*/*/migrate', $args); ?>">
32
  <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
33
  <?php echo $this->getGridHtml() ?>
34
  </form>
app/design/adminhtml/default/default/template/lengow/sales/.DS_Store DELETED
Binary file
app/design/frontend/base/default/layout/lengow.xml CHANGED
@@ -1,14 +1,18 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <layout version="0.1.0">
3
  <default>
 
 
 
 
 
 
4
  <reference name="head">
5
  <action method="addItem">
6
  <type>skin_js</type>
7
  <name>lengow/js/tracker.js</name>
8
  </action>
9
  </reference>
10
- <reference name="before_body_end">
11
- <block type="tracker/tracker" name="lengow_tracker" template="lengow/tracker/tag.phtml" />
12
- </reference>
13
- </default>
14
  </layout>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <layout version="0.1.0">
3
  <default>
4
+ <reference name="before_body_end">
5
+ <block type="tracker/tracker" name="lengow_tracker" template="lengow/tracker/tag.phtml" />
6
+ </reference>
7
+ </default>
8
+
9
+ <checkout_onepage_index translate="label">
10
  <reference name="head">
11
  <action method="addItem">
12
  <type>skin_js</type>
13
  <name>lengow/js/tracker.js</name>
14
  </action>
15
  </reference>
16
+ </checkout_onepage_index>
17
+
 
 
18
  </layout>
app/design/frontend/base/default/template/lengow/tracker/simpletag.phtml CHANGED
@@ -1,4 +1,4 @@
1
  <!-- Tag_Lengow -->
2
- <img src="https://tracking.lengow.com/lead.php?idClient=<?php echo $this->_id_client; ?>&idGroup=<?php echo $this->_id_group; ?>&price=<?php echo $this->_total_paid; ?>&idCommande=<?php echo $this->_id_order; ?>&modePaiement=<?php echo $this->_mode_paiement; ?>&listingProduit=<?php echo $this->_ids_products; ?>" alt="" style="width: 1px; height: 1px; border: none;" />
3
- <img src="https://tracking.lengow.com/leadValidation.php?idClient=<?php echo $this->_id_client; ?>&idGroup=<?php echo $this->_id_group; ?>&idCommande=<?php echo $this->_id_order; ?>" alt="" style="width: 1px; height: 1px; border: none;" />
4
  <!-- /Tag_Lengow -->
1
  <!-- Tag_Lengow -->
2
+ <img src="https://tracking.lengow.com/lead.php?idClient=<?php echo $this->getData('id_client'); ?>&idGroup=<?php echo $this->getData('id_group'); ?>&price=<?php echo $this->getData('total_paid'); ?>&idCommande=<?php echo $this->getDta('id_order'); ?>&modePaiement=<?php echo $this->getData('mode_paiement'); ?>&listingProduit=<?php echo $this->getData('ids_products'); ?>" alt="" style="width: 1px; height: 1px; border: none;" />
3
+ <img src="https://tracking.lengow.com/leadValidation.php?idClient=<?php echo $this->getData('id_client'); ?>&idGroup=<?php echo $this->getData('id_group'); ?>&idCommande=<?php echo $this->getData('id_order'); ?>" alt="" style="width: 1px; height: 1px; border: none;" />
4
  <!-- /Tag_Lengow -->
package.xml CHANGED
@@ -1,8 +1,8 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Lengow_Export</name>
4
- <version>2.0.1.3</version>
5
- <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
@@ -11,9 +11,9 @@
11
  Export your catalog, import your orders from all Marketplaces.</description>
12
  <notes>New version of Lengow's Connector</notes>
13
  <authors><author><name>Ludovic</name><user>ludo</user><email>ludovic@lengow.com</email></author><author><name>Romain</name><user>romain</user><email>romain@lengow.com</email></author></authors>
14
- <date>2014-03-17</date>
15
- <time>11:20:33</time>
16
- <contents><target name="magecommunity"><dir name="Lengow"><dir name="Dashboard"><dir name="Block"><dir name="Adminhtml"><dir name="Dashboard"><file name="Charts.php" hash="dae1bbed1ede93b06f62589e93857396"/><file name="Diagrams.php" hash="001995ea1916ca192021ba52c155a466"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7129af0e9ab390e0695f84865a02fdb5"/></dir><dir name="Model"><file name="Config.php" hash="9ac1d092bffd109f02518885f89142c7"/></dir><dir name="etc"><file name="config.xml" hash="daa7dcee32a0d093d9e660e0c7a839ad"/></dir></dir><dir name="Export"><dir name="Block"><dir name="Adminhtml"><dir name="Product"><file name="Grid.php" hash="5ceb46d0b2ba6ab2e64e95eacad57cf4"/></dir><file name="Product.php" hash="b4802cfa8249bfe8c7378d65a5147c1b"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="622a7252f4b7fa358c22dc8763ad1b39"/><file name="Security.php" hash="3ad6b6925ef05884a1501afa6e64a685"/></dir><dir name="Model"><dir name="Catalog"><file name="Product.php" hash="1617a1fd0176e9785eb4182a9a460d00"/></dir><file name="Config.php" hash="99e3221d774542191026baff3776f8b6"/><dir name="Convert"><dir name="Parser"><file name="Product.php" hash="bc664380ca9d37256460613ecdbd8f92"/></dir></dir><dir name="Export"><dir name="Rewrite"><dir name="Catalog"><file name="Config.php" hash="e192cd30c6ed7e4cc370953c3ecd2367"/></dir></dir></dir><dir name="Feed"><file name="Abstract.php" hash="ed13409ab1c507b48b9460c8886bef8d"/><file name="Csv.php" hash="9e53191b25324292f962dec130c0c80a"/><file name="Json.php" hash="4df743bce6647eea36d2677ab7f6a9a8"/><file name="Xml.php" hash="dee5abfe1fa6f066a89a7de9ca3c9f3e"/><file name="Yaml.php" hash="f0c24bd481039c4fc13fa26ef7a4d1b9"/></dir><file name="Generate.php" hash="f2ef1f6fce7c34e4143ced99500dd2b8"/><file name="Observer.php" hash="df1db3722a4621a0b96f8a94c60cdbe7"/><dir name="Shipping"><dir name="Carrier"><file name="Lengow.php" hash="685809c2367ec3509ecbf9f4d07f4661"/></dir></dir><dir name="Source"><file name="Attributes.php" hash="95b485a452aee5b27af0af618211f13c"/><file name="Types.php" hash="6b125e9e5c0dfd5c93cf304441ed47ac"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Apikey.php" hash="111617eb86ef8dd7374efa0d4eabf781"/></dir><dir name="Source"><dir name="Category"><file name="Level.php" hash="b35d3367815682e0ed2827ae8c722e9a"/></dir><file name="Format.php" hash="fd069f484cc3ae0d914fb7a965789d9f"/><file name="Getattributes.php" hash="9ed9accf926ee7ad15a361d45eae5ff6"/><file name="Images.php" hash="e6ec93f301599ea91d69a1f4847e240d"/><file name="Status.php" hash="15db435978f73431541b66db57a91506"/><file name="Types.php" hash="56de65acbb13ee5425b95cc5f9c3f2d2"/></dir></dir></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Lengow"><file name="ExportController.php" hash="a9945fb7906fb30523599d19b97ef3a1"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name="FeedController.php" hash="e8fe620214eb352ff4d7cfbb06547a33"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="config.xml" hash="61ecd0d49063ce9224bc33354d103a12"/><file name="system.xml" hash="0fc8294856d3d5ef5288af7c9b0d4e06"/></dir></dir><dir name="Feed"><dir name="Block"><dir name="Adminhtml"><dir name="Feed"><file name="Grid.php" hash="164d0069752cf6327128e2da873c6466"/><dir name="Renderer"><file name="Migrate.php" hash="e59d5a72241165ec1c8194fc257d6e11"/><file name="Select.php" hash="78808e9061b7a5aa73c2273f18bc0746"/><file name="Url.php" hash="c9060f99ffa7f47140392c4392f793e7"/></dir></dir><file name="Feed.php" hash="96aa5aa6ed7c9e4a708df5b391621421"/></dir></dir><dir name="Helper"><file name="Data.php" hash="23ab67ab3d66ce8c35cfe9c8bff76f76"/></dir><dir name="Model"><file name="Config.php" hash="7487c73a3fe292614c9f4a2b66d8a664"/><file name="Feed.php" hash="75e01d41749b61db15f2603ed00f09a4"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Lengow"><file name="FeedController.php" hash="7a5f760a1768ddd6dca7b04affb1681f"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="6dc1efafcceeabff6ca544c8b38d5364"/><file name="system.xml" hash="22ba605f2529396e4edb41c5ec8e65e6"/></dir></dir><dir name="Sync"><dir name="Block"><dir name="Adminhtml"><file name="Import.php" hash="832bc82dde18ae4bc886933b28f41885"/><dir name="Log"><file name="Grid.php" hash="ca9a55f848bccb6e8a34e0217cf905f5"/></dir><file name="Log.php" hash="c8434ba0a97fb13c25fbfbc4f1841b53"/><dir name="Order"><file name="Grid.php" hash="f5423e0e9f88c29a39e494e8ce72c0e1"/><file name="Tab.php" hash="4c913f7d42506bd3e60e10a5142d9b8a"/></dir><file name="Order.php" hash="2ddb7553c4c67faf0bae5bbbe1be16fe"/></dir><dir name="Payment"><dir name="Info"><file name="Purchaseorder.php" hash="72bbeb480299903b16e505ffdd5d73fe"/></dir></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="05e0c035a6400f6b4b56b33e6bbf424d"/></dir><dir name="Model"><file name="Config.php" hash="e356e499cd34db77a17954fb52443a4f"/><dir name="Connector"><file name="Exception.php" hash="de1fa1b69e24fe7b976c03f1ed1ca7f7"/></dir><file name="Connector.php" hash="7d3af652eec85aedd2d7d836a73a4513"/><dir name="Customer"><file name="Customer.php" hash="e195621601071a4f15d0724839e9aaaa"/></dir><file name="Import.php" hash="e0e4cd8691b6b17158dcd6f2b3284033"/><file name="Log.php" hash="3dd56825227289f380bf5c0e2f8e848e"/><dir name="Marketplace"><file name="Exception.php" hash="bd7ab8db94e241d022cd6e467e8596ec"/></dir><file name="Marketplace.php" hash="40f6243e4e106a7f4f77f0985b775d6a"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="e3c7a389004afa2a116560e5501cb9fa"/></dir><file name="Log.php" hash="3cc46747828dc075638b115cb8bdbf68"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name="Observer.php" hash="b798657837ade214c3bf3e8a4b53ec64"/><file name="Order.php" hash="23f4aef35689e08b0b30305df5eea3fb"/><dir name="Payment"><dir name="Method"><file name="Lengow.php" hash="41344a615275c14d06707ed63ec58e59"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Quote"><file name="Item.php" hash="30f9faf6b299ef64f10785ba16030a17"/></dir><dir name="Shipping"><dir name="Carrier"><file name="Lengow.php" hash="64627df21b7d1d089ce7caa6fb3837a9"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Customer"><file name="Group.php" hash="640638dcee398949ec4d0c1e2731005d"/></dir></dir></dir></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Lengow"><file name="LogController.php" hash="37ced95b8c2bb8ac9d5e865feee8a3d3"/><file name="OrderController.php" hash="6d348a79987f24919d32beb454fa9b13"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name="ApiController.php" hash="7386c653ad093a891ffc75f0326d163f"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="config.xml" hash="67d16dee513f249b0d87f1539ff82e68"/><file name="marketplaces.xml" hash="484c97c5081604acdc0a3b300685ee1b"/><file name="system.xml" hash="ed101051303c9bc20ae3ee7c02df09f7"/><file name="wsdl.xml" hash="d299fecf68e9f795e26037be4f2115b3"/></dir><dir name="sql"><dir name="lengow_setup"><file name="mysql4-install-2.0.0.0.php" hash="ec6f4fbc56eb98d2439d9e53a6d5906f"/><file name="mysql4-upgrade-2.0.0.0-2.0.0.1.php" hash="8a452156d98da3e2508e7e67fd6b3006"/></dir></dir><file name=".DS_Store" hash="dc971dc7108101d485bfc11f9d1bd4c0"/></dir><dir name="Tracker"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Check"><file name="Point.php" hash="b1b7be8e668e789ddfa26a615b4a5040"/></dir><file name="Check.php" hash="bc55760cc20b6ef21bf894f49454ea1e"/></dir></dir></dir><dir name="Tag"><file name="Capsule.php" hash="14256e8019240284092096ec888a4f58"/><file name="Simple.php" hash="5cae14470caf8393ed8eaf0b7b006996"/></dir><file name="Tracker.php" hash="b12dc4b32f1de2fb396620f317ce63bb"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Check.php" hash="8ac8d07d45494fb39bec90ec9f11cdf9"/><file name="Data.php" hash="e526694354fe760f266bf925e5e4ac39"/></dir><dir name="Model"><file name="Capsule.php" hash="55504d0b6398f5a88b5977bf54f5b54b"/><file name="Config.php" hash="d475fd6dd049ed712f69e4a1bfc2036c"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Identifiant.php" hash="51943c288cab9456c62a2130405b695b"/><file name="Tracker.php" hash="8fdc4f1d9f02300525aeb295e9cd3dfc"/></dir></dir></dir><file name="Tracker.php" hash="8897c38fe557f52bbaaf8532529f149c"/></dir><dir name="etc"><file name="config.xml" hash="9a303500d667b9544fee8b6ed50cbc3c"/><file name="plugins.xml" hash="1e7c7bb1f31ece66e9d61adfcc9aabd8"/><file name="system.xml" hash="79f9f43e00295f51c428023e8349ac0d"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="lengow.xml" hash="8bd6d3c25e5911481a5f105fe55833f1"/></dir><dir name="template"><dir name="lengow"><dir name="check"><file name="point.phtml" hash="8e221f846b0731f8e3f1a6229e342166"/></dir><dir name="dashboard"><file name="charts.phtml" hash="e03c9e77fe69066ed335669c38d56266"/></dir><dir name="export"><file name="product.phtml" hash="fcab2dbf0f9ff81992d9b1e75cc1b5c5"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="feed"><file name="grid.phtml" hash="7e965f793beb4847fad559506865a35e"/></dir><dir name="sales"><dir name="order"><dir name="tab"><file name="info.phtml" hash="fd76ca51399fd00b52f8430acce8555c"/></dir></dir><dir name="payment"><dir name="info"><file name="purchaseorder.phtml" hash="8e9e7a287ef57fe72023e28747fb0864"/></dir></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="lengow.xml" hash="823da63da3444c91f7e0197cc3f57225"/></dir><dir name="template"><dir name="lengow"><dir name="tracker"><file name="simpletag.phtml" hash="2b761f6da02185a6931b30fddd679d64"/><file name="tag.phtml" hash="619f7bc6fe20c3dd6c1d82cdf12811b5"/><file name="tagcapsule.phtml" hash="2916e7693ef8ec9fcce5f5a8079d2beb"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Lengow_Connector.csv" hash="fc9d13f3b25c8aaf83b906f6d02dad0c"/></dir></target><target name="mageetc"><dir name="modules"><file name="Lengow_Connector.xml" hash="34b39beecc725740ea1e0bc8d339287a"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="lengow"><dir name="css"><file name="admin.css" hash="aa78dc26e735d8110b88d9974f72a502"/></dir><dir name="js"><file name="charts.min.js" hash="6806368c6a0bf73a5236b452fd5c2332"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="lengow"><dir name="js"><file name="tracker.js" hash="6402a4fbbb81a3b0587ec8c4c375e0a0"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Lengow_Export</name>
4
+ <version>2.0.2</version>
5
+ <stability>beta</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
11
  Export your catalog, import your orders from all Marketplaces.</description>
12
  <notes>New version of Lengow's Connector</notes>
13
  <authors><author><name>Ludovic</name><user>ludo</user><email>ludovic@lengow.com</email></author><author><name>Romain</name><user>romain</user><email>romain@lengow.com</email></author></authors>
14
+ <date>2014-10-01</date>
15
+ <time>13:17:54</time>
16
+ <contents><target name="magecommunity"><dir name="Lengow"><dir name="Dashboard"><dir name="Block"><dir name="Adminhtml"><dir name="Dashboard"><file name="Charts.php" hash="dae1bbed1ede93b06f62589e93857396"/><file name="Diagrams.php" hash="001995ea1916ca192021ba52c155a466"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7129af0e9ab390e0695f84865a02fdb5"/></dir><dir name="Model"><file name="Config.php" hash="9ac1d092bffd109f02518885f89142c7"/></dir><dir name="etc"><file name="config.xml" hash="be1872bbc46e4827d91b548e26343b5a"/></dir></dir><dir name="Export"><dir name="Block"><dir name="Adminhtml"><dir name="Product"><file name="Grid.php" hash="5ceb46d0b2ba6ab2e64e95eacad57cf4"/></dir><file name="Product.php" hash="b4802cfa8249bfe8c7378d65a5147c1b"/></dir></dir><dir name="Helper"><file name="Data.php" hash="00b4fd0b1eccda884ad12c0d2b61eb7d"/><file name="Security.php" hash="dbf9a95967d3fb6055e50da5dea2b359"/></dir><dir name="Model"><dir name="Catalog"><file name="Product.php" hash="54f3c2eb7c2d7f734ff3830a6fbf4c4a"/></dir><file name="Config.php" hash="99e3221d774542191026baff3776f8b6"/><dir name="Convert"><dir name="Parser"><file name="Product.php" hash="bc664380ca9d37256460613ecdbd8f92"/></dir></dir><dir name="Export"><dir name="Rewrite"><dir name="Catalog"><file name="Config.php" hash="e192cd30c6ed7e4cc370953c3ecd2367"/></dir></dir></dir><dir name="Feed"><file name="Abstract.php" hash="ed13409ab1c507b48b9460c8886bef8d"/><file name="Csv.php" hash="9e53191b25324292f962dec130c0c80a"/><file name="Json.php" hash="4df743bce6647eea36d2677ab7f6a9a8"/><file name="Xml.php" hash="dee5abfe1fa6f066a89a7de9ca3c9f3e"/><file name="Yaml.php" hash="f0c24bd481039c4fc13fa26ef7a4d1b9"/></dir><file name="Generate.php" hash="e8d88c4962f8a913e801040d74829852"/><file name="Observer.php" hash="19847eb801ba2d21d92baaf3474188b7"/><dir name="Shipping"><dir name="Carrier"><file name="Lengow.php" hash="685809c2367ec3509ecbf9f4d07f4661"/></dir></dir><dir name="Source"><file name="Attributes.php" hash="95b485a452aee5b27af0af618211f13c"/><file name="Types.php" hash="6b125e9e5c0dfd5c93cf304441ed47ac"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Apikey.php" hash="111617eb86ef8dd7374efa0d4eabf781"/></dir><dir name="Source"><dir name="Category"><file name="Level.php" hash="b35d3367815682e0ed2827ae8c722e9a"/></dir><file name="Format.php" hash="fd069f484cc3ae0d914fb7a965789d9f"/><file name="Getattributes.php" hash="9ed9accf926ee7ad15a361d45eae5ff6"/><file name="Images.php" hash="e6ec93f301599ea91d69a1f4847e240d"/><file name="Status.php" hash="15db435978f73431541b66db57a91506"/><file name="Types.php" hash="56de65acbb13ee5425b95cc5f9c3f2d2"/></dir></dir></dir><file name=".DS_Store" hash="2e9d9e206608d44ac12e376d529a7440"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Lengow"><file name="ExportController.php" hash="9d14316a80004e570439c05f5e516368"/></dir></dir><file name="FeedController.php" hash="ddd767d9cf57aa8885ccbec58b59f16d"/></dir><dir name="etc"><file name="config.xml" hash="591d66bc318dcb5a91e98eab94f246b0"/><file name="system.xml" hash="11fa172632e95c372b2de2ffedfba79d"/></dir><file name=".DS_Store" hash="94f3372c1eac7f1e5bacd2a64a662c3a"/></dir><dir name="Feed"><dir name="Block"><dir name="Adminhtml"><dir name="Feed"><file name="Grid.php" hash="6ab140fe779bc7b38c1b004f24ed705c"/><dir name="Renderer"><file name="Migrate.php" hash="e59d5a72241165ec1c8194fc257d6e11"/><file name="Select.php" hash="78808e9061b7a5aa73c2273f18bc0746"/><file name="Url.php" hash="c9060f99ffa7f47140392c4392f793e7"/></dir></dir><file name="Feed.php" hash="96aa5aa6ed7c9e4a708df5b391621421"/></dir></dir><dir name="Helper"><file name="Data.php" hash="23ab67ab3d66ce8c35cfe9c8bff76f76"/></dir><dir name="Model"><file name="Config.php" hash="7487c73a3fe292614c9f4a2b66d8a664"/><file name="Feed.php" hash="2acd56249c12ee3985f699aa65b22295"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Lengow"><file name="FeedController.php" hash="7a40d4616879c4cb131ca394187113be"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="afbd0d62d8605c3d1228ebe6caada6a0"/><file name="system.xml" hash="22ba605f2529396e4edb41c5ec8e65e6"/></dir></dir><dir name="Sync"><dir name="Block"><dir name="Adminhtml"><file name="Import.php" hash="832bc82dde18ae4bc886933b28f41885"/><dir name="Log"><file name="Grid.php" hash="b699cedfd647ecde78909cc2440b1f03"/></dir><file name="Log.php" hash="c8434ba0a97fb13c25fbfbc4f1841b53"/><dir name="Order"><file name="Grid.php" hash="f5423e0e9f88c29a39e494e8ce72c0e1"/><file name="Tab.php" hash="4c913f7d42506bd3e60e10a5142d9b8a"/></dir><file name="Order.php" hash="2ddb7553c4c67faf0bae5bbbe1be16fe"/></dir><dir name="Payment"><dir name="Info"><file name="Purchaseorder.php" hash="72bbeb480299903b16e505ffdd5d73fe"/></dir></dir></dir><dir name="Helper"><file name="Api.php" hash="e8846c81d34c1025579151c7372492fb"/><file name="Data.php" hash="05e0c035a6400f6b4b56b33e6bbf424d"/></dir><dir name="Model"><file name="Config.php" hash="f9c20dd17637d203b5de49d6dd6aa3a7"/><dir name="Connector"><file name="Exception.php" hash="de1fa1b69e24fe7b976c03f1ed1ca7f7"/></dir><file name="Connector.php" hash="68eb49a02343c1ef4c2509d3f762fd23"/><dir name="Customer"><file name="Customer.php" hash="6c19bb3c13465edafb961aa57184417e"/></dir><file name="Import.php" hash="85dc8dd337f42f08e8536da73bad21d4"/><file name="Log.php" hash="3dd56825227289f380bf5c0e2f8e848e"/><dir name="Marketplace"><file name="Exception.php" hash="bd7ab8db94e241d022cd6e467e8596ec"/></dir><file name="Marketplace.php" hash="39ff91f3da12da0f7a679ce3b7844a36"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="e3c7a389004afa2a116560e5501cb9fa"/></dir><file name="Log.php" hash="3cc46747828dc075638b115cb8bdbf68"/></dir><file name="Observer.php" hash="35e6671e260525b799c1bb6f39f278aa"/><file name="Order.php" hash="ccf347620fab224efd625284319270a2"/><dir name="Payment"><dir name="Method"><file name="Lengow.php" hash="f49bb516bebb86ceeb822f07c1ca5849"/></dir></dir><dir name="Quote"><file name="Item.php" hash="30f9faf6b299ef64f10785ba16030a17"/></dir><dir name="Shipping"><dir name="Carrier"><file name="Lengow.php" hash="64627df21b7d1d089ce7caa6fb3837a9"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Customer"><file name="Group.php" hash="640638dcee398949ec4d0c1e2731005d"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Lengow"><file name="LogController.php" hash="37ced95b8c2bb8ac9d5e865feee8a3d3"/><file name="OrderController.php" hash="ed81163099b035ebbf74e32272c3d75c"/></dir></dir><file name="ApiController.php" hash="ecfc5b4ffc5974bd24907b7b5e719bca"/></dir><dir name="etc"><file name="config.xml" hash="67f88e961c4a3e5348bf30b480f2a96a"/><file name="marketplaces.xml" hash="8da8c63b0a18f3ed6655c1acca23ca20"/><file name="system.xml" hash="a0f410779bc2fccf01ba626ea272a557"/><file name="wsdl.xml" hash="d299fecf68e9f795e26037be4f2115b3"/></dir><dir name="sql"><dir name="lengow_setup"><file name="mysql4-install-2.0.0.0.php" hash="4438ce9c3fa9b2b16162d54e4689e415"/><file name="mysql4-upgrade-2.0.0.0-2.0.0.1.php" hash="8a452156d98da3e2508e7e67fd6b3006"/></dir></dir></dir><dir name="Tracker"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Check"><file name="Point.php" hash="b1b7be8e668e789ddfa26a615b4a5040"/></dir><file name="Check.php" hash="bc55760cc20b6ef21bf894f49454ea1e"/></dir></dir></dir><dir name="Tag"><file name="Capsule.php" hash="05369b685fbaa27ad5da96e2b606e4ef"/><file name="Simple.php" hash="14b977c269cdb60a6082e24fef0923dc"/></dir><file name="Tracker.php" hash="b12dc4b32f1de2fb396620f317ce63bb"/></dir><dir name="Helper"><file name="Check.php" hash="8ac8d07d45494fb39bec90ec9f11cdf9"/><file name="Data.php" hash="e526694354fe760f266bf925e5e4ac39"/></dir><dir name="Model"><file name="Capsule.php" hash="55504d0b6398f5a88b5977bf54f5b54b"/><file name="Config.php" hash="d475fd6dd049ed712f69e4a1bfc2036c"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Identifiant.php" hash="51943c288cab9456c62a2130405b695b"/><file name="Tracker.php" hash="8fdc4f1d9f02300525aeb295e9cd3dfc"/></dir></dir></dir><file name="Tracker.php" hash="8897c38fe557f52bbaaf8532529f149c"/></dir><dir name="etc"><file name="config.xml" hash="04affc706c0942eec0581b397237733c"/><file name="plugins.xml" hash="d20aa020815fefccac44c1e86b38eb2f"/><file name="system.xml" hash="fa2d44f4591f423264ac792cb50d03f6"/></dir></dir><file name=".DS_Store" hash="9c2c1b22881e97a820d4e7565a869c34"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="lengow.xml" hash="5074e8b0efa14c4da96849a31d69b78b"/></dir><dir name="template"><dir name="lengow"><dir name="check"><file name="point.phtml" hash="8e221f846b0731f8e3f1a6229e342166"/></dir><dir name="dashboard"><file name="charts.phtml" hash="e03c9e77fe69066ed335669c38d56266"/></dir><dir name="export"><file name="product.phtml" hash="fcab2dbf0f9ff81992d9b1e75cc1b5c5"/></dir><dir name="feed"><file name="grid.phtml" hash="cb839fc15b928cffaf1aa803a50a370a"/></dir><dir name="sales"><dir name="order"><dir name="tab"><file name="info.phtml" hash="fd76ca51399fd00b52f8430acce8555c"/></dir></dir><dir name="payment"><dir name="info"><file name="purchaseorder.phtml" hash="8e9e7a287ef57fe72023e28747fb0864"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="lengow.xml" hash="4d0e2b553b6dc69c10aa7d7e0e78cfb0"/></dir><dir name="template"><dir name="lengow"><dir name="tracker"><file name="simpletag.phtml" hash="1d03ddc50e35828a35bd0cd92306f770"/><file name="tag.phtml" hash="619f7bc6fe20c3dd6c1d82cdf12811b5"/><file name="tagcapsule.phtml" hash="2916e7693ef8ec9fcce5f5a8079d2beb"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Lengow_Connector.csv" hash="fc9d13f3b25c8aaf83b906f6d02dad0c"/></dir></target><target name="mageetc"><dir name="modules"><file name="Lengow_Connector.xml" hash="34b39beecc725740ea1e0bc8d339287a"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="lengow"><dir name="css"><file name="admin.css" hash="aa78dc26e735d8110b88d9974f72a502"/></dir><dir name="js"><file name="charts.min.js" hash="6806368c6a0bf73a5236b452fd5c2332"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="lengow"><dir name="js"><file name="tracker.js" hash="6402a4fbbb81a3b0587ec8c4c375e0a0"/></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
skin/adminhtml/default/default/lengow/js/.DS_Store DELETED
Binary file
skin/frontend/base/default/lengow/.DS_Store DELETED
Binary file