Lengow_Export - Version 1.1.4

Version Notes

Version 1.1.4
- correction gestion des attributs

Version 1.1.2
-gestion des attributs

Version 1.1.1
-Fix Bug with XML cdata

Version 1.1.0
-Fix Bug with setHeader

Version 1.0.0
-1st release

Download this release

Release Info

Developer Magento Core Team
Extension Lengow_Export
Version 1.1.4
Comparing to
See all releases


Code changes from version 1.1.3 to 1.1.4

app/code/local/Lengow/Export/Model/Observer.php ADDED
File without changes
app/code/local/Lengow/Export/Model/Products.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magentix_BeezUp_Model_Products extends Mage_Core_Model_Abstract {
4
+
5
+ public function getProducts() {
6
+ $products = Mage::getResourceModel('catalog/product_collection')
7
+ ->addAttributeToFilter('status',1)
8
+ ->addAttributeToFilter('visibility',array('in'=>array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG, Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)))
9
+ ->addAttributeToFilter('price',array('neq'=>0))
10
+ ->addAttributeToSelect('name')
11
+ ->addAttributeToSelect('weight')
12
+ ->addAttributeToSelect('sku')
13
+ ->addAttributeToSelect('price')
14
+ ->addAttributeToSelect('special_price')
15
+ ->addAttributeToSelect('small_image')
16
+ ->addAttributeToSelect(Mage::getStoreConfig('beezup/flux/description'))
17
+ ->addStoreFilter();
18
+
19
+ $attributes = explode(',',Mage::getStoreConfig('beezup/flux/attributes'));
20
+ foreach($attributes as $a) $products->addAttributeToSelect($a);
21
+
22
+ if(Mage::getStoreConfig('beezup/flux/debug_flux')) $products->setPageSize(10);
23
+
24
+ return $products;
25
+ }
26
+
27
+ public function f($tagName,$content,$data=0) {
28
+ $result = '<'.$tagName.'>';
29
+ if($data) $result .= '<![CDATA[';
30
+ $result .= preg_replace('(^'.Mage::helper('beezup')->__('No').'$)','',trim($content));
31
+ if($data) $result .= ']]>';
32
+ $result .= '</'.$tagName.'>';
33
+ return $result;
34
+ }
35
+
36
+ public function getQty($id,$qty=0) {
37
+ $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($id);
38
+ if($stockItem->getManageStock()) {
39
+ if($stockItem->getIsInStock()) {
40
+ $qty = intval($stockItem->getQty());
41
+ $qty = ($qty <= 0) ? 0 : $qty;
42
+ }
43
+ } else {
44
+ $qty = 100;
45
+ }
46
+ return $qty;
47
+ }
48
+
49
+ public function getWeight($weight,$tablerates) {
50
+ $shipping_amount = 0;
51
+
52
+ if($tablerates && $tablerates instanceof Mage_Shipping_Model_Mysql4_Carrier_Tablerate_Collection) {
53
+ foreach($tablerates as $t) {
54
+ if($weight <= $t->getConditionValue()) $shipping_amount = $t->getPrice();
55
+ }
56
+ } else {
57
+ $shipping_amount = preg_replace('(\,+)','.',trim(Mage::getStoreConfig('beezup/flux/ship')));
58
+ if(!is_numeric($shipping_amount)) $shipping_amount = 0;
59
+ }
60
+ return $shipping_amount;
61
+ }
62
+
63
+ public function getTablerates() {
64
+ return Mage::getResourceModel('shipping/carrier_tablerate_collection')->setOrder('condition_value','desc');
65
+ }
66
+
67
+ public function getIsStock($qty) {
68
+ return ($qty > 0) ? Mage::helper('beezup')->__('In Stock') : Mage::helper('beezup')->__('Out of Stock');
69
+ }
70
+
71
+ public function getLivraison($qty) {
72
+ return ($qty > 0) ? Mage::getStoreConfig('beezup/flux/days_in') : Mage::getStoreConfig('beezup/flux/days_out');
73
+ }
74
+
75
+ public function getCategoriesAsArray($categories,$parent='',&$cats=array()) {
76
+ foreach($categories as $c) {
77
+ $cats[$c['entity_id']] = $parent.$c['name'];
78
+ if(isset($c['children_nodes'])) {
79
+ $this->getCategoriesAsArray($c['children_nodes'],$parent.$c['name'].'||',$cats);
80
+ }
81
+ }
82
+ return $cats;
83
+ }
84
+
85
+ public function getProductsCategories($product,$sc) {
86
+ $categories = $product->getCategoryIds();
87
+ $result = array();
88
+ if(count($categories)) {
89
+ if(isset($sc[$categories[(count($categories)-1)]])) $result = explode('||',$sc[$categories[(count($categories)-1)]]);
90
+ }
91
+ return $result;
92
+ }
93
+
94
+ public function getStore() { return Mage::app()->getStore(); }
95
+
96
+ }
app/code/local/Lengow/Export/Model/System/Config/Source/Attributes.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magentix_BeezUp_Model_System_Config_Source_Attributes {
4
+
5
+ public function toOptionArray() {
6
+
7
+ $attribute = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId());
8
+ $attributeArray = array();
9
+
10
+ foreach ($attribute as $option) {
11
+ if($option->getIsUserDefined() && $option->getFrontendLabel()) {
12
+ $attributeArray[] = array('value'=>$option->getAttributeCode(),'label'=>$option->getAttributeCode());
13
+ }
14
+ }
15
+
16
+ return $attributeArray;
17
+ }
18
+
19
+ }
app/code/local/Lengow/Export/Model/System/Config/Source/Categories.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Lengow_Export_Model_System_Config_Source_Categories {
4
+
5
+ public function toOptionArray() {
6
+
7
+ $attribute = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId());
8
+ $attributeArray = array();
9
+
10
+ foreach ($attribute as $option) {
11
+ if($option->getIsUserDefined() && $option->getFrontendLabel()) {
12
+ $attributeArray[] = array('value'=>$option->getAttributeCode(),'label'=>$option->getAttributeCode());
13
+ }
14
+ }
15
+
16
+ return $attributeArray;
17
+ }
18
+
19
+ }
app/code/local/Lengow/Export/Model/System/Config/Source/Description.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magentix_BeezUp_Model_System_Config_Source_Description {
4
+
5
+ public function toOptionArray() {
6
+ return array(
7
+ array('value'=>'short_description', 'label'=>Mage::helper('beezup')->__('Short Description')),
8
+ array('value'=>'description', 'label'=>Mage::helper('beezup')->__('Description')),
9
+ array('value'=>'meta_description', 'label'=>Mage::helper('beezup')->__('Meta Description')),
10
+ );
11
+ }
12
+
13
+ }
app/code/local/Lengow/Export/Model/System/Config/Source/Price.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magentix_BeezUp_Model_System_Config_Source_Price {
4
+
5
+ public function toOptionArray() {
6
+ return array(
7
+ array('value'=>1, 'label'=>Mage::helper('beezup')->__('Excl. Tax')),
8
+ array('value'=>0, 'label'=>Mage::helper('beezup')->__('Incl. Tax')),
9
+ );
10
+ }
11
+
12
+ }
app/code/local/Lengow/Export/controllers/IndexController.php CHANGED
@@ -103,6 +103,7 @@ class Lengow_Export_IndexController extends Mage_Core_Controller_Front_Action
103
  $product_data['stock_descrip']=$product->getStockItem()->getQty();
104
  $product_data['link']=$product->getProductUrl();
105
  $product_data['image_link']=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product'.$product->getImage();
 
106
  $product_data['shipping_rate']='voir site';
107
  //GESTION DE LA CATEGORIE
108
  $product_type = '';
@@ -117,9 +118,9 @@ class Lengow_Export_IndexController extends Mage_Core_Controller_Front_Action
117
  {
118
  $code = $attribute['attribute_code'];
119
  $is_user_defined = $attribute['is_user_defined'];
120
- $value = $product->getResource()->getAttribute($code)->getFrontend()->getValue($product);
121
  if($is_user_defined==1)
122
  {
 
123
  // echo "code:".($code)." - value:".$value."\n";
124
  $product_data[$code]=$value;
125
  }
103
  $product_data['stock_descrip']=$product->getStockItem()->getQty();
104
  $product_data['link']=$product->getProductUrl();
105
  $product_data['image_link']=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product'.$product->getImage();
106
+
107
  $product_data['shipping_rate']='voir site';
108
  //GESTION DE LA CATEGORIE
109
  $product_type = '';
118
  {
119
  $code = $attribute['attribute_code'];
120
  $is_user_defined = $attribute['is_user_defined'];
 
121
  if($is_user_defined==1)
122
  {
123
+ $value = $product->getResource()->getAttribute($code)->getFrontend()->getValue($product);
124
  // echo "code:".($code)." - value:".$value."\n";
125
  $product_data[$code]=$value;
126
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Lengow_Export</name>
4
- <version>1.1.3</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>
@@ -11,7 +11,11 @@
11
 
12
  Le principe est que la solution r&amp;eacute;cup&amp;egrave;re le catalogue produits du marchand, configure, optimise et tracke les informations des campagnes marchandes afin de restituer &amp;agrave; l&amp;apos;e-commer&amp;ccedil;ant les statistiques sous forme de tableaux de bords et graphiques.
13
  Ce processus permet aux e-commer&amp;ccedil;ants d&amp;apos;optimiser leurs flux et leurs co&amp;ucirc;ts d&amp;apos;acquisition sur chaque support de diffusion.</description>
14
- <notes>Version 1.1.2
 
 
 
 
15
  -gestion des attributs
16
 
17
  Version 1.1.1
@@ -23,9 +27,9 @@ Version 1.1.0
23
  Version 1.0.0
24
  -1st release</notes>
25
  <authors><author><name>Lengow</name><user>auto-converted</user><email>technique@lengow.com</email></author></authors>
26
- <date>2010-08-25</date>
27
- <time>17:04:00</time>
28
- <contents><target name="magelocale"><dir name="en_US"><file name="Lengow_Export.csv" hash="abeaea80f731b4fa350091e0807cdbee"/><file name="Lengow_Information.csv" hash="86986a0717caed093e4178acf407f26c"/></dir><dir name="fr_FR"><file name="Lengow_Export.csv" hash="0bc75b767e6a51b07748f2362ff3f6f2"/><file name="Lengow_Information.csv" hash="cab993c6e862f67cef4a05229cbb2026"/></dir></target><target name="magelocal"><dir name="Lengow"><dir name="Export"><dir name="controllers"><file name="IndexController.php" hash="75e34a60107d73e985842bd7d50556af"/></dir><dir name="etc"><file name="config.xml" hash="8210a1ad7fd08092b95a55de0498092c"/><file name="system.xml" hash="da7eb0bc7e16b26bae938a79fe4f5e05"/></dir><dir name="Helper"><file name="Data.php" hash="9bb8759af094885106efb1a53fe98b07"/></dir></dir><dir name="Information"><dir name="etc"><file name="config.xml" hash="c83d19a3acd4186b7b2ea4f92abc8104"/><file name="system.xml" hash="e16fa28f8249be84adf447c099adeb95"/></dir><dir name="Helper"><file name="Data.php" hash="8063a9cfe2cf944b1d1a6ac65a6b57d0"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Lengow_All.xml" hash="d212244e63e3d5dd55d33981a9d725bf"/></dir></target></contents>
29
  <compatible/>
30
  <dependencies/>
31
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Lengow_Export</name>
4
+ <version>1.1.4</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>
11
 
12
  Le principe est que la solution r&amp;eacute;cup&amp;egrave;re le catalogue produits du marchand, configure, optimise et tracke les informations des campagnes marchandes afin de restituer &amp;agrave; l&amp;apos;e-commer&amp;ccedil;ant les statistiques sous forme de tableaux de bords et graphiques.
13
  Ce processus permet aux e-commer&amp;ccedil;ants d&amp;apos;optimiser leurs flux et leurs co&amp;ucirc;ts d&amp;apos;acquisition sur chaque support de diffusion.</description>
14
+ <notes>Version 1.1.4
15
+ - correction gestion des attributs
16
+
17
+
18
+ Version 1.1.2
19
  -gestion des attributs
20
 
21
  Version 1.1.1
27
  Version 1.0.0
28
  -1st release</notes>
29
  <authors><author><name>Lengow</name><user>auto-converted</user><email>technique@lengow.com</email></author></authors>
30
+ <date>2010-10-27</date>
31
+ <time>10:11:30</time>
32
+ <contents><target name="magelocale"><dir name="en_US"><file name="Lengow_Export.csv" hash="abeaea80f731b4fa350091e0807cdbee"/><file name="Lengow_Information.csv" hash="86986a0717caed093e4178acf407f26c"/></dir><dir name="fr_FR"><file name="Lengow_Export.csv" hash="0bc75b767e6a51b07748f2362ff3f6f2"/><file name="Lengow_Information.csv" hash="cab993c6e862f67cef4a05229cbb2026"/></dir></target><target name="magelocal"><dir name="Lengow"><dir name="Export"><dir name="controllers"><file name="IndexController.php" hash="8052561fb25978564bf5ce46a783745a"/></dir><dir name="etc"><file name="config.xml" hash="8210a1ad7fd08092b95a55de0498092c"/><file name="system.xml" hash="da7eb0bc7e16b26bae938a79fe4f5e05"/></dir><dir name="Helper"><file name="Data.php" hash="9bb8759af094885106efb1a53fe98b07"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Attributes.php" hash="1f9b623b2fe75aed7280ae9dbf6c9d62"/><file name="Categories.php" hash="9c2df4085d47dd5efec5b4cc2c2e501f"/><file name="Description.php" hash="05d45757cd5d7e2c463c2574b41d9415"/><file name="Price.php" hash="1bcaf8701c4d0313b26c2bd4c0c82c1c"/></dir></dir></dir><file name="Observer.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="Products.php" hash="ab33c014221ed4d4a81fa9af2a54fab7"/></dir></dir><dir name="Information"><dir name="etc"><file name="config.xml" hash="c83d19a3acd4186b7b2ea4f92abc8104"/><file name="system.xml" hash="e16fa28f8249be84adf447c099adeb95"/></dir><dir name="Helper"><file name="Data.php" hash="8063a9cfe2cf944b1d1a6ac65a6b57d0"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Lengow_All.xml" hash="d212244e63e3d5dd55d33981a9d725bf"/></dir></target></contents>
33
  <compatible/>
34
  <dependencies/>
35
  </package>