Develop WooCommerce

The official WooCommerce development blog

WooCommerce 3.7 Beta 1 — July 16, 2019

WooCommerce 3.7 Beta 1

We are pleased to announce that WooCommerce 3.7 is now officially available for beta testing.

To beta test this release of WooCommerce 3.7 you can download it from the plugin repository, directly from GitHub, or install our WooCommerce Beta Tester plugin which allows you to easily test out this beta and all future beta and release candidates.

What’s new in 3.7?

WooCommerce 3.7 is the second minor release of 2019, and being a minor release everything included in this release is backward compatible. This minor release is also a bit smaller in changes than previous minor releases as we work towards smaller more frequent releases.

Product Blocks

We are excited to include WooCommerce Product Blocks 2.3 in this release. WooCommerce Products Blocks is our eCommerce focused blocks for the Gutenberg editor that has been part of WordPress since 5.0.

The first Product Blocks were included in WooCommerce 3.6 and with the inclusion of Product Blocks 2.3 in WooCommerce 3.7, there are several new features added.

New Focal Point picker on Featured Product block
New Focal Point picker on the Featured Product block

Some new features and improvements include:

  • A new Focal Point picker on the Featured Product block.
  • Searching for products in Featured Product & Hand-picked Product blocks is faster.
  • A new Product Categories List block.
  • Better block branding for easier discoverability.
  • A new Featured Category Block; feature a category and show a link to its archive.
  • A new Products by Tag(s) block.

In order to have access to the new Product Blocks, you will need to have WordPress 5.1+ installed or have the latest version of the Gutenberg Editor plugin installed.

Performance Improvements

With our continued focus on improving performance in WooCommerce, this release also includes some under the hood changes to ensure WooCommerce is faster than ever.

We have improved the speed of the admin dashboard even more, reduced the number of queries required to populate variations, fixed issues with the persistent cart that slowed things down a bit, and are now excluding action scheduler task from comment queries which speed up a lot of pages where comment data is retrieved (product reviews, post comments, admin pages).

New PHP and WordPress minimum requirements

With this release we are bumping the minimum required PHP version to PHP 5.6. This is needed to work towards having our customer stores run on a supported version of PHP as well as set us up for using newer and more performant functionality.

We are also bumping the minimum required WordPress version to WordPress 4.9 in this release and will likely in the next release move that to WordPress 5.0.

We have added upgrade nudges in WooCommerce 3.6.5 pointing users to our new document you can follow to make sure you have the latest and greatest versions. Stores running a version of PHP less than 5.6 and WordPress 4.9 will not be able to update to WooCommerce 3.7.

A new package management system

With the new PHP 5.6 minimum requirement in place, we are able to utilize PHP packages. End users are not affected by this change.

Since the majority of new WooCommerce features are being developed as feature plugins, separate from WooCommerce core, under the hood we have made some change on how these features are included and loaded.

We have removed the Product Blocks as well as REST API functionality from WooCommerce core and these are all now developed and released independently yet included with each WooCommerce release via Composer.

This allows us to eliminate feature plugin conflicts easier, utilize namespaces and ensure more efficient loading of the code as it is needed within WooCommerce core.

Additional enhancements

In addition to the above, we have also included the following enhancements in WooCommerce 3.7.

  • The ability to change the “Thanks” wording in emails from the email settings.
  • Moved tax classes from using WordPress options to its own wc_tax_rate_classes table for storage.
  • Added new Coupon code generator functionality to the coupons page.

Beyond these enhancements, the release also contains some tweaks, new hooks and, fixes – all of which you can find out about in the readme.

Template file changes

The following template files have been updated/changed in this release.

All template filesReviewed and updated the escaping.
checkout/thankyou.phpAdded new filter woocommerce_before_thankyou
cart/mini-cart.phpRemoved subtotal function call and replaced with new woocommerce_widget_shopping_cart_total action. Added new woocommerce_widget_shopping_cart_after_buttons action.
cart/cart.phpAdded new filter woocommerce_before_cart_collaterals
loop/result-count.phpCorrect the plurals form usage.

Deprecated functions and methods

  • Deprecated the WC_Abstract_Order::get_used_coupons() method and replaced it with a new method WC_Abstract_Order::get_coupon_codes() to make it easier to identify that codes are returned and no coupon objects.
  • Removed the woocommerce_before_cart_item_quantity_zero action from WC_Cart::restore_cart_item() in favor of the existing woocommerce_cart_item_removed action. This action should already be in use if you are using woocommerce_before_cart_item_quantity_zero.

Release schedule

Beta16 July 2019
RC29 July 2019
Release 3.712 August 2019

If you’d like to help us test, you can use our new WooCommerce Beta Tester pluginWe posted a nice little write-up on beta testing here which should get you started. Please read that and jump right in!

Community Chat

We would also like to welcome all testers to join us at our next Community Chat scheduled for 25 July 2019 at 16:00 UTC in the #core channel of the WooCommerce Community Slack.

New minimum requirements in WooCommerce 3.7 — July 2, 2019

New minimum requirements in WooCommerce 3.7

With the upcoming release of WooCommerce 3.7 we will be updating the minimum required versions of WordPress and PHP. In order to update and run WooCommerce 3.7 you will now be required to have at least WordPress 4.9 and PHP 5.6.

We have to do this to keep up with the code changes within the WordPress ecosystem and to be able to deliver the best experience for our users.

The good news is that according to our research only a very very small percentage of stores are running these outdated versions so the impact will be minimal. What does it mean for your store if affected? Simply put you will not be able to update to WooCommerce 3.7 when it gets released, WordPress will not offer you the update.

We have created a document explaining the details around why updating to newer versions of WordPress and PHP is beneficial and included instructions on how to safely update.

If you have any questions or feedback around the decision and work related to this update, please feel free to leave them in the comments.

WooCommerce Custom Product Tables Beta — July 17, 2018

WooCommerce Custom Product Tables Beta

Today, we’re pleased to announce the beta of our Custom Products Tables plugin that’s designed to improve the performance of WooCommerce stores by adding database tables that are designed for eCommerce.

This builds on the investment we made in 3.0 which introduced Data Stores and CRUD functionality that provides a uniform way of accessing a store’s data regardless of where it is saved.

Why products first? Simply because it’s one of the most complex Data Stores to change, and one which can positively impact stores of all sizes.

The plugin replaces the current WooCommerce product Data Store with one that makes use of brand new, normalised, dedicated product tables.

Performance Improvements

During our tests we set up two identical stores on the same hosting provider with the same theme and WooCommerce settings, the only difference being one was running the Custom Products Table Feature Plugin.

To test the new product tables we needed to easily create a lot of store data – specifically products, orders, and customers. To do that, we created the WooCommerce Smooth Generator – an easy to use development plugin which allows you to generate WooCommerce data to test the scalibilty of any of your development.

For the tests, we created one data set of 500 products and imported that into two identical stores with Storefront as the theme and no other plugins – one store with the normal WooCommerce data structures and the other with our new feature plugin.

Both stores also had 70,000 orders in the database and meta data in the range of 1.4 million rows.

Average Load times

The results, so far, have been great – with improvements of up to 30% on page load times! Checkout, arguably the most important part of the store experience, has seen the biggest performance gains.

Installing the plugin

To install the plugin you will need :

During the beta period we’ve limited access to the plugin’s functionality so that we can gather feedback from our developer community.

We do not recommend that you install and use this on a live store.

Data Migration

There are two WP-CLI commands available at present to migrate your data:
* wp wc-product-tables migrate-data [--clean-old-data] – This command will migrate data from the current WordPress tables to the new tables, passing the –clean-old-data flag will result in the old data being removed from the WordPress tables. Please be cautious when using this flag as it can result in you loosing your product data if not backed up and you need to revert.
* wp wc-product-tables recreate-tables – This command will drop all the new product tables, removing all data within them and then create new clean tables. This command is useful for testing the migration process from fresh again should you wish. Again, please be cautious as if you ran the migrate-data command with the –clean-old-data flag, running this will result in all your data being lost, so always keep a backup on hand of your products.

Do note that any new products created after you have enabled the plugin will be created in the new tables and will not be available if you disable the plugin again.

What tables are added

  • wc_products – Contains product data eliminating the majority of meta data table storage. A few fields in the meta data table not accessed often, and all extension specific data, will stay in meta data.
  • wc_product_attributes – Contains product attributes and their settings.
  • wc_product_attribute_values – Contains product attribute values and their settings.
  • wc_product_downloads – Contains product downloads and their settings.
  • wc_product_relationships – Contains all product relationships to other products or objects within the WooCommerce ecosystem, i.e. other products, images etc.
  • wc_product_variation_attribute_values – Contains variation data for products.

These tables currently cover all aspects of products, including product settings, attributes, variations, downloads, as well as other relationships such as up-sells, cross-sells, grouped products, and images.

Compatibility with extensions and themes

We’ve kept backwards compatibility in mind by adding specific functionality that checks meta data calls and then intervenes to ensure the data gets routed to and from the correct tables.

Whilst we have taken a care in ensuring developers that are not using CRUD can get/set data in the correct tables, we do advise developers with plugins and themes that make direct meta calls to avoid that and rather use the getter and setter methods provided by the Data Stores since version 3.0. We’ve published documentation here to help you move to the CRUD system.

Release Schedule

Our next milestone is to get this plugin released on so that any store can benefit from the performance improvements. To get there, we need your help putting the beta through its paces so we can catch all issues and better understand the performance improvements and problems you’re seeing in the wild.

Once you’ve installed the beta, please open an issue for any problems you encounter on the GitHub repository. And, let us know in the comments what performance improvements you’re seeing – we’d love to hear from you!

We plan to include the new product tables in a major version update early next year.

WC 3.3 Image size improvements — December 11, 2017

WC 3.3 Image size improvements

Let’s face it, product images are a vital driving force behind sales. Combine that with thousands of WooCommerce-enabled themes out there and it can become difficult to have product images that look good out-of-the-box on all of them. WooCommerce 3.3 aims to improve that with some changes to image size settings and the rendering of images.

WooCommerce 3.3 introduces new image cropping settings. Store owners can now control the width and height of their main images, as well as the cropping with visual cues as to what the images might look like on the frontend. Apart from that we are also giving themes with explicit WooCommerce support more control over image settings to ensure that product images look good out of the box.

Theme Support

In the past, theme authors had to make updates to settings directly via update_option calls to change the settings in the DB. This resulted in store owners experiencing issues where they would change image settings in the admin area just to have it revert back to what the theme updates it to on each page load. With WooCommerce 3.3 theme authors can now declare image sizes via the add_theme_support function. Declaring image sizes this way will take priority over any other settings and also hide the image settings section in the admin area.

add_theme_support( 'woocommerce', array(
'thumbnail_image_width' => 150,
'single_image_width' => 322,
) );

Thumbnail Cropping

A new thumbnail cropping section in the customizer will allow store owners to select one of three cropping ration settings with visual cues:

  • 1:1 (Square scropping)
  • Custom (Store owner can enter a custom aspect ratio)
  • Uncropped (Preserve single image aspect ratio)

Image sizes are then calculated based on the cropping option selected and the image width. It is important to note that Single Product Images are uncropped and not affected by the cropping settings.

Automatic Thumbnail Resizing

Apart from the new theme support and cropping settings, we have also introduced automatic thumbnail resizing. In the past when you changed a product image WordPress would not actually resize the image and you had to install a plugin like Regenerate Thumbnails in order to have WordPress resize the images for you. In WooCommerce 3.3 we have now added on-the-fly thumbnail resizing as well as background thumbnail resizing.

How this works is when you change your image settings WooCommerce will kick off a background process that automatically resizes all your images for you to the correct new sizes. While the images are being resized or if for some reason the resizing did not run or complete, we’ve added on-the-fly resizing to the frontend, ensuring that your images will always look great to your customers.

The on-the-fly resizing also plays an important part in ensuring that you have a great experience when visually editing your site through the customizer. If your theme adds support for it you can play around with different image sizes and cropping settings from within the customizer and see the results instantly.

These changes are already in the master branch and will be going out with the WooCommerce 3.3 release in January 2018.

If you have any thoughts or feedback you would like to share, feel free to leave them in the comments.