CSV Manifest Import to update Orders

By | August 12, 2011

Completed this past week a CSV (Comma Separated Values file) import facility which scans through a CSV line by line and updates the order_status_history to add the postage tracking number and sends an email to the buyer to let them know their order has been shipped. The CSV is produced by the dropshipper, so I had to;

1. add in an upload facility to grab the Manifest CSV (for this I used uploadify)
2. bespoke code to scan through each line of the CSV to see if the order ID has 3 letters attached to it (these 3 letters are the dropship code to say “shipped”).
3. if any line with those 3 letters are found, then grab the contents of another cell (tracking number) and insert into the order_history.
4. send email to the customer to let him know his package is on the way and his tracking number

The CSV could contain many shipped items and many not-yet-shipped orders. So all this had to be done on a multiple basis. This meant a foreach loop to update the DB and send the email.

My client now can update ALL the new shipped orders in one shot, rather than have to manually scan each Manifest, find the order, edit it, copy/paste the tracking number and so on. This takes the workload down from perhaps 30 to 60 minutes per day to just a few seconds!


All in all, a very interesting project, and one which will be of immense value to the site owner long term. By saving a minimum of 30 minutes per day, that’s 3 working weeks over the course of a year – 3 weeks in which the site owner can concentrate on other important things such as customer service, SEO, finding new products or whatever.

8 thoughts on “CSV Manifest Import to update Orders

  1. Carine B

    hi Gary,

    Is this available as a contribution ?
    If not, could it be made available ?

    I’d rather not reinvent the wheel, or as they say here “I prefer to be lazy rather than tired :D”

  2. Gary Post author

    It is not publically available – as it was made for a particular client.
    I can remake it on a client by client basis.

  3. Gary Post author

    Hi Carine – it wouldn’t be made available by me as a contribution, but can be made again on a customer by customer basis.

  4. Carine

    a quick heads up that our custom version is up-and-running for about 10 days now, and everything is going smoothly and saving tons of time to send the tracking numbers automagically.
    we still also use the order comments toolbar with some rather long texts which we personalize to keep the human touch announcing when approximately the package can be expected (transit/delivery times may vary between countries).

Leave a Reply

Your email address will not be published.