roastchicken Posted April 30, 2010 Share Posted April 30, 2010 Hi allI've played around with the import tool and now can import csv format. Can import images and text.Is it possible to import pdf files for the attachment section ?Thanks again everyone Link to comment Share on other sites More sharing options...
rocky Posted May 1, 2010 Share Posted May 1, 2010 No, it is impossible to import attachments via CSV at the moment. I'm not aware of any module that does this either. Link to comment Share on other sites More sharing options...
dark_effie Posted January 8, 2011 Share Posted January 8, 2011 Thank you for the information. Link to comment Share on other sites More sharing options...
dark_effie Posted January 8, 2011 Share Posted January 8, 2011 How about attaching file (e.g. pdf, doc, zip, jpg) to an email? i know the three index(content, name, mime) of a variable $fileAttachment in Mail::send() function but i dont know how to attach the file if it is inside your upload folder. Link to comment Share on other sites More sharing options...
dark_effie Posted January 11, 2011 Share Posted January 11, 2011 Problem Solved.If you have the same problem then this link will help you: /http://www.prestashop.com/forums/viewthread/75045/ Link to comment Share on other sites More sharing options...
TWDesign Posted February 17, 2012 Share Posted February 17, 2012 WTF? Not solved I think. That thread concerns email attachments. Not product attachments 1 Link to comment Share on other sites More sharing options...
4mdev Posted February 22, 2013 Share Posted February 22, 2013 (edited) As rocky pointed out, there's no importer to do this currently. If like me however you're now forced to roll your own, I googled for the relevant code and this was the first result. As such, I want to leave some notes for anyone else who's looking to do the same thing. This code is taken from sections of controllers/admin/AdminProductsController.php from AdminProductsController::processAddAttachments(). $filename = 'myfile.pdf'; $id_product = 123; // Generate unique filename do $uniqid = sha1(microtime()); while (file_exists(_PS_DOWNLOAD_DIR_.$uniqid)); // Copy file to target copy($_FILES['attachment_file']['tmp_name'], _PS_DOWNLOAD_DIR_.$uniqid); // Create file attachment $attachment = new Attachment(); $attachment->file = $uniqid; $attachment->mime = 'application/pdf'; $attachment->file_name = $filename; // Create name and description for each language $languages = Language::getLanguages(false); foreach ($languages as $language) { $attachment->name[(int)$language['id_lang']] = substr($filename, 0, 32); $attachment->description[(int)$language['id_lang']] = ''; } // Put to DB $attachment->add(); // Attach to product $attachment->attachProduct($id_product); Hope this sets someone in the right direction, until a good importer comes along. Edited February 26, 2013 by 4mdev (see edit history) 1 Link to comment Share on other sites More sharing options...
web4people Posted November 11, 2013 Share Posted November 11, 2013 Well, I recently created a module for importing massive attachments to the product page (Prestashop 1.5.x), starting from a folder on the server where you previously uploaded your attachments. You can import PDF, ZIP, JPG, PNG, GIF, DOC, XLS, PPT files. There are some rules to follow for let the import works correctl (you can choose if use the ProductID or the Reference, and if the file name has 2 variables with a separator). Actually it's in italian but I'm planning to improve it as soon as possible with multilanguage and more options. As soon as I can I'll post a page on my site with all the specs and the price. But if someone is interested, please PM me. Of course the module works, as I did it for one of my customers. If you have a lot of attachments, this module could save you a lot of time. 1 Link to comment Share on other sites More sharing options...
woutermeijboom Posted November 17, 2013 Share Posted November 17, 2013 Well, I recently created a module for importing massive attachments to the product page (Prestashop 1.5.x), starting from a folder on the server where you previously uploaded your attachments. You can import PDF, ZIP, JPG, PNG, GIF, DOC, XLS, PPT files. There are some rules to follow for let the import works correctl (you can choose if use the ProductID or the Reference, and if the file name has 2 variables with a separator). Actually it's in italian but I'm planning to improve it as soon as possible with multilanguage and more options. As soon as I can I'll post a page on my site with all the specs and the price. But if someone is interested, please PM me. Of course the module works, as I did it for one of my customers. If you have a lot of attachments, this module could save you a lot of time. Hello, can you please let me know whitch module this is? i need it quite urgently :-)! Link to comment Share on other sites More sharing options...
Alberto alvarez Posted January 7, 2014 Share Posted January 7, 2014 Hello, can you please let me know whitch module this is? i need it quite urgently :-)! Hello i have a module for prestashop that made that you want. http://tienda.informax.es/es/modulos-prestashop-cambios-masivos/13-modulo-prestashop-importacion-masiva-de-adjuntos.html See the video. Link to comment Share on other sites More sharing options...
Ecom Posted May 20, 2014 Share Posted May 20, 2014 Hi, Do you know in the new version 1.6.0.6 if is it possible to import in CSV "product attachment file PDF"? Thank's Link to comment Share on other sites More sharing options...
Recommended Posts