How to attach files using dataflow product import for Magento Aitoc Useful Downloads

Thanks to Aitoc for a handy extension, Useful Downloads, which allows downloads/attachments to be added to a normal simple product.

We recently implemented this for a client but realised it lacked a little in functionality. We wanted to import a batch of new products, and add attachments at the same time (much like you would with images). Unfortunately, the Useful Downloads only allows you to add downloads using the GUI.

So we built a little piggyback module that depends on Aitoc Useful Downloads, which allows you to add another column in your import spreadsheet to specify files to upload.

How it works

In your import CSV/XML, add an extra column useful_downloads, so your first line looks like this:

"store","websites","attribute_set","type","category_ids","sku","has_options","name","url_key","gift_message_available","country_of_origin","size","ingredients","meta_title","meta_description","image","small_image","thumbnail","custom_design","page_layout","options_container","aitfiles_title","url_path","status","visibility","color","manufacturer","tax_class_id","enable_googlecheckout","is_recurring","price","special_price","cost","weight","description","short_description","meta_keyword","custom_layout_update","news_from_date","news_to_date","special_from_date","special_to_date","custom_design_from","custom_design_to","qty","min_qty","use_config_min_qty","is_qty_decimal","backorders","use_config_backorders","min_sale_qty","use_config_min_sale_qty","max_sale_qty","use_config_max_sale_qty","is_in_stock","low_stock_date","notify_stock_qty","use_config_notify_stock_qty","manage_stock","use_config_manage_stock","stock_status_changed_automatically","use_config_qty_increments","qty_increments","use_config_enable_qty_increments","enable_qty_increments","product_name","store_id","product_type_id","product_status_changed","product_changed_websites","useful_downloads"

Then for each product, you specify the files to be uploaded. Much like with image upload, the path is always relative to ./media/import. Upload your files to ./media/import and set the file name relative to this, always starting with a leading slash (/). For example:

"admin","base","Oneway_default","simple","","default","0","default","default","Use config","","","","","","","","","","No layout updates.","Block after Info Column","Useful Downloads","default.html","Enabled","Catalog, Search","","","Taxable Goods","Yes","No","1.0000","","","1.0000","default","default","","","","","","","","","0.0000","0.0000","1","0","0","1","1.0000","1","0.0000","1","0","2010-09-14 18:28:10","","1","0","1","1","1","0.0000","1","0","default","0","simple","","","Product title 1||/file_one.pdf,Product title 2||/file_two.pdf"

Syntax for 1 file "Product title 1||/file_one.pdf"

Syntax for multiple files "Product title 1||/file_one.pdf,Product title 2||/file_two.pdf"

Simply comma separate each new file

Then run your normal product import via dataflow and it will automatically attach your download files at the same time.

downloadlink

Please note. This extension depends on Aitoc's Useful Downloads extension!

[syntaxhighlighter]