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.