Skip to: Site menu | Main content

Blog > Status screen for Shopify orders

>> Status screen for Shopify orders

Sun, Dec 26th 7:22pm 2010: DIY

The status screens I set up for IVT have turned out to be really useful: they keep critical information right where you can see it, rather than buried somewhere on an intranet page or financial report. So I decided to have a go at building something similar for Shopify orders.

After my 5th book, Practical Arduino, came out almost exactly a year ago, I had a few requests for hardware related to the projects featured in it. I did a blog post asking if anyone would be interested in book-related kits and the response was amazing. Because I'd designed some prototyping shields and had 100 of them fabricated while I was working on the book it seemed like a reasonable idea to try selling the ones I had left over and see if anyone would really want them, so I put together a little online store called Freetronics and starting selling bits and pieces related to Arduino. Something extra to do on the weekend, really.

Now that the product range has expanded and orders are coming in at a fairly steady pace I want to know immediately if there were any orders waiting to be fulfilled, and a status screen seemed like a cool way to do it. I already had a 22" LCD mounted on the wall in our half-renovated kitchen (which is currently also my workshop!) with a DVI cable running through the ceiling to an eeeBox running Ubuntu/MythTV, so the hardware was all in place and all I had to do was muck about with a bit of code.

For this status screen I used the same basic architecture as for the IVT status screens, which separates the system used to collect data from the system that displays it:

The display itself is simply the Google Chrome web browser running in full-screen mode, pointing at a web page served off the internal intranet server which runs Linux, Apache, and PHP. The datastore is a set of tiny text files, each containing a value for a specific parameter. The collectors on the right are run periodically using CRON, with each collector operating independently and designed to talk to one specific data source.

The top of the screen shows the current date and time, along with a summary of order status. The bar changes colour depending on order status: red if there are new orders that have not yet had payment accepted; yellow if there are orders that have had payment accepted but have not yet been fulfilled; and green if there are no orders requiring any action.

The middle of the screen displays the last four orders in Shopify which are collected using an authenticated RSS feed. The collector implements a very simple parser that extracts some basic information from the RSS feed. One thing that tripped me up initially was that the RSS feed seemed to take many hours to reflect changes in the order list, and it turned out there was some heavy-duty caching happening somewhere between me and Shopify. That was solved by appending a dummy variable to the request URI with a random number as the value, forcing the offending cache to re-fetch the feed every time.

The bottom of the screen displays the number of unread emails in a couple of mailboxes, and the current weather conditions in Melbourne taken from the Google Weather API.

The result: at-a-glance display of the most important information in Shopify's orders interface, letting me put it out of my mind and stop obsessively checking the order list while knowing that I'll see immediately if there are orders waiting to be processed.

Bookmark and Share