Develop WC

The official WooCommerce development blog

Shipping Zones to ship with 2.6 — February 10, 2016

Shipping Zones to ship with 2.6

Currently when shipping goods with WooCommerce you can use one of the core shipping methods (flat rate, international, local pickup).

Each method can be used once, and availability is configured per shipping method. Whilst this system is simple, it is in no way flexible for more advanced shipping setups, forcing you to find additional extensions.

Imagine being able to define multiple regions/countries/zip codes and then being able to add as many rates, flat rates, table rates, free shipping methods, etc as you want to each. Sounds good right? Enter shipping zones.

What are 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’ for example you could have:

  • Local Zone = California ZIP 90210
  • US Domestic = All US states
  • Europe

Then each one of these zones can contain multiple shipping methods, such as free shipping, local pickup, and flat rates. Customers within the zone only see the shipping methods applicable to them.

Here is a demo showing zone setup:

The customer, after inputting their address or being geolocated, would be matched to one of these zones and be offered the appropriate rate. Magic!

What about the old shipping methods and existing stores?

If already enabled, the old CORE shipping methods will continue to function as-is until disabled. They will be named ‘legacy’ methods for backwards compatibility.

Whilst this continue to function in 2.6, you should move to zones as soon as you can ideally as they will be taken out for good in future releases.

What about 3rd party shipping methods?

Like explained above, methods which do not define support for Shipping Zones will work as is – globally. Of course, moving to zones would be beneficial for their users, but this is not forced.

What about Table Rates?

The Woothemes Table Rate Shipping extension had its own Shipping Zone system which this idea was based on. It was always the intention to some day roll this into core.

Table Rates are still mighty useful for defining rates based on weights, items counts, and customer spend so we’re going to continue to offer this extension, but it will be updated to use core zones instead.

When can I have it!

Zones will ship with WooCommerce 2.6 which is due for release Q2 2016. Please feel free to experiment and test with this functionality from Github master branch and provide feedback. It was merged today!

How can I support Shipping Zones?

Whilst not fully documented yet, you can refer to the Flat Rate Shipping class.

You define support for Instances and Zones and define settings per instance of your shipping method.

As long as you use the methods for retrieving options, you should be good to go as instances are handled in the abstract shipping class.

You can also still define global settings and support ‘settings’ to offer some options globally, which can be used in addition to instance settings. This will be useful for API based shipping methods who share settings between instances.

WooCommerce 2.5.2 Fix Release — February 1, 2016

WooCommerce 2.5.2 Fix Release

The WooCommerce 2.5.2 fix release is now available. You can download it on or as an automatic update in your administration panel.

A total of ~46 commits made it into this release fixing several minor issues.

* Fix - Compatibility with w3 total cache inline minification.
* Fix - Remove stock bw compat code which was preventing manage stock being disabled at variation level.
* Fix - When calculating shipping total, force rounding.
* Fix - Make save button clickable in tax rate table after using autocomplete field.
* Fix - Fix passed image_size variable in email templates.
* Fix - Don't show purchase note to admin in emails.
* Fix - Fix 'hide empty' setting in category widget
* Fix - Prevent notice in get_allowed_countries.
* Fix - Prevent add-to-cart querystring in pagination links.
* Tweak - Allow propagation in variation script.
* Tweak - Product image alt text.
* Tweak - Remove notice and add styling for add payment page.
* Tweak - Set input margin and label display for compatibility with themes using bootstrap CSS.
* Tweak - Add context to category term localization.
* Tweak - Moved cart URL functions to core-functions file to make them available in admin area.
* Tweak - Added password hint text and error messages when showing the password strength meter in forms.
* Tweak - Added Saudi Riyal currency.
* Tweak - Added Russian Ruble symbol.
* Tweak - When COOKIEPATH is an empty string, set to '/' so cookies work across all pages.
* Dev - Template - Pass $category into wc_product_cat_class() in content-product_cat.php

If you spot any further issues, please report them to us in detail on Github so the development team can review – comments on this post are closed.

WooCommerce 2.5.1 Fix Release — January 25, 2016

WooCommerce 2.5.1 Fix Release

The WooCommerce 2.5.1 fix release is now available. You can download it on or as an automatic update in your administration panel.

A total of ~36 commits made it into this release fixing several minor issues.

= 2.5.1 - 25/01/2016 =
* Fix - Remove usage of get_currentuserinfo() which is deprecated in WordPress 4.5.
* Fix - Fix responsive product sizes when the columns class is missing.
* Fix - Fix function exists check for woocommerce_template_loop_category_title.
* Fix - check_version on all requests so that the installer runs after remote plugin updates.
* Fix - Only show the "add payment method" button when needed, and check for required fields on the add payment method page.
* Fix - Correctly block UI to prevent attribute issues in backend when adding multiple attributes in quick succession.
* Fix - Show SKU in admin emails.
* Fix - Don't show downloads in admin emails.
* Fix - Fix query/missing variable in validate_user_usage_limit function.
* Fix - Prevent endless loading on checkout when reload_checkout session variable was used.
* Fix - Correctly display html entities in tax screen autocomplete.
* Fix - Do sales reports based on refund line items rather than fully refunded orders to prevent double refunds being reported.
* Fix - Qty button can be hidden for variable products sold individually.
* Fix - Show the taxable country rather than base country in "estimated for" text during checkout.
* Fix - Prevent select2 gaining focus on IOS7 scroll.
* Fix - API - Fix indexes on decimal and thousand values.
* Tweak - Clear cron jobs on uninstall
* Tweak - Don't disable place order button on checkout if a weak password is used.
* Tweak - Added password strength meter in lost password and edit accout pages.
* Tweak - Pass $args to woocommerce_dropdown_variation_attribute_options_html hook.

If you spot any further issues, please report them to us in detail on Github so the development team can review – comments on this post are closed.

Say hello to WooCommerce 2.5 “Dashing Dolphin” — January 18, 2016

Say hello to WooCommerce 2.5 “Dashing Dolphin”

Today we’re proud to release WooCommerce 2.5 “Dashing Dolphin” into the wild! 2.5 has been in development for ~5 months and has seen around 1600 commits from 42 contributors.

This is another evolutionary release which focusses on improvements to existing functionality, as well as stability and performance. We do however have some new features to mention in 2.5 which developers in particular should enjoy using.


Introducing WooCommerce CLI

The WooCommerce CLI (command line interface) lets you perform many actions on your store via the command line, such as creating customers and coupons. This should be very useful for power users! Here is a quick example of the CLI in action, in this example updating then deleting a coupon.

2016-01-12 10_54_27.gif

The documentation for our CLI can be found here.

A new sessions table

Being stateless, WordPress doesn’t have an in-built way of handling session data. You can use cookies or implement PHP Sessions, but both have limitations and some hosts aren’t equipped to deal with them by default.

Early on we decided to adopt a solution based on wp-session-manager whereby you have a cookie to identify each user, and have their session data stored in the WP options table. This worked well, and has served us nicely until now, however it did lead to problems with scalability and data cleanup.

For these reasons we’re introducing a new session handler which uses custom tables, rather than the WordPress options table.

You can read more about this feature here.

Performance improvements

We made a number of performance improvements in 2.5, mainly working on optimising our usage of transients which we covered in our beta 2 post.

tl;dr we’ve audited all transients, removing those that are unnecessary and moving to alternative forms of data storage and caching where possible. Combined with the new sessions table, query speed should be improved due to reduced usage of the wp options table.

Tax rate settings UI

We’ve been experimenting with backbonejs to improve the user interface recently, which should feature more prominantly in core from 2.6. In 2.5 we’ve used it to improve the tax rate input screens, which now saves via ajax and has a new inline search.

2016-01-12 12_04_11.gif

Improved checkout flow

We touched on some checkout screen tweaks in our beta 2 post here and the beta 1 post here. Most notably we have:

  • Moved the terms and conditions box before the place order button
  • Tweaked default call to action button styles
  • Added error recovery when malformed JSON is returned by the ajax methods.
  • Removed the ‘estimated’ text from the cart totals area.
  • Made it so when only 1 gateway is enabled, the radio buttons will be hidden.
  • Added password strength indicators when creating an account.

2016-01-12 12_06_35.gif

Everything else…

There are over 25 tweaks listed in the changelog, including:

  • Moved emails in the email settings to a table to keep things organised.
  • wp.template usage for variations which now allows developers to change the layout of single variations.
  • Removed the welcome screen.
  • For coupons with category restrictions, respect the category hierarchy.
  • A new wc_array_cartesian function to generate variations in a logical order.

And some REST API improvements for developers using it:

  • Added /products/shipping_classes endpoint.
  • Added support to POST, PUT, and DELETE categories and tags.
  • Added support to filter products by tag, category, shipping class, and attribute.
  • Added tax and tax_class endpoints.

We hope you’re excited about these changes :)

Template Changes

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.

We covered some reasoning behind the larger changes in our beta 1 announcement.

There are 7 new template files (see the beta 1 post). The following template files have been version bumped in 2.5:

  1. single-product/review.php – Added new action hooks + verified reviewer code
  2. single-product/add-to-cart/variable.php – Correctly escape variation data.
  3. order/order-details.php – woocommerce_purchase_note_order_statuses filter.
  4. order/order-details-item.php – woocommerce_purchase_note_order_statuses filter.
  5. loop/add-to-cart.php – Uses supports_ajax_add_to_cart method.
  6. global/quantity-input.php – Changed min and max attributes.
  7. content-widget-product.php – File was missing version.
  8. content-product.php – Action hooks to handle anchor output.
  9. content-product_cat.php – Action hooks to handle anchor output.
  10. checkout/payment.php – Support for new terms.php template file.
  11. checkout/form-pay.php – Support for new terms.php template file.
  12. cart/mini-cart.php – URL escaping.
  13. cart/cart-shipping.php – Extra filters and some simplification of strings.

Additionally all email templates have been updated to use a unified order details template (email-order-details.php).


Since November 9th 2015 we’ve had 3 beta versions and 2 release candidates giving ample warning to developers to test, including posts on Twitter, Facebook, and our dev blog.

Our beta tester plugin is installed on around ~60 sites according to .org, but this number does not include manual installs from Github. According to Github API, RC1 was downloaded manually over 100 times so we 190 times, so it’s good to see people testing things out.

Internally we’ve been testing the RC on some new stores we’re building (for WooConf), on, and on We have also tested all WooThemes extensions for compatibility, and had our 3rd party devs do the same.

We also know at least one user accidentally updated and had no upgrade issues ;)

however it happened, I never noticed until now. The store’s got about 10 WooCommerce extension plugins. So, it looks like WC 2.5 isn’t going to break as many things as previous major releases!

Thanks to everyone who contributed, tested, and translated this release and we hope you all enjoy using it!


WooCommerce 2.4.13 fix release and 2.5 RC2 — January 11, 2016

WooCommerce 2.4.13 fix release and 2.5 RC2

Another small update today – 2.4.13 release is now available.

You can download it on or as an automatic update in your administration panel. A total of ~6 commits made it into this release fixing a redirect issue when running your site over SSL, and adding some extra escaping to the clear sessions query for added security.

If you spot any further issues, please report them to us in detail on Github so the development team can review – comments on this post are closed.

In other news, we have also tagged WooCommerce 2.5 RC2 for those people testing. This includes a few small fixes and mostly code comments. We’re still due to launch 2.5 next week. Exciting times!


Get every new post delivered to your Inbox.

Join 4,355 other followers