Develop WooCommerce

The official WooCommerce development blog

WooCommerce 3.4 Beta is here! — April 18, 2018

WooCommerce 3.4 Beta is here!

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

You can download it directly here or WooCommerce prerelease versions are also now available at WordPress.org.

Release highlights

3.4 is the second minor release this year. Being a minor release, all new functionality should exist in a backwards-compatible manner. Updating from any version since 3.0 should be hassle free!

Here is what to look out for in the update.

GDPR compliance

Enforcement of the EU General Data Protection Regulation (GDPR) begins shortly after the release of WooCommerce 3.4. We have added tools and features to help store owners become GDPR-compliant and deal with GDPR requests from customers.

Some of these features include:

  • Ability to add privacy policy text to checkout and account pages
  • Integration with the exporter coming in WordPress core (soon)
  • Tools to clean up (trash) and anonymize old orders which don’t need processing.
  • Tools to remove fields some optional fields from the checkout.

You can read more about how we’re tackling GDPR in WooCommerce core here, or read the readme for the full list.

GeoLite2 integration

WooCommerce uses the MaxMind GeoLite database for geolocation during checkout to automatically select the customer’s correct country. The GeoLite database has been discontinued by MaxMind, and GeoLite2 is the replacement. This release adds support for and integrates WooCommerce with GeoLite2 to ensure geolocation will continue working correctly for the forseeable future. The whole process is automatic and no further action is needed on the store owner’s part to keep geolocation working correctly.

The library that integrates with GeoLite2 requires a minimum PHP version of 5.4. As a necessary step WooCommerce will not support geolocation using GeoLite2 on PHP versions less than 5.4.

On sites running those PHP versions geolocation will be done through the REST API. The API-based geolocation is a slower method, and it is recommended you update your PHP version if you are running a version less than 5.4.

If you need help upgrading your PHP version, here is our handy guide.

Beginning this release, the recommended PHP version for WooCommerce is 7.2.

 

Multisite dashboard widget

WooCommerce 3.4 introduces a new dashboard widget for multisite installs. This widget shows processing and on hold orders the user has access to from across the multisite network. This lets store owners and managers easily see orders that need action without having to manually go and check each site.

This should be a big time-saver for anyone that runs multiple WooCommerce stores using multisite!

Everything else . . .

Other features include:

  • Wildcard email support for coupon restrictions. Using the wildcard character you can set up coupons restricted to groups of similar email addresses (.edu email accounts, corporate email accounts from a certain business, etc.).
  • Users can now set their display name on the My Account page.
  • Improvements to the admin product search, including stopword support and the ability to search for multiple products in the same query.

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

Template file changes

  • auth/form-login.php – Named nonces and used nbsp; to separate the * in required fields to prevent awkward line breaks.
  • cart/cart.php – Named nonces and added filter around backorder notification text.
  • cart/shipping-calculator.php – Named nonces.
  • checkout/form-coupon.php – Use no-js class to to hide forms/content that require JavaScript.
  • checkout/form-login.php – Use no-js class to to hide forms/content that require JavaScript.
  • checkout/form-pay.php – Named nonces.
  • checkout/payment.php – Named nonces.
  • checkout/terms.php – Make sure terms page exists and isn’t trashed. Used nbsp; to separate the * in required fields to prevent awkward line breaks.
  • emails/plain/email-customer-details.php – Fixed converting letters with accents to uppercase.
  • emails/plain/email-downloads.php – Make woocommerce_email_downloads_column_ hook format aware.
  • emails/plain/email-addresses.php – Fixed converting letters with accents to uppercase.
  • emails/plain/customer-reset-password.php – Removed user login from reset password link.
  • emails/plain/email-order-details.php – Fixed converting letters with accents to uppercase.
  • emails/customer-reset-password.php – Removed user login from reset password link.
  • emails/email-downloads.php – Make woocommerce_email_downloads_column_ hook format aware.
  • global/form-login.php – Used nbsp; to separate the * in required fields to prevent awkward line breaks.
  • global/quantity-input.php – Escape and strip tags to prevent broken HTML.
  • myaccount/form-add-payment-method.php – Named nonces.
  • myaccount/form-edit-account.php – Added autocomplete attributes. Used nbsp; to separate the * in required fields to prevent awkward line breaks.
  • myaccount/form-edit-address.php – Named nonces.
  • myaccount/form-login.php – Added class and autocomplete attributes to form. Used nbsp; to separate the * in required fields to prevent awkward line breaks.
  • myaccount/form-lost-password.php – Named nonces and added autocomplete attributes.
  • myaccount/form-reset-password.php – Named nonces and added autocomplete attributes. Used nbsp; to separate the * in required fields to prevent awkward line breaks.
  • order/form-tracking.php – Named nonces.
  • single-product/add-to-cart/grouped.php – Added woocommerce_add_to_cart_form_action filter and class to form.
  • single-product/add-to-cart/simple.php – Added woocommerce_add_to_cart_form_action filter.
  • single-product/add-to-cart/variable.php – Added woocommerce_add_to_cart_form_action filter and fixed variation URL bug when using special characters.
  • single-product/review-meta.php – Add escaping to publish date to prevent broken HTML.
  • templates/archive-product.php – Use woocommerce_product_loop instead of have_posts.

Deprecated functions and methods

  • WC_Geo_IP has been deprecated since the legacy GeoLite database has been deprecated. See the begining of this article for more info.
  • WC_Widget_Product_Tag_Cloud::_get_current_taxonomy has been deprecated for WC_Widget_Product_Tag_Cloud::get_current_taxonomy.
  • WC_Widget_Product_Tag_Cloud::_topic_count_text has been deprecated for WC_Widget_Product_Tag_Cloud::topic_count_text.

Release schedule and testing

We’re hoping to keep WooCommerce 3.4 in beta for the next 5 weeks. If you’re a developer please check extensions and themes are compatible to be safe.

Release Candidate 1 should be tagged on May 9th and will remain in RC for a further 2 weeks until May 23rd 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’d like to help translate 3.4, you’ll find it on the development branch on translate.wordpress.org.

Thanks to all of our testers and contributors!

April 17th: Dev chat #21 — April 3, 2018

April 17th: Dev chat #21

The next chat will be on April 17th 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 for the chat:

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

See you there!

March 27th: Dev chat #20 — March 20, 2018

March 27th: Dev chat #20

The next chat will be on March 27th 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 for the chat:

    • We’ll go over the results of the product type column survey and discuss our decision about the product type column.
    • 3.4 development is underway! We’ll give an update about WooCommerce 3.4 and what you can expect in the release.
    • GDPR is coming! We’ll cover what features we’re adding to WooCommerce to make compliance easier for store owners.

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

See you there!

Theme and Plugin Developer Handbooks — March 9, 2018

Theme and Plugin Developer Handbooks

All of the important information you need when developing plugins and themes for WooCommerce has been summarized, compiled, and aggregated it into two helpful guides: the WooCommerce Theme Developer Handbook and the WooCommerce Plugin Developer Handbook.

These handbooks contain overviews, examples, best practices, and links to other relevant documents. They are an excellent way for people beginning WooCommerce development to get up-to-speed as well as a useful reference for experienced developers.

You can check them out here:

We recommend bookmarking them so you have a handy place to go any time you run into a question while developing WooCommerce-compatible plugins and themes.

If you notice any important topic or links to documentation you reference regularly missing from these handbooks please leave a comment below so we can make these as useful as possible for everyone.

What should happen to the product type column on the admin Products screen? — February 28, 2018

What should happen to the product type column on the admin Products screen?

During the last WooCommerce developer chat we had a productive discussion about the usefulness of the product type icons on the admin Products screen. The topic was originally brought up in this GitHub issue and people seem to have strong feelings about it.

With the current design of the icons it is difficult to tell what type of product each icon represents, and one solution to this would be to improve the icons.

Another possible solution is to remove the column entirely. Removing the column would reduce the clutter on the screen and provide more space for other columns that are more useful.

Feedback from some store owners was that they have this column hidden when managing their stores because the product type of a product does not affect their workflow at all. When they do need to find products of a specific type it is easier and quicker to use the “Filter by product type” dropdown.

This sort of decision should be based on data and not anecdotes, so we have created a poll. If this column is part of your workflow, please also post a comment below explaining how it is used. Your answers and comments will help determine what happens to this column!