A local rental company was having trouble keeping track of all their WooCommerce orders, specifically scheduling the physical deliveries and pickups.
Customers would order the rental of equipment, specifying custom drop-off and pickup dates as well as an address, and our client would then make sure to drop off the equipment and pick it back up when the customers were done with it. Managing all this through WooCommerce/order emails was not working.
So we came up with a solution to automatically add new orders to a Google Calendar, specifically creating a drop-off event and a pickup event, using data from WooCommerce. This enables the client to keep track of all their drop-offs and pickups without having to manually schedule them, look through emails or WooCommerce backend. It also allows the delivery drivers to easily view the day’s drop-offs/pickups and get directions, right on their mobile devices.
Automation with Zapier
Connecting WooCommerce with a Google Calendar happened through the excellent automation service Zapier. It’s like IFTTT on steroids, allowing us to import custom WooCommerce fields and translating them into custom areas of the Google Calendar events.
The only real problem we came across was caused by the way WooCommerce delivers the individual items in an order. They come in a PHP object with each item as an array, including a lot of irrelevant information like SKU, tax, meta, etc. When Zapier imports this object, it converts it to one long string so we were getting a lot of irrelevant information that cluttered the view in Google Cal.
To keep the calendar from showing all this useless info, I wrote a custom script that grabs the product name(s) and quantities only, returning them to Zapier as a string in an object. Check out the script on Github. This script was added using Zapier’s ‘code action’ which allows for the creation of really powerful automation steps.
Pretty much everything else played smoothly with Zapier and the client is super happy!