Calculating Australia Post shipping costs in Simple Commerce
We are strong advocates of giving your e-commerce customers either flat rate or free shipping for two key reasons:
As a customer, it’s great to know before adding items to the cart what to
Determining shipping for an unknown number of items of varying sizes is more complicated than it sounds
Especially with Australia Post. Their calculators require very detailed information in order to get a shipping quote, and have a swarm of options and extras available. They need to know where it is going from and going to (fair enough) but also package dimensions and weight. And the package needs to fit within their limits as well – which differ for domestic vs international.
But to make it more complicated, when a customer has multiple products in their cart, you would typically collect those in to a single package – so your e-commerce software needs some logic behind the scenes to create “packages” (which again fit within the Australia Post size/weight restrictions), and add more “packages” as they fill up.
If you’re offering a cart with multiple products on your store, you need to cater for the fact that customers may order multiple products – not everyone will order a single product only. And multiple quantities of multiple products. While it may cost you $9.55 to ship a single book, what happens when suddenly they buy enough product to fill a box full? Is your $9.55 still going to cover your shipping expenses?
Not as straight forward any more, right?
If you’re charging based on the order’s contents, your e-commerce and shipping software needs to effectively handle these situations: from a customer buying a single product through to buying multiples that span multiple packages.
We use Simple Commerce by Duncan McClean for some of our e-commerce sites – it is made for Statamic, so you get all of that Statamic awesomesauce, plus a great e-commerce experience including products, variants and even coupons. Duncan has also made Simple Commerce extensible for additional payment and shipping methods – such a good lad, right?
And this is where our latest addon - Australia Post Shipping Methods for Simple Commerce - comes in.
What does it do?
The Australia Post Shipping Methods for Simple Commerce makes it possible to easily communicate with the Australia Post Postage Assessment Calculator (PAC) API, but without having to do all of that package maths yourself.
Using the included commands, you can create special Shipping Methods made for Australia Post’s PAC API and for Simple Commerce that can:
Work for domestic and/or international services
Combine individual products into one or more packages that fit within Australia Post’s requirements for their destination, and calculate a total cost
Automatically hide themselves if they cannot be shipped to a customer’s location
Can exclude selected products from shipping calculations (while still including other products in their order)
If you’re used to working with Statamic and Simple Commerce, getting set up with your new Australia Post Shipping Methods is a breeze.
Who are the Australia Post Shipping Methods for?
This addon is for anyone running a Statamic and Simple Commerce site that needs to get quotes from Australia Post for shipping packages from Australia to a destination either domestically or internationally.
This addon is aimed at developers: you’ll need to do some code-level work to get up and running.
Getting started
To get started, you need to install the addon using Composer, publish the config file, set your ‘from postcode’, and get yourself an Australia Post PAC API Key.
You can find full details in the documentation for the Australia Post Shipping Methods addon on the Statamic Marketplace or Github.
When you’re set up, you need to make an Australia Post Shipping Method – but don’t worry, we’ve included some command line tools to help you out too.
There’s a command to help generate a new Australia Post shipping method that will talk to the Australia Post API, and then two commands to find the different Service Codes you can use.
You can create as many Australia Post Shipping Methods as you need – each can take a domestic and international Service Code. This means you could offer Parcel Post to both domestic and international customers, but only Express Post to domestic and Courier to international.
Your Product Blueprint will also need to be updated to include each product’s weight, width, height and length: you can re-map the field handles to your own blueprint in the configuration file.
All of the details are in the documentation – there’s a lot to take in, but it does sound more complicated than it really is. In reality, you can get up and running in minutes: it’s really easy.
How to get Australia Post Shipping Methods for Simple Commerce
The Australia Post Shipping Methods addon for Simple Commerce can be installed using Composer, with full details on the addon page on the Statamic Marketplace or on Github.
If you find this addon useful, we’d love to hear from you!
Marty Friedel
Marty has a background in Computer and Information Science, software development, web development, multimedia and web accessibility, and is Mity Digital’s resident nerd.
Outside of his programming work, Marty is a keen landscape photographer, and also teaches Les Mills group fitness classes.