DigitalPianism_ProductExport - Version 1.3.0

Version Notes

- Add the description, short description and main image URL to the exported data

Download this release

Release Info

Developer Digital Pianism
Extension DigitalPianism_ProductExport
Version 1.3.0
Comparing to
See all releases


Code changes from version 1.2.0 to 1.3.0

app/code/community/DigitalPianism/ProductExport/Test/Config/Main.php CHANGED
@@ -12,7 +12,7 @@ class DigitalPianism_ProductExport_Test_Config_Main extends EcomDev_PHPUnit_Test
12
  {
13
  // Testing configuration
14
  $this->assertModuleCodePool('local');
15
- $this->assertModuleVersion("1.2.0");
16
  $this->assertModuleDepends('Mage_Adminhtml');
17
  }
18
 
12
  {
13
  // Testing configuration
14
  $this->assertModuleCodePool('local');
15
+ $this->assertModuleVersion("1.3.0");
16
  $this->assertModuleDepends('Mage_Adminhtml');
17
  }
18
 
app/code/community/DigitalPianism/ProductExport/controllers/Adminhtml/ProductexportController.php CHANGED
@@ -22,7 +22,7 @@ class DigitalPianism_ProductExport_Adminhtml_ProductexportController extends Mag
22
  }
23
  else {
24
  //write headers to the csv file
25
- $content = "id,name,url,sku,price,special_price\n";
26
  try {
27
 
28
  $collection = Mage::getResourceModel('catalog/product_collection')
@@ -41,6 +41,30 @@ class DigitalPianism_ProductExport_Adminhtml_ProductexportController extends Mag
41
  'inner',
42
  $store->getId()
43
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  $collection->joinAttribute(
45
  'price',
46
  'catalog_product/price',
@@ -58,11 +82,16 @@ class DigitalPianism_ProductExport_Adminhtml_ProductexportController extends Mag
58
  $store->getId()
59
  );
60
  } else {
61
- $collection->addAttributeToSelect(array('name','price','special_price'));
62
  }
63
 
64
  foreach ($collection as $product) {
65
- $content .= "\"{$product->getId()}\",\"{$product->getName()}\",\"{$product->setStoreId($store->getId())->getProductUrl()}\",\"{$product->getSku()}\",\"{$product->getPrice()}\",\"{$product->getSpecialPrice()}\"\n";
 
 
 
 
 
66
  }
67
  } catch (Exception $e) {
68
  $this->_getSession()->addError($e->getMessage());
22
  }
23
  else {
24
  //write headers to the csv file
25
+ $content = "id,name,url,sku,price,special_price,description,short_description,main_image\n";
26
  try {
27
 
28
  $collection = Mage::getResourceModel('catalog/product_collection')
41
  'inner',
42
  $store->getId()
43
  );
44
+ $collection->joinAttribute(
45
+ 'description',
46
+ 'catalog_product/description',
47
+ 'entity_id',
48
+ null,
49
+ 'inner',
50
+ $store->getId()
51
+ );
52
+ $collection->joinAttribute(
53
+ 'short_description',
54
+ 'catalog_product/short_description',
55
+ 'entity_id',
56
+ null,
57
+ 'inner',
58
+ $store->getId()
59
+ );
60
+ $collection->joinAttribute(
61
+ 'image',
62
+ 'catalog_product/image',
63
+ 'entity_id',
64
+ null,
65
+ 'inner',
66
+ $store->getId()
67
+ );
68
  $collection->joinAttribute(
69
  'price',
70
  'catalog_product/price',
82
  $store->getId()
83
  );
84
  } else {
85
+ $collection->addAttributeToSelect(array('name','price','special_price','description','short_description','image'));
86
  }
87
 
88
  foreach ($collection as $product) {
89
+ if ("no_selection" == $product->getImage()) {
90
+ $productImage = "";
91
+ } else {
92
+ $productImage = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage());
93
+ }
94
+ $content .= "\"{$product->getId()}\",\"{$product->getName()}\",\"{$product->setStoreId($store->getId())->getProductUrl()}\",\"{$product->getSku()}\",\"{$product->getPrice()}\",\"{$product->getSpecialPrice()}\",\"{$product->getDescription()}\",\"{$product->getShortDescription()}\",\"{$productImage}\"\n";
95
  }
96
  } catch (Exception $e) {
97
  $this->_getSession()->addError($e->getMessage());
app/code/community/DigitalPianism/ProductExport/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <DigitalPianism_ProductExport>
5
- <version>1.2.0</version>
6
  </DigitalPianism_ProductExport>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <DigitalPianism_ProductExport>
5
+ <version>1.3.0</version>
6
  </DigitalPianism_ProductExport>
7
  </modules>
8
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>DigitalPianism_ProductExport</name>
4
- <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -24,11 +24,11 @@
24
  &#xD;
25
  &lt;p&gt;Install the module manually or via Magento Connect&lt;/p&gt;&#xD;
26
  &lt;p&gt;Then login to the backend and flush your cache&lt;/p&gt;</description>
27
- <notes>- Support for store specific data export</notes>
28
  <authors><author><name>Digital Pianism</name><user>digitalpianism</user><email>contact@digital-pianism.com</email></author></authors>
29
  <date>2016-03-23</date>
30
- <time>09:54:17</time>
31
- <contents><target name="magecommunity"><dir name="DigitalPianism"><dir name="ProductExport"><dir name="Model"><file name="Observer.php" hash="8c252797bb368a36c0ac09afe55a5394"/></dir><dir name="Test"><dir name="Config"><file name="Main.php" hash="015b51901e97af52d641c088a4d799ce"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ProductexportController.php" hash="efc22ee69391282e419f2138df2f55ca"/></dir></dir><dir name="etc"><file name="config.xml" hash="b8356f4331d01ef9d806f7171bf9feff"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DigitalPianism_ProductExport.xml" hash="6cdbc2897d42c0d1d4d682ad613e244f"/></dir></target></contents>
32
  <compatible/>
33
  <dependencies><required><php><min>4.1.0</min><max>6.0.0</max></php></required></dependencies>
34
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>DigitalPianism_ProductExport</name>
4
+ <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
24
  &#xD;
25
  &lt;p&gt;Install the module manually or via Magento Connect&lt;/p&gt;&#xD;
26
  &lt;p&gt;Then login to the backend and flush your cache&lt;/p&gt;</description>
27
+ <notes>- Add the description, short description and main image URL to the exported data</notes>
28
  <authors><author><name>Digital Pianism</name><user>digitalpianism</user><email>contact@digital-pianism.com</email></author></authors>
29
  <date>2016-03-23</date>
30
+ <time>13:04:43</time>
31
+ <contents><target name="magecommunity"><dir name="DigitalPianism"><dir name="ProductExport"><dir name="Model"><file name="Observer.php" hash="8c252797bb368a36c0ac09afe55a5394"/></dir><dir name="Test"><dir name="Config"><file name="Main.php" hash="2c882ca08364c4a477b73474686f1fd8"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ProductexportController.php" hash="e104445c38b0ef06e63c96769bcf43fe"/></dir></dir><dir name="etc"><file name="config.xml" hash="295e2345f5e34451574ce66bff0cdb41"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DigitalPianism_ProductExport.xml" hash="6cdbc2897d42c0d1d4d682ad613e244f"/></dir></target></contents>
32
  <compatible/>
33
  <dependencies><required><php><min>4.1.0</min><max>6.0.0</max></php></required></dependencies>
34
  </package>