Develop WooCommerce

The official WooCommerce development blog

Dev Chat Summary – June 6th — June 7, 2017

Dev Chat Summary – June 6th

This post summarizes the dev chat meeting from June 6th (agenda, Slack archive).

WooCommerce 3.1 Beta

  • Beta 2 should be available soon.
  • Still on track for a release at the end of June.
  • Please test the new importer/exporter included in WooCommerce.

Rest API feature plugin

  • API development will now be done in a separate repo.
  • When new API versions are ready they will be merged into WooCommerce and released with the next WooCommerce version.
  • This will enable API development to not be tied to the WooCommerce release schedule.
  • The legacy v1, v2, and v3 APIs will be removed in WooCommerce 4.0.

Extensions version checking

  • Sites had a high amount of errors when people upgraded to WooCommerce 3.0 and were using extensions that were not ready for WooCommerce 3.0.
  • We need to show warnings or programmatically manage extensions that are not compatible with new versions of WooCommerce somehow.
  • An issue has been created on GitHub for this. Please leave feedback or ideas.
WooCommerce 3.0.8 fix release notes — June 6, 2017

WooCommerce 3.0.8 fix release notes

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

~46 commits made it into this fix release. The full changelog is below.

* Fix - Include multi-dimensional array support in oAuth1.0.
* Fix - Stock/backorder notice when stock management is disabled.
* Fix - Handle shipping item taxes if set to avoid the legacy fallback.
* Fix - Variations should inherit purchase_note from parent.
* Fix - Check if subtotal is blank, not empty, before setting for order items.
* Fix - Cancelled email should be send for processing orders, not pending.
* Fix - Missing variable in legacy API.
* Fix - Correct price query when on a post type archive.
* Fix - Missing $ip Variable in geolocation class.
* Fix - A single multi-word attribute is fine for variation titles.
* Fix - Gallery should be updated even if empty in REST API.
* Fix - Fix saving of text attributes with special chars.
* Fix - Undefined index warning when saving variations with stock management disabled.
* Fix - Use meta id instead of key in WC_Order_Item::offsetGet.
* Fix - Format parent stock qty on read.
* Fix - Hide replies from recent reviews widgets.
* Fix - Use formatted weight and dimensions for variations.
* Fix - Ensure we have child before getting price to fix a notice in grouped products.
* Fix - Fixed unicode characters when saving webhook delivery logs.
* Fix - Avoid deprecated ID in legacy API.
* Fix - Add correct args to woocommerce_shipping_zone_method_deleted and woocommerce_shortcode_products_query hooks.
* Fix - Correctly append cache in product widget.
* Fix - Add ability to invalidate cache by object ID.
* Fix - Notice in structured data class.
* Fix - Only delete if an object has an ID in CRUD to avoid wp_delete_post using global ID.
* Fix - Avoid notices on checkout by ensuring all legacy data is correctly set.
* Fix - Add failed to processing event for the processing email.
* Fix - Store user ID and use that to determine if the session should be loaded or not. Ensures user data is correct and shipping calculator data is stored.

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 3.1 Beta has landed — May 31, 2017

WooCommerce 3.1 Beta has landed

Today we’re pleased to announce that WooCommerce 3.1 is available for beta testing!

You can download WC 3.1 Beta 1 here.

Release highlights

You may have noticed that it’s only been a couple of months since 3.0 was launched; with our move to SemVer we’re aiming to do smaller, more rapid releases with an improved effort to maintain backwards compatibility and add new features incrementally.

Since 3.1 is a minor release, there should be no breaking changes and functionality added in a backwards-compatible manner. Updating from 3.0 therefore should be a breeze.

Here’s what’s new in 3.1.

Built in product CSV Import/Export

We believe that new users should be able to move their data in and out of WooCommerce quickly and easily, so we’ve worked on a new built-in import/export solution!

Our new importer supports:

  • Importing all core product data.
  • String-based custom meta data can be imported using the meta: prefix.
  • Extensions can add columns and props of their own or to support more advanced data.
  • Merging data can be done by ID or SKU.
  • All product types can be imported from one CSV, including variations.

The exporter has support for:

  • Choose which pieces of information you’d like to export.
  • Export by product type.
  • Exporting custom meta data is possible via a checkbox option.

Both tools use AJAX to prevent timeouts by exporting and importing in multiple batches, and both can be started from the main Products screen.

Here is a preview of the exporter in action:


And here is the importer importing some data:


The recent CRUD additions in WooCommerce core made building this import/export solution much simpler that it could have been using the WordPress meta approach. If you’re a developer and you’ve not yet used the new system you may want to check it out.

We look forward to hearing feedback about this new functionality!

Inline “terms and conditions” on checkout

In previous versions, defining a checkout terms page would add a mandatory checkbox to the checkout, as well as a link to the terms page.

In 3.1 we’ve enhanced this to show the terms page inline, so the user is kept on the checkout and can scroll through the content if desired.

Inline terms

Search helpers: WC_Order_Query class

For developers, we’ve added some new search helpers for orders to allow you to query orders by multiple props. Usage is explained here.

As an example, you could query all orders from a specific date range for users named John with the following code:

$orders = wc_get_orders( array(
    'billing_first_name' => 'John',
    'date_paid' => '2016-01-01...2016-12-31`,
) );


Manage your extension subscriptions in WooCommerce core

In an effort to improve the user experience for updating extensions purchased from, the “helper” (the code responsible for validating subscriptions and checking for updates) has been merged into WooCommerce core.

It’s lightweight and will be added to the already existing “extensions” screen in admin, and should really help our customers ensure that their premium plugins are kept up to date with new functionality.

Checkout pay for order page improvements

In 3.0.x, when going to pay for an order assigned to a customer you’re presented with a pretty unfriendly “invalid order” message. We’ve improved this in 3.1. Now, you’ll either see a useful message if the order is not yours, or you’ll see a login form if not yet logged in.

Login form for payment

oembed for short descriptions

Does what it says; oembeds (e.g. to show videos) were previously non-functional when used in the product short description. With 3.1 they are supported!

Bulk update for variation stock statuses

A small improvement to help update variations in bulk; you can now set all stock statuses at once.

Bulk status update

Customer profile “copy billing” button

A small improvement when updating users manually in admin; you can now use the “Copy from billing address” button to populate the shipping address from the billing address in one click.

Copy from billing

Wizard improvements

A few improvements in our setup wizard:

  1. A domestic shipping zone will be automatically created for your defined base country to make setting up shipping a little more streamlined.
  2. If using a non-WooCommerce theme, you’ll have the option to one-click install the Storefront theme if you want it.
  3. If you’re in the US you’ll get the option to install the WooCommerce Services extension which provides, amogst other things, USPS rates and shipping labels.

Everything else…

On top of the new features, there are a variety of minor tweaks, new hooks, and fixes in this minor release. We won’t go into detail here, but you can see the full list of changes in the readme if you’re interested!

Template changes in 3.1

When editing core template files we bump the version so themes know they need to update custom versions. The following files were updated in 3.1:

  • cart/cart-empty.php – Added a wc_empty_cart_message function to handle the message displayed in a hookable manner.
  • cart/cart-shipping.php – Added a variable so shipping calculator is only shown on the first row when showing multiple packages.
  • cart/mini-cart.php – CRUD support.
  • checkout/terms.php – Support added for inline term display.
  • single-product/product-image.php – Added data-caption support.
  • single-product/product-thumbnails.php – Added data-caption support.
  • single-product/rating.php – Using new wc_get_rating_html function.
  • single-product/review-rating.php – Using new wc_get_rating_html function.

Deprecated functions and methods in 3.1

The following functions are deprecated (not removed) in 3.1:

  • WC_Order_Data_Store_CPT::get_orders – Use wc_get_orders and the new search helpers.
  • WC_Order_Item_Meta – This class was actually deprecated in 3.0.0 but a notice was not added. wc_display_item_meta should be used instead.

Release schedule and testing

We’re hoping to keep WooCommerce 3.1 in beta for the next 2 weeks.

Being fairly small in scope we’re expecting to do fixes for new features, but we’re not expecting to break extensions or backwards compatibility (since this is a minor release, not a major one). If you’re a developer you should still check extensions and themes to be safe of course!

If all goes well, Release Candidate 1 will be tagged on June 14th 2017 and will remain in RC for a further 2 weeks until June 28th which is our target launch date.

If you’d like to help us test, you can download the release from Github. We posted a nice little write-up on beta testing here which should get you started. Please read that and jump right in!

If you’re like to help translate 3.1, you’ll find it on the development branch on

Thanks to all of our testers and contributors.

June 6th: Dev chat #5 —

June 6th: Dev chat #5

It’s time for our 5th dev chat, if you missed something in the last one, you can recap our summary here.

The next chat will be on June 6th at 16:00 UTC in the #core channel of the WooCommerce Community Slack. If you don’t already have access to the group, you can request an invite at the bottom of the WooCommerce developers page.

Here is the agenda:

If you have anything to propose for the agenda or related to the above, please leave a comment below.

See you there!

Dev Chat Summary: May 23rd — May 23, 2017

Dev Chat Summary: May 23rd

This post summarises the dev chat meeting from May 23rd (agenda, Slack archive).

Progress with importer/exporter

  • Wrapping up development this week!
  • We have a branch for testing:
  • Merge is supported, based on ID and/or SKU
  • Attributes are supported
  • There is a mapping screen
  • Mappings are not stored/remembered

Order search helpers are ready for feedback

  • Search helpers are ready and a WIKI explains usage:
  • In short, wc_get_orders does what it always has, but also has a bunch of new params you can query by
  • Feedback; update status to use non-prefixed statuses like other core methods.
  • Date range queries are INCLUSIVE.
  • customer accepts an email or an ID for backwards compatibility
  • Helpers do not support advanced custom meta queries.

Should we remove ID based searches e.g. in customer search boxes?

  • General consensus on removing in a future version
  • Do not seem to be commonly used, even on small stores
  • Hard to remember IDs
  • IDs are not exposed in the WordPress UI – only in URLs

How to deal with Cash on Delivery paid status

  • Separate order/shipping/paid status are a long way off being available.
  • Most against using on-hold status instead of processing.
  • We should add custom handling to ensure paid date is not set until the order is completed.