Magento: Import Script – Total Rewrite In Progress

I have discovered that there are just too many things that needed to be improved upon, and no good way to just improve one thing at a time. For the most part, it has to be totally rewritten. The good news is: it’s started and it is coming along fairly well. The graphical user interface has been started, the csv output table has been improved (with the help of jQuery), I added a csv parser class to better handle the contents of the csv and to make better sense of the code, and more.

So, please be patient. Instead of releasing 1.3 next, I’ve decided just to really have at it and to make the jump to 2.0. It’s going to be a whole new script, and it’s going to be a breeze to use!

Currently, I’m a little stuck on the logic. I want to make it so that you can have any sort of column order that you want, and only a handful of required columns. If you leave a column out such as Visibility or something like that, the script will automatically add in a default value for you. However, creating the logic for this (in a smart way) is difficult. I could easily write a huge set of if statements, but that would be tedious and bulky. So, if any of you PHP pros out there would like to volunteer some input, I would appreciate it!

As always, I’ll keep you updated.

This entry was posted in Magento. Bookmark the permalink.

9 Responses to Magento: Import Script – Total Rewrite In Progress

  1. Chris Nudd says:

    Just thought, does the ip address have to be whitelisted on the remote sql or not since its an api?


  2. Chris Nudd says:

    Tried the ecommerce-themes a few times with no luck, was getting an error. Left feedback but never heard back from them.

  3. rwired says:

    My colleague just pointed me to this:
    I haven’t tried it yet, but seems someone else has at least tried!

  4. Josh Pratt says:


    I agree. Categories are not an option even for Magento’s imports now. Unfortunately though, I can only do so much at a time… We’ll see what happens. I’m surprised that nobody else has built an import script for anything yet though…

  5. rwired says:

    Importing categories would be a great feature. I’m moving a product database into Magento right now that consists of 3776 categories (some parents of others), and 48387 products. Needless to say I don’t want to have to do either of these manually through the Magento backend!!!!

    Products I can deal with… but Categories???

  6. OfficeSaver says:

    That sounds good.

    I’ve started working on setting up categories from within the magento admin and it’s not that laborious – so you’re script for importing products will be a fantastic addition to magento.

    I’m off to setup a twitter account to follow the progress….

  7. Josh Pratt says:


    For the launch of 2.0, the script will not be importing categories. I have created scripts to import categories though before – so it wouldn’t be a far-fetch to eventually build that into the product import script, OR, I may build a script solely for importing categories. We’ll see when/if we get there.

  8. OfficeSaver says:

    Hi Josh,

    Just a quick question – will the import script allow the user to just bring in categories and sub-categories, or will it exclusively work for product imports?

    I’m really interested in importing categories/sub-categories and their names, without any corresponding products.

    Thanks for all your help and I think your blog is going to be a brilliant magento resource.

    All the best,

  9. websuperman says:

    I am by no means a php expert or even novice, but I have worked with programmers designing such a tool for another ecommerce platform in the past and we handled default values with an xml configuration file. It’s very easy to modify and maintain and could be as flexible as you want. For instance you could allow it to set default values for any field, even custom ones. You could extend that by allowing the configuration file to set values based on other values, but that can get more complicated, just my two cents.