Dnd_Shoppingflux - Version 0.6.0

Version Notes

More good things to come

Download this release

Release Info

Developer Magento Core Team
Extension Dnd_Shoppingflux
Version 0.6.0
Comparing to
See all releases


Code changes from version 1.1.0 to 0.6.0

app/code/community/Dnd/Shoppingflux/Block/Catalog/Product.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Dnd
5
+ * @package Dnd_Shoppingflux
6
+ * @author contact@dnd.fr
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+
10
+ class Dnd_Shoppingflux_Block_Catalog_Product extends Mage_Adminhtml_Block_Catalog_Product
11
+ {
12
+ protected function _prepareLayout()
13
+ {
14
+ $this->_addButton('add_new', array(
15
+ 'label' => Mage::helper('catalog')->__('Add Product'),
16
+ 'onclick' => "setLocation('{$this->getUrl('*/*/new')}')",
17
+ 'class' => 'add'
18
+ ));
19
+
20
+ $this->_addButton('refresh_shopping', array(
21
+ 'label' => Mage::helper('catalog')->__('Rafraichir Shopping-flux'),
22
+ 'onclick' => "window.open('{$this->getUrl('shoppingflux/adminhtml_shoppingflux/update/')}')",
23
+ 'class' => 'save'
24
+ ));
25
+
26
+ $this->setChild('grid', $this->getLayout()->createBlock('adminhtml/catalog_product_grid', 'product.grid'));
27
+ return parent::_prepareLayout();
28
+ }
29
+
30
+ }
app/code/community/Dnd/Shoppingflux/Block/Profile.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Dnd
5
+ * @package Dnd_Shoppingflux
6
+ * @author contact@dnd.fr
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+
10
+
11
+ class Dnd_Shoppingflux_Block_Profile extends Mage_Core_Block_Template
12
+ {
13
+ protected function getLimit()
14
+ {
15
+ return round((int)Mage::getModel("shoppingflux/flux")->getCollecSize()/100);
16
+ }
17
+
18
+ protected function getProductTotal()
19
+ {
20
+ return (int)Mage::getModel("shoppingflux/flux")->getCollecSize();
21
+ }
22
+
23
+ }
app/code/community/Dnd/Shoppingflux/Helper/Data.php CHANGED
@@ -3,6 +3,4 @@
3
  class Dnd_Shoppingflux_Helper_Data extends Mage_Core_Helper_Abstract
4
  {
5
 
6
-
7
-
8
  }
3
  class Dnd_Shoppingflux_Helper_Data extends Mage_Core_Helper_Abstract
4
  {
5
 
 
 
6
  }
app/code/community/Dnd/Shoppingflux/Model/Attr.php CHANGED
@@ -18,8 +18,8 @@
18
  * versions in the future. If you wish to customize Magento for your
19
  * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
- * @category Mage
22
- * @package Mage_Adminhtml
23
  * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,6 +30,7 @@ class Dnd_Shoppingflux_Model_Attr
30
  public function toOptionArray()
31
  {
32
  $attrs = Mage::getSingleton('catalog/convert_parser_product')->getExternalAttributes();
 
33
  return $attrs;
34
  }
35
  }
18
  * versions in the future. If you wish to customize Magento for your
19
  * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
+ * @category Dnd
22
+ * @package Dnd_Shoppingflux
23
  * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  public function toOptionArray()
31
  {
32
  $attrs = Mage::getSingleton('catalog/convert_parser_product')->getExternalAttributes();
33
+ array_unshift($attrs, "Selectionnez votre attribut");
34
  return $attrs;
35
  }
36
  }
app/code/community/Dnd/Shoppingflux/Model/Flux.php CHANGED
@@ -1,5 +1,12 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
4
  {
5
  public $nom_rayon='';
@@ -8,15 +15,6 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
8
  public $description='';
9
  public $stock='';
10
  public $ImageUrl='';
11
-
12
- public function getFlux()
13
- {
14
- $flux = '';
15
- $flux .= $this->getHeader();
16
- $flux .= $this->getBody();
17
-
18
- return $flux;
19
- }
20
 
21
 
22
  public function getHeader()
@@ -27,56 +25,75 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
27
  }
28
 
29
 
30
- public function getBody()
31
  {
 
32
  $body = '<products>';
33
- $body .= $this->getAllProductsXml();
34
- $body .= '</products>';
35
 
36
  return $body;
 
37
  }
38
 
 
 
 
 
 
 
 
 
39
 
40
- public function getAllProductsXml()
41
  {
 
42
  $productsXml = '';
43
 
44
  // Récupération de tous les produits simple + conf + en stock + activé
45
 
46
  // ENLEVE PRODUIT FILS - BOUCLE A REVOIR TROP GOURMANDE EN RESSOURCE
47
  $products = Mage::getResourceModel('catalog/product_collection')
48
- ->addAttributeToSelect('entity_id')
49
- ->addAttributeToFilter("status",1);
50
-
51
-
52
- $configurable_product = Mage::getModel('catalog/product_type_configurable');
53
-
54
- $exclude=array();
55
-
56
 
57
- //echo count($products);
58
-
59
- foreach($products as $product)
60
- {
61
-
62
- $parentIdArray = $configurable_product->getParentIdsByChild($product->getId());
63
-
64
-
65
- if(isset($parentIdArray) && $parentIdArray[0]!=''){
66
-
67
- $exclude[]=$product->getData('entity_id');
68
-
69
- }
70
-
71
-
72
- }
73
 
74
- $productsCollec = Mage::getResourceModel('catalog/product_collection')
75
- ->addAttributeToSelect('*')
76
- ->addAttributeToFilter("status",1)
77
- ->addAttributeToFilter('entity_id',array('nin'=>$exclude));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
- foreach($productsCollec as $product)
80
  {
81
 
82
  $productsXml .= $this->getProductXml($product);
@@ -127,7 +144,13 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
127
  }
128
 
129
  return $productDataXml;
130
- }
 
 
 
 
 
 
131
 
132
  public function getSimpleDataXml($product,$data)
133
  {
@@ -138,7 +161,7 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
138
  return $dataXml;
139
  }
140
 
141
- //function qui gere les options des configurables
142
  public function getOptionsDataXml($product,$data)
143
  {
144
  if($product->getData('type_id')=="configurable"){
@@ -150,27 +173,26 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
150
 
151
  $dataXml='';
152
 
153
- foreach($configurableAttributeCollection as $attribute){
154
 
155
- $dataXml .= '<opt'.$i.'>';
156
 
157
- $dataXml .= '<label>';
158
- $dataXml .= $attribute->getProductAttribute()->getFrontend()->getLabel();
159
- $dataXml .= '</label>';
160
- $dataXml .= '<value>';
161
-
162
  $childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$product);
163
 
164
  $names=array();
165
 
166
- foreach($childProducts as $prod){
 
 
167
 
168
- array_push($names,$prod->getResource()->getAttribute($attribute->getProductAttribute()->getAttributeCode())->getFrontend()->getValue($prod));
 
 
169
  }
170
 
171
  $dataXml .= implode(",",$names);
172
- $dataXml .= '</value>';
173
- $dataXml .= '</opt'.$i.'>';
174
 
175
  $i++;
176
  }
@@ -197,19 +219,31 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
197
  if(isset($nom_rayon) && isset($nom_gamme))
198
  {
199
  $dataXml .= '<'.$data.'>';
200
- $dataXml .= $nom_rayon.'/'.$nom_gamme;
201
  $dataXml .= '</'.$data.'>';
202
  }
203
  }
204
  break;
205
 
 
206
  case 'taux':
207
  if(Mage::getStoreConfig('shoppingflux/gestion_attribut/remise_taux_active')==1){
208
 
209
  if($product->getSpecialPrice())
210
  {
211
- $percent = (($product->getPrice() - $product->getSpecialPrice())/$product->getPrice())*100;
212
-
 
 
 
 
 
 
 
 
 
 
 
213
  $dataXml .= '<'.$data.'>';
214
  $dataXml .= round($percent,2);
215
  $dataXml .= '</'.$data.'>';
@@ -224,7 +258,7 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
224
  {
225
  $dataXml .= '<'.$data.'>';
226
  $remise = $product->getPrice() - $product->getSpecialPrice();
227
- $dataXml .= Mage::helper('core')->currency($remise,true,false);
228
  $dataXml .= '</'.$data.'>';
229
  }
230
  }
@@ -284,9 +318,12 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
284
 
285
  switch($data)
286
  {
 
 
 
287
  case 'reference_constructeur':
288
 
289
- if(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ref_constructeur')!=''){
290
 
291
  $dataXml .= $product->getData(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ref_constructeur'));
292
 
@@ -299,7 +336,7 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
299
 
300
  case 'reference_fournisseur':
301
 
302
- if(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ref_fournisseur')!=''){
303
 
304
  $dataXml .= $product->getData(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ref_fournisseur'));
305
 
@@ -312,7 +349,7 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
312
 
313
  case 'code_ean':
314
 
315
- if(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ean')!=''){
316
 
317
  $dataXml .= $product->getData(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ean'));
318
 
@@ -325,7 +362,7 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
325
 
326
  case 'code_isbn':
327
 
328
- if(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_isbn')!=''){
329
 
330
  $dataXml .= $product->getData(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_isbn'));
331
 
@@ -336,45 +373,7 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
336
 
337
  break;
338
 
339
- case 'delais':
340
-
341
- if(Mage::getStoreConfig('shoppingflux/general/delai_livraison')!=''){
342
-
343
- $dataXml .= Mage::getStoreConfig('shoppingflux/general/delai_livraison');
344
-
345
- }else{
346
- echo "Pas d'attribut delai_livraison renseigné en BO";
347
- die();
348
- }
349
-
350
- break;
351
-
352
- case 'frais_de_port':
353
 
354
- if(Mage::getStoreConfig('shoppingflux/general/port')!=''){
355
-
356
- $dataXml .= Mage::getStoreConfig('shoppingflux/general/port');
357
-
358
- }else{
359
- echo "Pas d'attribut frais de port renseigné en BO";
360
- die();
361
- }
362
-
363
- break;
364
-
365
- case 'nom_marque':
366
-
367
- if(Mage::getStoreConfig('shoppingflux/general/marque')!=''){
368
-
369
- $dataXml .= $product->getResource()->getAttribute(Mage::getStoreConfig('shoppingflux/general/marque'))->getFrontend()->getValue($product);
370
-
371
- }else{
372
-
373
- echo "Pas d'attribut pour la marque renseigné en BO";
374
- die();
375
- }
376
-
377
- break;
378
 
379
 
380
  }
@@ -401,12 +400,83 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
401
 
402
  switch($data)
403
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  case 'price':
405
- $dataValue = Mage::helper('core')->currency($product->getData($data),true,false);
406
  break;
407
 
408
  case 'special_price':
409
- $dataValue = Mage::helper('core')->currency($product->getData($data),true,false);
410
  break;
411
 
412
  case 'url':
@@ -422,6 +492,7 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
422
  break;
423
 
424
  case 'nom_rayon':
 
425
  $value = $product->getCategoryIds();
426
  $dataValue='';
427
 
@@ -452,8 +523,7 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
452
 
453
  //$dataValue=$cur_subcategory->getName();
454
 
455
- }
456
-
457
 
458
  //on sauvegarde le dernier level connu
459
  $lastLevel=$cur_subcategory->getLevel();
@@ -545,9 +615,12 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
545
 
546
  //on intialise les futur var dont on as besoin
547
 
548
- $metaArray['title'] = $productLoaded->getData('meta_title');
549
- $metaArray['desc'] = $productLoaded->getData('meta_description');
550
  $metaArray['keywords'] = $productLoaded->getData('meta_keywords');
 
 
 
551
  $description = $productLoaded->getDescription();
552
  $stock = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
553
  $ImageUrl = $productLoaded->getImageUrl();
@@ -576,6 +649,22 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
576
 
577
  return $dataXml;
578
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
579
 
580
  public function getStructure()
581
  {
@@ -584,89 +673,92 @@ class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
584
  $structure[1]["type"]= "simple";
585
  $structure[1]["value"]= "sku";
586
 
587
- $structure[2]["type"]= "pdm";
588
- $structure[2]["value"]= "reference_constructeur";
589
 
590
- $structure[3]["type"]= "pdm";
591
- $structure[3]["value"]= "reference_fournisseur";
592
 
593
- $structure[4]["type"]= "pdm";
594
- $structure[4]["value"]= "code_ean";
595
-
596
- $structure[5]["type"]= "pdm";
597
- $structure[5]["value"]= "code_isbn";
598
 
599
- $structure[6]["type"]= "special";
600
- $structure[6]["value"]= "nom_rayon";
601
 
602
- $structure[7]["type"]= "special";
603
- $structure[7]["value"]= "nom_gamme";
604
 
605
- $structure[8]["type"]= "nonrequired";
606
- $structure[8]["value"]= "nom_rayon_gamme";
607
-
608
- $structure[9]["type"]= "simple";
609
- $structure[9]["value"]= "name";
610
 
611
- $structure[10]["type"]= "pdm";
612
- $structure[10]["value"]= "nom_marque";
613
 
614
- $structure[11]["type"]= "special";
615
- $structure[11]["value"]= "price";
 
 
 
616
 
617
- $structure[12]["type"]= "simple";
618
- $structure[12]["value"]= "short_description";
619
 
620
- $structure[13]["type"]= "special";
621
- $structure[13]["value"]= "description";
622
 
623
- $structure[14]["type"]= "nonrequired";
624
- $structure[14]["value"]= "weight";
 
 
 
625
 
626
- $structure[15]["type"]= "nonrequired";
627
- $structure[15]["value"]= "visible";
628
 
629
  $structure[16]["type"]= "special";
630
- $structure[16]["value"]= "is_in_stock";
 
 
 
 
 
 
 
 
 
631
 
632
- $structure[17]["type"]= "nonrequired";
633
- $structure[17]["value"]= "stock";
634
 
635
- $structure[18]["type"]= "special";
636
- $structure[18]["value"]= "meta_title";
637
 
638
- $structure[19]["type"]= "special";
639
- $structure[19]["value"]= "meta_description";
 
 
 
640
 
641
- $structure[20]["type"]= "special";
642
- $structure[20]["value"]= "meta_keyword";
643
 
644
- $structure[21]["type"]= "options";
645
- $structure[21]["value"]= "options";
646
-
647
- $structure[22]["type"]= "special";
648
- $structure[22]["value"]= "special_price";
649
 
650
- $structure[23]["type"]= "nonrequired";
651
- $structure[23]["value"]= "taux";
652
-
653
- $structure[24]["type"]= "nonrequired";
654
- $structure[24]["value"]= "remise";
655
 
656
- $structure[25]["type"]= "pdm";
657
- $structure[25]["value"]= "delais";
658
 
659
- $structure[26]["type"]= "pdm";
660
- $structure[26]["value"]= "frais_de_port";
661
-
662
- $structure[27]["type"]= "special";
663
- $structure[27]["value"]= "url";
664
-
665
- $structure[28]["type"]= "special";
666
- $structure[28]["value"]= "image_url";
667
 
668
- $structure[29]["type"]= "special";
669
- $structure[29]["value"]= "thumbnail_url";
 
 
 
670
 
671
  return $structure;
672
  }
1
  <?php
2
 
3
+ /**
4
+ * @category Dnd
5
+ * @package Dnd_Shoppingflux
6
+ * @author contact@dnd.fr
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+
10
  class Dnd_Shoppingflux_Model_Flux extends Mage_Core_Model_Abstract
11
  {
12
  public $nom_rayon='';
15
  public $description='';
16
  public $stock='';
17
  public $ImageUrl='';
 
 
 
 
 
 
 
 
 
18
 
19
 
20
  public function getHeader()
25
  }
26
 
27
 
28
+ public function getBodyStart()
29
  {
30
+
31
  $body = '<products>';
 
 
32
 
33
  return $body;
34
+
35
  }
36
 
37
+ public function getBodyEnd(){
38
+
39
+ $body = '</products>';
40
+
41
+ return $body;
42
+
43
+ }
44
+
45
 
46
+ public function getAllProductsXml($pass)
47
  {
48
+
49
  $productsXml = '';
50
 
51
  // Récupération de tous les produits simple + conf + en stock + activé
52
 
53
  // ENLEVE PRODUIT FILS - BOUCLE A REVOIR TROP GOURMANDE EN RESSOURCE
54
  $products = Mage::getResourceModel('catalog/product_collection')
55
+ ->addAttributeToSelect('*')
56
+ ->addAttributeToFilter('status',1)
57
+ ->addAttributeToFilter('visibility',array('in' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH))
58
+ ->addAttributeToSort('entity_id','asc')->setPage($pass,100);
59
+
60
+ if(Mage::getStoreConfig('shoppingflux/general/configurable')==1){ // il y as des configurables
 
 
61
 
62
+ if(Mage::getStoreConfig('shoppingflux/general/configurable_child')==1){ // Les enfant sont visibles dans le catalogue
63
+
64
+ $configurable_product = Mage::getModel('catalog/product_type_configurable');
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
+ $exclude=array();
67
+
68
+ foreach($products as $product)
69
+ {
70
+
71
+ $parentIdArray = $configurable_product->getParentIdsByChild($product->getId());
72
+
73
+ if(!empty($parentIdArray)){
74
+
75
+ if($parentIdArray[0]!=''){
76
+
77
+ $exclude[]=$product->getData('entity_id');
78
+
79
+ }
80
+ }
81
+
82
+ }
83
+
84
+ $productsCollec = Mage::getModel('catalog/product')
85
+ ->addAttributeToSelect('*')
86
+ ->addAttributeToFilter('status',1)
87
+ ->addAttributeToFilter('visibility',array('in' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH))
88
+ ->addAttributeToFilter('entity_id',array('nin'=>$exclude))
89
+ ->setPage($pass,100);
90
+
91
+
92
+
93
+ }
94
+ }
95
 
96
+ foreach($products as $product)
97
  {
98
 
99
  $productsXml .= $this->getProductXml($product);
144
  }
145
 
146
  return $productDataXml;
147
+ }
148
+
149
+ public function getCollecSize(){
150
+
151
+ return Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('status',1)->addAttributeToFilter('visibility',array('in' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH))->getSize();
152
+
153
+ }
154
 
155
  public function getSimpleDataXml($product,$data)
156
  {
161
  return $dataXml;
162
  }
163
 
164
+ //function qui gere les options des configurables
165
  public function getOptionsDataXml($product,$data)
166
  {
167
  if($product->getData('type_id')=="configurable"){
173
 
174
  $dataXml='';
175
 
176
+ foreach($configurableAttributeCollection as $attribute){ // pour chaque attributs configurables
177
 
178
+ $dataXml .= '<'.$attribute->getProductAttribute()->getAttributeCode().'>';
179
 
 
 
 
 
 
180
  $childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$product);
181
 
182
  $names=array();
183
 
184
+ foreach($childProducts as $prod){ // on parcour tous les produits enfants du configurable
185
+
186
+ if(!in_array($prod->getResource()->getAttribute($attribute->getProductAttribute()->getAttributeCode())->getFrontend()->getValue($prod),$names)){
187
 
188
+ array_push($names,$prod->getResource()->getAttribute($attribute->getProductAttribute()->getAttributeCode())->getFrontend()->getValue($prod));
189
+
190
+ }
191
  }
192
 
193
  $dataXml .= implode(",",$names);
194
+
195
+ $dataXml .= '</'.$attribute->getProductAttribute()->getAttributeCode().'>';
196
 
197
  $i++;
198
  }
219
  if(isset($nom_rayon) && isset($nom_gamme))
220
  {
221
  $dataXml .= '<'.$data.'>';
222
+ $dataXml .= '<![CDATA['.$nom_rayon.'/'.$nom_gamme.']]>';
223
  $dataXml .= '</'.$data.'>';
224
  }
225
  }
226
  break;
227
 
228
+
229
  case 'taux':
230
  if(Mage::getStoreConfig('shoppingflux/gestion_attribut/remise_taux_active')==1){
231
 
232
  if($product->getSpecialPrice())
233
  {
234
+ $price = $product->getPrice();
235
+
236
+ if($price==0){ //cas produit bundle qui n'ont pas de prix
237
+
238
+ $percent = 0;
239
+
240
+ } else {
241
+
242
+ $percent = 100-(($product->getSpecialPrice()*100)/$price);
243
+
244
+ }
245
+
246
+
247
  $dataXml .= '<'.$data.'>';
248
  $dataXml .= round($percent,2);
249
  $dataXml .= '</'.$data.'>';
258
  {
259
  $dataXml .= '<'.$data.'>';
260
  $remise = $product->getPrice() - $product->getSpecialPrice();
261
+ $dataXml .= Mage::helper('core')->currency($remise,false,false);
262
  $dataXml .= '</'.$data.'>';
263
  }
264
  }
318
 
319
  switch($data)
320
  {
321
+
322
+
323
+
324
  case 'reference_constructeur':
325
 
326
+ if(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ref_constructeur')!='0'){
327
 
328
  $dataXml .= $product->getData(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ref_constructeur'));
329
 
336
 
337
  case 'reference_fournisseur':
338
 
339
+ if(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ref_fournisseur')!='0'){
340
 
341
  $dataXml .= $product->getData(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ref_fournisseur'));
342
 
349
 
350
  case 'code_ean':
351
 
352
+ if(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ean')!='0'){
353
 
354
  $dataXml .= $product->getData(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_ean'));
355
 
362
 
363
  case 'code_isbn':
364
 
365
+ if(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_isbn')!='0'){
366
 
367
  $dataXml .= $product->getData(Mage::getStoreConfig('shoppingflux/marketplace/pdm_attribut_isbn'));
368
 
373
 
374
  break;
375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
 
378
 
379
  }
400
 
401
  switch($data)
402
  {
403
+ case 'ecotaxe':
404
+
405
+ if(Mage::getStoreConfig('shoppingflux/general/ecotaxe_active')==1){
406
+
407
+ if(Mage::getStoreConfig('shoppingflux/general/ecotaxe')!='0'){
408
+
409
+ $dataValue .= $product->getData(Mage::getStoreConfig('shoppingflux/general/ecotaxe'));
410
+
411
+ } else {
412
+
413
+ echo "Pas d'attribut ecotaxe renseigné en BO";
414
+ die();
415
+
416
+ }
417
+
418
+
419
+ } else {
420
+
421
+ $dataValue .= 0;
422
+
423
+ }
424
+
425
+
426
+ break;
427
+
428
+ case 'delais':
429
+
430
+ if(Mage::getStoreConfig('shoppingflux/general/delai_livraison')!=''){
431
+
432
+ $dataValue .= Mage::getStoreConfig('shoppingflux/general/delai_livraison');
433
+
434
+ }else{
435
+
436
+ echo "Pas d'attribut delai_livraison renseigné en BO";
437
+ die();
438
+
439
+ }
440
+
441
+ break;
442
+
443
+ case 'frais_de_port':
444
+
445
+ if(Mage::getStoreConfig('shoppingflux/general/port')!=''){
446
+
447
+ $dataValue .= Mage::getStoreConfig('shoppingflux/general/port');
448
+
449
+ }else{
450
+
451
+ echo "Pas d'attribut frais de port renseigné en BO";
452
+ die();
453
+
454
+ }
455
+
456
+ break;
457
+
458
+ case 'nom_marque':
459
+
460
+ if(Mage::getStoreConfig('shoppingflux/general/marque')!='0'){
461
+
462
+ $dataValue .= $product->getResource()->getAttribute(Mage::getStoreConfig('shoppingflux/general/marque'))->getFrontend()->getValue($product);
463
+
464
+ }else{
465
+
466
+ echo "Pas d'attribut pour la marque renseigné en BO";
467
+ die();
468
+
469
+ }
470
+
471
+ break;
472
+
473
+
474
  case 'price':
475
+ $dataValue = Mage::helper('core')->currency($product->getData($data),false,false);
476
  break;
477
 
478
  case 'special_price':
479
+ $dataValue = Mage::helper('core')->currency($product->getData($data),false,false);
480
  break;
481
 
482
  case 'url':
492
  break;
493
 
494
  case 'nom_rayon':
495
+
496
  $value = $product->getCategoryIds();
497
  $dataValue='';
498
 
523
 
524
  //$dataValue=$cur_subcategory->getName();
525
 
526
+ }
 
527
 
528
  //on sauvegarde le dernier level connu
529
  $lastLevel=$cur_subcategory->getLevel();
615
 
616
  //on intialise les futur var dont on as besoin
617
 
618
+ $metaArray['title'] = $this->modifieTailleVireHtml($productLoaded->getName(),70);
619
+ $metaArray['desc'] = $this->modifieTailleVireHtml($productLoaded->getDescription(),200);
620
  $metaArray['keywords'] = $productLoaded->getData('meta_keywords');
621
+
622
+
623
+
624
  $description = $productLoaded->getDescription();
625
  $stock = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
626
  $ImageUrl = $productLoaded->getImageUrl();
649
 
650
  return $dataXml;
651
  }
652
+
653
+ public function modifieTailleVireHtml($productName, $stringLength)
654
+ {
655
+ if (strlen($productName) > $stringLength)
656
+ {
657
+ $productName = strip_tags($productName);
658
+ $productName = substr($productName, 0, $stringLength);
659
+ $last_space = strrpos($productName, " ");
660
+ $productName = substr($productName, 0, $last_space)."…";
661
+
662
+ }
663
+
664
+ return $productName;
665
+ }
666
+
667
+
668
 
669
  public function getStructure()
670
  {
673
  $structure[1]["type"]= "simple";
674
  $structure[1]["value"]= "sku";
675
 
676
+ $structure[2]["type"]= "special";
677
+ $structure[2]["value"]= "nom_rayon";
678
 
679
+ $structure[3]["type"]= "special";
680
+ $structure[3]["value"]= "nom_gamme";
681
 
682
+ $structure[4]["type"]= "simple";
683
+ $structure[4]["value"]= "name";
 
 
 
684
 
685
+ $structure[5]["type"]= "special";
686
+ $structure[5]["value"]= "nom_marque";
687
 
688
+ $structure[6]["type"]= "special";
689
+ $structure[6]["value"]= "price";
690
 
691
+ $structure[7]["type"]= "special";
692
+ $structure[7]["value"]= "ecotaxe";
 
 
 
693
 
694
+ $structure[8]["type"]= "simple";
695
+ $structure[8]["value"]= "short_description";
696
 
697
+ $structure[9]["type"]= "special";
698
+ $structure[9]["value"]= "description";
699
+
700
+ $structure[10]["type"]= "special";
701
+ $structure[10]["value"]= "is_in_stock";
702
 
703
+ $structure[11]["type"]= "special";
704
+ $structure[11]["value"]= "meta_title";
705
 
706
+ $structure[12]["type"]= "special";
707
+ $structure[12]["value"]= "meta_description";
708
 
709
+ $structure[13]["type"]= "special";
710
+ $structure[13]["value"]= "meta_keyword";
711
+
712
+ $structure[14]["type"]= "special";
713
+ $structure[14]["value"]= "special_price";
714
 
715
+ $structure[15]["type"]= "special";
716
+ $structure[15]["value"]= "delais";
717
 
718
  $structure[16]["type"]= "special";
719
+ $structure[16]["value"]= "frais_de_port";
720
+
721
+ $structure[17]["type"]= "special";
722
+ $structure[17]["value"]= "url";
723
+
724
+ $structure[18]["type"]= "special";
725
+ $structure[18]["value"]= "image_url";
726
+
727
+ $structure[19]["type"]= "special";
728
+ $structure[19]["value"]= "thumbnail_url";
729
 
730
+ $structure[20]["type"]= "pdm";
731
+ $structure[20]["value"]= "reference_constructeur";
732
 
733
+ $structure[21]["type"]= "pdm";
734
+ $structure[21]["value"]= "reference_fournisseur";
735
 
736
+ $structure[22]["type"]= "pdm";
737
+ $structure[22]["value"]= "code_ean";
738
+
739
+ $structure[23]["type"]= "pdm";
740
+ $structure[23]["value"]= "code_isbn";
741
 
742
+ $structure[24]["type"]= "nonrequired";
743
+ $structure[24]["value"]= "nom_rayon_gamme";
744
 
745
+ $structure[25]["type"]= "nonrequired";
746
+ $structure[25]["value"]= "weight";
 
 
 
747
 
748
+ $structure[26]["type"]= "nonrequired";
749
+ $structure[26]["value"]= "visible";
 
 
 
750
 
751
+ $structure[27]["type"]= "nonrequired";
752
+ $structure[27]["value"]= "stock";
753
 
754
+ $structure[28]["type"]= "nonrequired";
755
+ $structure[28]["value"]= "taux";
 
 
 
 
 
 
756
 
757
+ $structure[29]["type"]= "nonrequired";
758
+ $structure[29]["value"]= "remise";
759
+
760
+ $structure[30]["type"]= "options";
761
+ $structure[30]["value"]= "options";
762
 
763
  return $structure;
764
  }
app/code/community/Dnd/Shoppingflux/controllers/Adminhtml/ShoppingfluxController.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Dnd
5
+ * @package Dnd_Shoppingflux
6
+ * @author contact@dnd.fr
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+
10
+ class Dnd_Shoppingflux_Adminhtml_ShoppingfluxController extends Mage_Adminhtml_Controller_action
11
+ {
12
+ public $nombrePasseDeCent;
13
+ public $limit;
14
+ public $flux;
15
+
16
+ protected function _initAction() {
17
+ $this->loadLayout();
18
+
19
+ return $this;
20
+ }
21
+
22
+ public function updateAction(){
23
+
24
+ $this->_initAction()->renderLayout();
25
+
26
+ $shoppingModel = Mage::getModel("shoppingflux/flux"); // Chargement du module du flux
27
+
28
+ //si le module est actif
29
+ if(Mage::getStoreConfig('shoppingflux/general/active')==1){
30
+
31
+ $flux = '';
32
+ $flux .= $shoppingModel->getHeader();
33
+ $flux .= $shoppingModel->getBodyStart();
34
+
35
+ //création ecriture du fichier
36
+ chdir('shopping-flux/');
37
+ $myFile = "flux.xml";
38
+ $fh = fopen($myFile, 'w+') or die("Verifier le CHMod du repertoire shopping-flux");
39
+ fwrite($fh, $flux);
40
+ fclose($fh);
41
+
42
+
43
+ $nombrePasseDeCent = round((int)$shoppingModel->getCollecSize()/100);
44
+
45
+ } else {
46
+
47
+ $flux='Vous devez activer le module';
48
+
49
+ }
50
+
51
+
52
+ }
53
+
54
+ public function updateTierAction(){
55
+
56
+ $pass = $this->getRequest()->getParam('pass');
57
+ $limit = $this->getRequest()->getParam('limit');
58
+
59
+ if((int)$pass<=(int)$limit){
60
+
61
+ $passNext = (int)$pass+1;
62
+ $shoppingModel = Mage::getModel('shoppingflux/flux');
63
+ $flux = $shoppingModel->getAllProductsXml($pass);
64
+
65
+
66
+ echo '<li class="produit base"><img src='.Mage::getBaseUrl('web').'skin/adminhtml/default/default/images/success_msg_icon.gif'.' class="v-middle"/><span>Produits ajoutés au flux - Pass-'.$pass.'/'.$limit.'</span><span class="clear"></span></li>';
67
+
68
+ //gestion du fichier
69
+ chdir('shopping-flux/');
70
+ $myFile = "flux.xml";
71
+ $fh = fopen($myFile, 'a+') or die("Verifier le CHMod du repertoire shopping-flux");
72
+
73
+ fwrite($fh, $flux);
74
+ fclose($fh);
75
+
76
+ } else {
77
+
78
+ echo 'Probleme d\'argument';
79
+
80
+ }
81
+
82
+ if($pass==$limit){
83
+
84
+ echo '<li class="base"><img src='.Mage::getBaseUrl('web').'skin/adminhtml/default/default/images/note_msg_icon.gif'.' class="v-middle"/><span>Ecriture du fichier XML</span><span class="clear"></span></li>';
85
+
86
+ $flux = $shoppingModel->getBodyEnd();
87
+
88
+ //gestion du fichier
89
+ chdir('shopping-flux/');
90
+ $myFile = "flux.xml";
91
+ $fh = fopen($myFile, 'a+') or die("Verifier le CHMod du repertoire shopping-flux");
92
+
93
+ fwrite($fh, $flux);
94
+ fclose($fh);
95
+ }
96
+
97
+ }
98
+
99
+ }
app/code/community/Dnd/Shoppingflux/controllers/IndexController.php CHANGED
@@ -1,67 +1,18 @@
1
  <?php
 
 
 
 
 
 
 
 
2
  class Dnd_Shoppingflux_IndexController extends Mage_Core_Controller_Front_Action
3
  {
4
- public function indexAction()
5
- {
6
- header ("content-type: text/xml"); // Modification en-t�te HTTP - Content type XML
7
- $shoppingModel = Mage::getModel("shoppingflux/flux"); // Chargement du mod�le du flux
8
- $flux = $shoppingModel->getFlux(); // R�cup�ration du flux
9
-
10
- echo $flux; // Affichage du flux
11
  }
12
-
13
-
14
- public function debugAction()
15
- {
16
- $products = Mage::getResourceModel('catalog/product_collection')
17
- ->addAttributeToSelect('entity_id')
18
- ->addAttributeToFilter("status",1);
19
- //->addAttributeToFilter('visibility',array('in' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH));
20
-
21
-
22
-
23
-
24
- $configurable_product = Mage::getModel('catalog/product_type_configurable');
25
-
26
- $exclude=array();
27
-
28
-
29
- echo count($products);
30
-
31
- foreach($products as $product)
32
- {
33
-
34
- $parentIdArray = $configurable_product->getParentIdsByChild($product->getId());
35
-
36
-
37
- if(isset($parentIdArray) && $parentIdArray[0]!=''){
38
-
39
- $exclude[]=$product->getData('entity_id');
40
-
41
- }
42
-
43
-
44
- }
45
-
46
- $productsCollec = Mage::getResourceModel('catalog/product_collection')
47
- ->addAttributeToSelect('*')
48
- ->addAttributeToFilter("status",1)
49
- ->addAttributeToFilter('entity_id',array('nin'=>$exclude));
50
- //->addAttributeToFilter("sku",'BAOM008 ');
51
-
52
- echo count($productsCollec);
53
-
54
- foreach($productsCollec as $product)
55
- {
56
-
57
- $productsXml .= $this->getProductXml($product);
58
-
59
- }
60
-
61
-
62
-
63
- }
64
-
65
-
66
-
67
  }
1
  <?php
2
+
3
+ /**
4
+ * @category Dnd
5
+ * @package Dnd_Shoppingflux
6
+ * @author contact@dnd.fr
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+
10
  class Dnd_Shoppingflux_IndexController extends Mage_Core_Controller_Front_Action
11
  {
12
+ public function indexAction(){
13
+ header ("content-type: text/xml");
14
+ chdir('shopping-flux/');
15
+ $file = file_get_contents('flux.xml') or die('Impossible de trouver le fichier shopping-flux/flux.xml');
16
+ echo $file;
 
 
17
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
app/code/community/Dnd/Shoppingflux/etc/adminhtml.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Shopping-flux
5
+ * @package Dnd_Shoppingflux
6
+ * @author DnD
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <acl>
12
+ <resources>
13
+ <all>
14
+ <title>Allow Everything</title>
15
+ </all>
16
+ <admin>
17
+ <children>
18
+ <system>
19
+ <children>
20
+ <config>
21
+ <children>
22
+ <shoppingflux>
23
+ <title>Shopping Flux</title>
24
+ </shoppingflux>
25
+ </children>
26
+ </config>
27
+ </children>
28
+ </system>
29
+ </children>
30
+ </admin>
31
+ </resources>
32
+ </acl>
33
+ </config>
app/code/community/Dnd/Shoppingflux/etc/config.xml CHANGED
@@ -1,16 +1,16 @@
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
- * @category Effisys
5
- * @package Dnd_Shopoon
6
- * @author DnD
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
10
  <config>
11
  <modules>
12
  <Dnd_Shoppingflux>
13
- <version>1.1.0</version>
14
  </Dnd_Shoppingflux>
15
  </modules>
16
  <frontend>
@@ -22,38 +22,44 @@
22
  <frontName>shopping-flux</frontName>
23
  </args>
24
  </shoppingflux>
25
- </routers>
26
  </frontend>
 
 
 
 
 
 
 
 
 
 
 
27
  <adminhtml>
28
- <acl>
29
- <resources>
30
- <all>
31
- <title>Allow Everything</title>
32
- </all>
33
- <admin>
34
- <children>
35
- <system>
36
- <children>
37
- <config>
38
- <children>
39
- <shoppingflux>
40
- <title>Shopping Flux</title>
41
- </shoppingflux>
42
- </children>
43
- </config>
44
- </children>
45
- </system>
46
- </children>
47
- </admin>
48
- </resources>
49
- </acl>
50
- </adminhtml>
51
  <global>
52
  <models>
53
  <shoppingflux>
54
- <class>Dnd_Shoppingflux_Model</class>
55
  </shoppingflux>
56
  </models>
 
 
 
 
 
 
 
 
 
 
57
  <helpers>
58
  <shoppingflux>
59
  <class>Dnd_Shoppingflux_Helper</class>
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
+ * @category Dnd
5
+ * @package Dnd_Shoppingflux
6
+ * @author contact@dnd.fr
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
10
  <config>
11
  <modules>
12
  <Dnd_Shoppingflux>
13
+ <version>0.5.0</version>
14
  </Dnd_Shoppingflux>
15
  </modules>
16
  <frontend>
22
  <frontName>shopping-flux</frontName>
23
  </args>
24
  </shoppingflux>
25
+ </routers>
26
  </frontend>
27
+ <admin>
28
+ <routers>
29
+ <shoppingflux>
30
+ <use>admin</use>
31
+ <args>
32
+ <module>Dnd_Shoppingflux</module>
33
+ <frontName>shoppingflux</frontName>
34
+ </args>
35
+ </shoppingflux>
36
+ </routers>
37
+ </admin>
38
  <adminhtml>
39
+ <layout>
40
+ <updates>
41
+ <shoppingflux>
42
+ <file>shoppingflux.xml</file>
43
+ </shoppingflux>
44
+ </updates>
45
+ </layout>
46
+ </adminhtml>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  <global>
48
  <models>
49
  <shoppingflux>
50
+ <class>Dnd_Shoppingflux_Model</class>
51
  </shoppingflux>
52
  </models>
53
+ <blocks>
54
+ <adminhtml>
55
+ <rewrite>
56
+ <catalog_product>Dnd_Shoppingflux_Block_Catalog_Product</catalog_product>
57
+ </rewrite>
58
+ </adminhtml>
59
+ <shoppingflux>
60
+ <class>Dnd_Shoppingflux_Block</class>
61
+ </shoppingflux>
62
+ </blocks>
63
  <helpers>
64
  <shoppingflux>
65
  <class>Dnd_Shoppingflux_Helper</class>
app/code/community/Dnd/Shoppingflux/etc/system.xml CHANGED
@@ -1,4 +1,12 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
2
  <config>
3
  <sections>
4
  <shoppingflux translate="label" module="shoppingflux">
@@ -17,6 +25,34 @@
17
  <show_in_store>1</show_in_store>
18
  <sort_order>1</sort_order>
19
  <fields>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  <delai_livraison>
21
  <label>Valeur globale - Délai de livraison</label>
22
  <comment>Valeur appliquée au Délai de livraison pour tous les produits</comment>
@@ -45,6 +81,26 @@
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>1</show_in_store>
47
  </marque>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  </fields>
49
  </general>
50
  <marketplace translate="label">
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Shopping-flux
5
+ * @package Dnd_Shoppingflux
6
+ * @author DnD
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
  <config>
11
  <sections>
12
  <shoppingflux translate="label" module="shoppingflux">
25
  <show_in_store>1</show_in_store>
26
  <sort_order>1</sort_order>
27
  <fields>
28
+ <active>
29
+ <label>Activer le module Shopping-flux</label>
30
+ <comment>Avant d'activer le module, vous devez creer un répertoire nommé "shopping-flux" sur le root de votre magento</comment>
31
+ <frontend_type>select</frontend_type>
32
+ <sort_order>1</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ <source_model>adminhtml/system_config_source_yesno</source_model>
37
+ </active>
38
+ <configurable>
39
+ <label>Avez-vous des produits configurable ?</label>
40
+ <frontend_type>select</frontend_type>
41
+ <sort_order>2</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ <source_model>adminhtml/system_config_source_yesno</source_model>
46
+ </configurable>
47
+ <configurable_child>
48
+ <label>Si oui, les enfants de ces produits (produits associés) sont-il visibles dans le catalogue (attribut visibility)</label>
49
+ <frontend_type>select</frontend_type>
50
+ <sort_order>3</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ <source_model>adminhtml/system_config_source_yesno</source_model>
55
+ </configurable_child>
56
  <delai_livraison>
57
  <label>Valeur globale - Délai de livraison</label>
58
  <comment>Valeur appliquée au Délai de livraison pour tous les produits</comment>
81
  <show_in_website>1</show_in_website>
82
  <show_in_store>1</show_in_store>
83
  </marque>
84
+ <ecotaxe_active>
85
+ <label>Ecotaxe</label>
86
+ <comment>Vos produits ont-ils une écotaxe ?</comment>
87
+ <frontend_type>select</frontend_type>
88
+ <sort_order>10</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ <source_model>adminhtml/system_config_source_yesno</source_model>
93
+ </ecotaxe_active>
94
+ <ecotaxe>
95
+ <label>Attribut Ecotaxe</label>
96
+ <comment>Sélectionner le code de l'attribut pour l'ecotaxe (si vos produits ont une écotaxe)</comment>
97
+ <frontend_type>select</frontend_type>
98
+ <source_model>shoppingflux/attr</source_model>
99
+ <sort_order>12</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ </ecotaxe>
104
  </fields>
105
  </general>
106
  <marketplace translate="label">
app/design/adminhtml/default/default/layout/shoppingflux.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Dnd
5
+ * @package Dnd_Shoppingflux
6
+ * @author contact@dnd.fr
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+
11
+
12
+
13
+ <layout version="0.1.0">
14
+ <shoppingflux_adminhtml_shoppingflux_update>
15
+ <remove name="root"/>
16
+ <block type="core/template" name="convert_root" output="toHtml" template="shoppingflux/page.phtml">
17
+ <block type="adminhtml/page_head" name="convert_root_head" as="head" template="shoppingflux/head.phtml">
18
+ <action method="addJs"><script>prototype/prototype.js</script></action>
19
+ <action method="addJs"><script>prototype/validation.js</script></action>
20
+ <action method="addJs"><script>varien/js.js</script></action>
21
+ <action method="addJs"><script>mage/translate.js</script></action>
22
+ <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
23
+ </block>
24
+ <block type="shoppingflux/profile" as="process" template="shoppingflux/process.phtml"/>
25
+ </block>
26
+ </shoppingflux_adminhtml_shoppingflux_update>
27
+ </layout>
app/design/adminhtml/default/default/template/shoppingflux/head.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <title><?php echo htmlspecialchars(html_entity_decode($this->getTitle())) ?></title>
2
+ <meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>"/>
3
+
4
+ <link rel="icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon"/>
5
+ <link rel="shortcut icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon"/>
6
+
7
+ <script type="text/javascript">
8
+ var BLANK_URL = '<?php echo $this->getJsUrl() ?>blank.html';
9
+ var BLANK_IMG = '<?php echo $this->getJsUrl() ?>spacer.gif';
10
+ var BASE_URL = '<?php echo $this->getUrl('*') ?>';
11
+ var SKIN_URL = '<?php echo $this->getSkinUrl() ?>';
12
+ var FORM_KEY = '<?php echo $this->getFormKey() ?>';
13
+ </script>
14
+
15
+ <?php echo $this->getCssJsHtml() ?>
16
+
17
+ <?php if($this->getCanLoadExtJs()): ?>
18
+ <script type="text/javascript">
19
+ Ext.BLANK_IMAGE_URL = BLANK_IMG;
20
+ Ext.UpdateManager.defaults.loadScripts = false;
21
+ Ext.UpdateManager.defaults.disableCaching = true;
22
+ </script>
23
+ <?php endif; ?>
24
+
25
+ <?php if($this->getCanLoadTinyMce()): // TinyMCE is broken when loaded through index.php ?>
26
+ <script type="text/javascript" src="<?php echo $this->getJsUrl() ?>tiny_mce/tiny_mce.js"></script>
27
+ <?php endif; ?>
28
+
29
+
30
+ <?php echo $this->helper('core/js')->getTranslatorScript() ?>
31
+ <?php echo $this->getChildHtml('calendar'); ?>
32
+ <?php echo $this->getChildHtml('optional_zip_countries'); ?>
app/design/adminhtml/default/default/template/shoppingflux/page.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /*{
28
+ "label":"Root page layout",
29
+ "type":"core/template",
30
+ "children":{
31
+ "header":{ "label":"Header", "type":"adminhtml/page_header" },
32
+ "menu":{ "label":"Top navigation", "type":"adminhtml/page_menu" },
33
+ "breadcrumbs":{ "label":"Breadcrumbs", "type":"adminhtml/widget_breadcrumbs" },
34
+ "content":{ "label":"Content block", "type":"core/template" },
35
+ "left":{ "label":"Left navigation", "type":"core/template" },
36
+ "footer":{ "label":"Footer", "type":"adminhtml/page_footer" }
37
+ },
38
+ "vars":{}
39
+ }*/ ?>
40
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
41
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
42
+ <head>
43
+ <?php echo $this->getChildHtml('head') ?>
44
+ </head>
45
+
46
+ <body id="html-body"<?php echo $this->getBodyClass()?'class="'.$this->getBodyClass().'"':'' ?>>
47
+ <?php echo $this->getChildHtml('notification_window'); ?>
48
+ <div class="wrapper">
49
+ <?php echo $this->getChildHtml(); ?>
50
+ </div>
51
+ </body>
52
+ </html>
app/design/adminhtml/default/default/template/shoppingflux/process.phtml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Dnd
5
+ * @package Dnd_Shoppingflux
6
+ * @author contact@dnd.fr
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+
10
+ ?>
11
+ <style type="text/css" >
12
+ ul { list-style-type:none; padding:0; margin:0; }
13
+ li { margin-left:0; border:1px solid #ccc; margin:2px; padding:2px 2px 2px 2px; font:normal 12px sans-serif; }
14
+ img { margin-right:5px; }
15
+ .base{height:27px; -moz-border-radius: 4px 4px 4px 4px;
16
+ border: 0 none; background-color: #EFEFEF;
17
+ margin-top: 3px;}
18
+ .base span{float:left;margin-top:7px;}
19
+ .base img{margin:5px;float:left;}
20
+ .warning{background-color: rgb(255, 255, 221);}
21
+ .produit{background-color: rgb(221, 221, 255);}
22
+ .clear{display:block;clear:both;}
23
+ </style>
24
+ <script type="text/javascript">
25
+ var FORM_KEY = "<?php echo $this->getFormKey();?>";
26
+ </script>
27
+ <ul>
28
+ <li class="base">
29
+ <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif')?>" class="v-middle"/>
30
+ <span><?php echo $this->__("Démarrage de la mise à jour du flux");?></span>
31
+ <span class="clear"></span>
32
+ </li>
33
+ <li class="base">
34
+ <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif')?>" class="v-middle"/>
35
+ <span><?php echo 'Nombre de produits: '.$this->getProductTotal().' - L\'import se fera en '.$this->getLimit().' pass de 100 produits'; ?></span>
36
+ <span class="clear"></span>
37
+ </li>
38
+ <li class="base warning">
39
+ <img src="<?php echo $this->getSkinUrl('images/fam_bullet_error.gif');?>" class="v-middle"/>
40
+ <span><?php echo $this->__("Attention ne fermez pas cette fenêtre avant la fin de la mise à jour !");?></span>
41
+ <span class="clear"></span>
42
+ </li>
43
+ </ul>
44
+ <ul id="profileRows">
45
+ </ul>
46
+
47
+ <script type="text/javascript">
48
+
49
+
50
+ function launch(pass){
51
+
52
+
53
+ var limit = <?php echo $this->getLimit(); ?>;
54
+ var reloadurl = '<?php echo Mage::helper("adminhtml")->getUrl('shoppingflux/adminhtml_shoppingflux/updateTier/') ?>pass/'+pass+'/limit/'+limit;
55
+ new Ajax.Request(reloadurl,{
56
+ method: 'get',
57
+ parameters: "",
58
+ onComplete: function(transport) {
59
+
60
+ $('profileRows').innerHTML += transport.responseText;
61
+ pass=parseInt(pass)+1;
62
+
63
+ if(pass<=limit){
64
+
65
+ launch(pass);
66
+
67
+ } else {
68
+
69
+ $('profileRows').innerHTML +='<li class="base"><img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif')?>" class="v-middle"/><span><?php echo $this->__("Fin de la mise à jour du flux !");?></span><span class="clear"></span></li><li class="base warning"><img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif')?>" class="v-middle"/><span><?php echo 'Le flux est accessible à l url suivante : <a href="'.Mage::getBaseUrl().'shopping-flux/index" target="_blank">'.Mage::getBaseUrl().'shopping-flux/index</a>'; ?></span><span class="clear"></span></li>';
70
+
71
+ }
72
+
73
+ }
74
+ });
75
+ }
76
+
77
+ launch(1);
78
+ </script>
79
+
80
+
app/design/adminhtml/default/default/template/shoppingflux/test.phtml ADDED
@@ -0,0 +1 @@
 
1
+ test
app/etc/modules/Dnd_Shoppingflux.xml CHANGED
@@ -1,9 +1,17 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Dnd_Shoppingflux>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </Dnd_Shoppingflux>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Dnd
5
+ * @package Dnd_Shoppingflux
6
+ * @author ModuleCreator
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Dnd_Shoppingflux>
13
+ <active>true</active>
14
+ <codePool>community</codePool>
15
+ </Dnd_Shoppingflux>
16
+ </modules>
17
+ </config>
package.xml CHANGED
@@ -1,19 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Dnd_Shoppingflux</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
- <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>G&#xE9;n&#xE8;re le flux catalogue pour le r&#xE9;f&#xE9;rencement des produits sur Shopping Flux</summary>
10
  <description>Shopping-Flux est le logiciel de gestion de Comparateurs de Prix et des Places de March&#xE9;s &#xE9;dit&#xE9; par la soci&#xE9;t&#xE9; sp&#xE9;cialis&#xE9;e en g&#xE9;n&#xE9;ration de trafic pour Ecommerce : Blog-Ecommerce.com.
11
  Avec Shopping-Flux, vous gagnerez en temps et en rentabilit&#xE9; pour votre visibilit&#xE9; sur les comparateurs de prix. Et pour ce qui concerne les places de march&#xE9;s, Shopping Flux permet d&#x2019;optimiser les flux de vos produits et de r&#xE9;cup&#xE9;rer vos commandes dans votre back-office.</description>
12
  <notes>More good things to come</notes>
13
- <authors><author><name>Agence DnD</name><user>auto-converted</user><email>cd@dnd.fr</email></author></authors>
14
- <date>2011-02-03</date>
15
- <time>10:52:52</time>
16
- <contents><target name="magecommunity"><dir name="Dnd"><dir name="Shoppingflux"><dir name="controllers"><file name="IndexController.php" hash="fd7b7d208df1f6f63ec545973645565d"/></dir><dir name="etc"><file name="config.xml" hash="37229f04e5f21557ea206cd2c46a4b07"/><file name="system.xml" hash="ccf5da305c545f9cf68326fd0eacef2a"/></dir><dir name="Helper"><file name="Data.php" hash="5c8b44fc0207438788a48e2b0f46af90"/></dir><dir name="Model"><file name="Attr.php" hash="34081165efd36c7726d7f4eae7592a4a"/><file name="Flux.php" hash="1f66b14ff157bc854ce978fa9516c61e"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Dnd_Shoppingflux.xml" hash="d531b5446cf40eee7c42394463341885"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies/>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Dnd_Shoppingflux</name>
4
+ <version>0.6.0</version>
5
  <stability>stable</stability>
6
+ <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>G&#xE9;n&#xE8;re le flux catalogue pour le r&#xE9;f&#xE9;rencement des produits sur Shopping Flux</summary>
10
  <description>Shopping-Flux est le logiciel de gestion de Comparateurs de Prix et des Places de March&#xE9;s &#xE9;dit&#xE9; par la soci&#xE9;t&#xE9; sp&#xE9;cialis&#xE9;e en g&#xE9;n&#xE9;ration de trafic pour Ecommerce : Blog-Ecommerce.com.
11
  Avec Shopping-Flux, vous gagnerez en temps et en rentabilit&#xE9; pour votre visibilit&#xE9; sur les comparateurs de prix. Et pour ce qui concerne les places de march&#xE9;s, Shopping Flux permet d&#x2019;optimiser les flux de vos produits et de r&#xE9;cup&#xE9;rer vos commandes dans votre back-office.</description>
12
  <notes>More good things to come</notes>
13
+ <authors><author><name>Agence Dn'D</name><user>auto-converted</user><email>contact@dnd.fr</email></author></authors>
14
+ <date>2011-03-08</date>
15
+ <time>18:01:43</time>
16
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="shoppingflux.xml" hash="69a430b5fa91e580b1cb6cc83e599fe7"/></dir><dir name="template"><dir name="shoppingflux"><file name="head.phtml" hash="5a32bd004231734aa5dd173b7227d3c1"/><file name="page.phtml" hash="be343808d1d39ce8abe2cbc02d9e6f3f"/><file name="process.phtml" hash="c8df6b345d5e37a643b08073d698ac14"/><file name="test.phtml" hash="098f6bcd4621d373cade4e832627b4f6"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Dnd"><dir name="Shoppingflux"><dir name="Block"><dir name="Catalog"><file name="Product.php" hash="2b60fd1ffe51c499eb6263f82b0287b9"/></dir><file name="Profile.php" hash="487de708e8302264ef0c0ad5ffaf9300"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShoppingfluxController.php" hash="aab0ab83cd0814dce5b591556c121c51"/></dir><file name="IndexController.php" hash="670dd88e31847191e261a9d82906d145"/></dir><dir name="etc"><file name="adminhtml.xml" hash="cc949dad3c446a405a2809d77fd6dfa4"/><file name="config.xml" hash="06d654992e517645ff7e785b73421fa2"/><file name="system.xml" hash="80432d1f2abb118336704129edd25b51"/></dir><dir name="Helper"><file name="Data.php" hash="0cf0456e0a3a8c74441f3d2f5cbd889e"/></dir><dir name="Model"><file name="Attr.php" hash="973119e2362af3fde701bbbc89bf8389"/><file name="Flux.php" hash="7aecb99ec3b69bb4584f47e031b6c99f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Dnd_Shoppingflux.xml" hash="be92dff453389c9ab9dc126fbe40c60f"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies/>
19
  </package>