A recent WordPress development project required a small Woocommerce extension to integrate a call to the Australian Government ABN Lookup tool to verify that a customer is registered as tradesman, and therefore eligible for trade discounts.
The first step was to register for access to the ABN Lookup web services. This process takes roughly 24 hours, following this you are issued with a unique developer GUID. Using Gravity Forms we were able to create a multi-page form where the first queried the user for their ABN. With a simple SOAP script the GUID and the inputted ABN were used to query the government database to recover the users registration details such as name and business entity type.
The second page of the form serves as a way for users to verify their data. Upon submission of the form a new user is created. If the ABN is valid the XML response data is converted into a PHP object. Using this object the ABN, first and last names, and business entity type are then stored in default and custom Woocommerce Billing fields.
An additional user role of ‘Trade’ was also added to the site. When users have their ABN verified we assign them to the new role, which borrows the capabilities of a ‘Customer’. The new user group is then applied to pricing matrices enabling us to set different price points for products and show different content at various locations throughout the site.
To allow for existing users to verify their ABN, a slightly modified version of the form was inserted into a Woocommerce Endpoint. This adds a simple verification tool to the Woocommerce My Account Pages.
This fun little project is just a small example of some of the custom WordPress development we really enjoy doing. Take a look at some of our web development case studies, and if you have a custom project that you need some help with don’t hesitate to get in touch with Blue Kelpie.