4

I have created custom gallery extension but I need to implement an import and export or gallery data in the CSV Format.

I did too much research but couldn't find any useful link to find solution so please let me know if anybody had idea for this.

davidalger
  • 7,296
  • 1
  • 30
  • 47
Vikrant Roy
  • 123
  • 2
  • 16

1 Answers1

4

For a CSV exports you can generate a grid with your data and use the getCsv() function. Sounds overhead, but that's exactly what the export of the Tablerates shipping cost table in the backend does.

See: Mage_Adminhtml_System_ConfigController::exportTableratesAction and Mage_Adminhtml_Block_Shipping_Carrier_Tablerate_Grid.

For the import you could also have a look at this module (Mage_Shipping_Model_Resource_Carrier_Tablerate::uploadAndImport) or on the import module for product data (Mage_ImportExport), but this is much more complicated.

Alex
  • 13,817
  • 19
  • 82
  • 163