Today we’re excited to announce WooCommerce 2.6 “Zipping Zebra” has been released into the wild. 2.6 has been in beta since the end of April, development for ~5 months, and has had over 1700 commits from 25 contributors.
This time round there has been a major focus on APIs, shipping, and account pages which ticks some items off of our 2016 core wishlist.
Introducing Shipping Zones
Shipping Zones are groups of locations to which you ship products. You can group multiple continents, countries, states, and zip codes into a ‘zone’ and then add shipping methods to each.
As an added bonus, methods supporting zones can be used as many times as you need, for example, you can now create multiple flat rates within a zone – something which was previously limited to one without an extension such as table rates.
For 3rd party shipping methods, Shipping Zones are opt-in. Core shipping methods support zones, but 3rd party methods need to declare support. For developers, the shipping API docs are inside our wiki. If a method does not support zones, it will continue to work globally as it always has.
Users of the WooThemes Table Rate Shipping and Flat Rate Box shipping should install the latest versions of those extensions for compatibility. Zones will be migrated to the new system during the 2.6 upgrade routine.
The new WooCommerce REST API
We’ve released a new WooCommerce REST API based on the WordPress REST API. This means WooCommerce now uses the WP REST API scaffolding layer and follows the same standards meaning it can be extended by plugins to add new data points or authentication methods.
The new API supports orders, customers, products, coupons, taxes, reports, and webhooks, both individually and in batches. We’ll be extending this with additional endpoints in 2.7.
If you’re a developer, our REST API docs have been updated for the new API and can be read here.
Previous versions of the API (v1, v2, and v3) are still present in core and will continue to function as normal.
Improved account pages
Older versions of WooCommerce had a single account page which listed all data; orders, downloads, saved cards etc. This was not very organised and could grow with extensions.
To fix this, we’ve built a new endpoint/tab based account page with sections you can navigate through.
AJAX cart page
The cart page operations now use AJAX (updating item quantities, removing cart items, applying coupons, and updating shipping options).
To highlight a few of those changes:
- Developers will have access to our new Payment Tokens API which standardized the way in which tokens are stored and displayed. This wiki article explains usage for devs.
- There are now some on-hold status order emails.
- We’ve worked on our layered nav system in 2.6 adding new functionality (now you can filter products by ratings) and improving performance for all layered nav queries.
- We’ve moved custom term meta implementation to WP Term Meta which was introduced in 4.4.
- There is a new wc_get_orders() function to get order objects and ids instead of direct get_posts() calls.
- We’ve added the ability for shipping methods to store meta data to the order in the same way line items can.
Upgrading to 2.6
Some notes for people upgrading to 2.6. Aside from ensuring your extensions and theme are compatible and you’ve made backups:
- You’ll need to be running WordPress 4.4 or above – we’ve bumped the minimum requirement.
- If you’re running table rate shipping or flat rate box shipping authored by WooThemes, ensure you’re running the latest versions and the WC 2.6 data update will migrate any existing rates and zones.
- If you’re using Simplify Commerce you’ll be prompted to install the new version from WordPress.org as it is now a separate plugin and deprecated in WC core.
- The data upgrader prompt will run updates in the background. If your site is not accessible or password protected there may be a delay for the cron-based fallback to run.
Template Changes in 2.6
With most new releases, updates to template files are needed in order to add or change functionality. When we make a major change, the template version is incremented. Themes which bundle these templates may need to update them to reflect core.
The following template files had their versions bumped in 2.6.0:
- single-product/review.php – Added hooks to support the following new templates:
- order/order-details.php – Fix to only get purchase note if product exists.
- myaccount/my-account.php – New action hooks to support tabbed navigation and the following new template files:
- myaccount/my-downloads.php – Deprecated.
- myaccount/my-orders.php – Deprecated.
- myaccount/form-add-payment-method.php – Added tabbed naviation.
- myaccount/form-edit-address.php – Added tabbed naviation.
- myaccount/form-edit-account.php – Added tabbed naviation.
How we tested 2.6
Since April 22nd 2016 we’ve had 4 beta versions and 2 release candidates giving ample warning to developers to test. We’ve also posted on Twitter, Facebook, and our dev blog.
According to Github API, RC1 was downloaded ~250 times, and our betas a total of 1,951 times by testers.
Internally we’ve been testing the RC on WooThemes.com. We have also tested all WooThemes extensions for compatibility, and had our 3rd party devs do the same.
Thanks to everyone who contributed, tested, and translated this release and we hope you all enjoy using it!