Magento Custom CSV Product Imports – How to Perform

csvcustomimport

I am just wondering what would be the easiest way to display vehicles using the Magento platform.

So daily I receive a CSV file of all the vehicles that are in stock at my Dealership via FTP, I want to be able to use this CSV file to import vehicles as products onto my store and cron it daily.

Issue 1

Because the CSV file is loaded daily it is formatted differently than the standard CSV import tool that Magento provides. For example in the CSV file one column will be for the Manufacturer of the vehicle there are also columns for price, variant, owners, engine size etc…

Any idea what would be the best way to import this data?

Issue 2

If the CSV file doesn't contain one of the products in the category that I am importing them into I want them not to display. The reason I would like this to happen is because if the vehicle isn't on the CSV we no longer have it in stock.

Any ideas how I could do this?

Thanks

Best Answer

For a mostly automated solution, you can try Ho_Import (https://github.com/ho-nl/Ho_Import). It supports most of what you are asking for for free.

Personally, I'd make a custom solution for that, using a Magento script, using FastSimpleImport (or ApiImport, or uRapidflow, or any other importing tool). You can set up a simple php script, see an example at https://github.com/avstudnitz/AvS_FastSimpleImport/blob/master/test.php. First, you'd have to read the CSV with fgetcsv, then you can transform it into the needed format (see http://avstudnitz.github.io/AvS_FastSimpleImport/ or the uRapidFlow documentation for details) and import it into Magento with the chosen importing tool. If you run that script as a cronjob, you'll have it automated.

The better way would of course be to create your own Magento module and using the Magento cronjobs.

Related Topic