Version 2.3.0 of WooCommerce Blocks feature plugin is now available. This release includes some new blocks (detailed below) and a new build system under the hood.
Featured Category Block
The new featured category block allows you to visually highlight a product category and encourage users to click through to view its products.
It works similarly to the Featured Product Block; you can control the displayed image, overlay color, and whether or not to display the description.
Products by Tag(s) block
The Products by Tag block works in the same way as the Products by Category block; choose a tag and the products within that tag will be shown in a grid.
Existing block enhancements
Some of our existing blocks have been improved in this version, the highlights include:
- The Featured Product now lets you feature a product variation! Selecting a variable product will now reveal its variations. The call to action links to the product page with the variation pre-selected.
- Add to cart buttons in product grids can now be optionally aligned horizontally across the row if content lengths vary.
- Edits to categories in the Products by Category block can now be discarded by using a new ‘cancel’ link, instead of persisting immediately.
Changes to the build system and minimum PHP version
In 2.3 we’ve made some improvements to how the blocks plugin is released and bundled in WooCommerce. As of version 3.7, WooCommerce uses Composer during a build step to pull in packages from Packagist, blocks included.
The new blocks package is also deployed to WordPress.org as a feature plugin.
WooCommerce core will use the latest version of the plugin it finds. End-users won’t see any difference, but for developers (and our team) it makes deploying updates simpler and reduces the likelihood of conflicts between different versions installed at the same time.
As well as moving to the package system, we’re using a Composer autoloader in blocks 2.3 and we have improved our PHP codebase to use modern dev practices. This means blocks 2.3 has a PHP 5.6+ requirement like WooCommerce 3.7. WordPress does version checking before updates, but if you’re installing or updating blocks plugin manually, ensure you’re using a supported version of PHP first.
Our contributing doc has been updated to reflect these changes.
In the coming weeks we’ll be releasing some new blocks to display product reviews, and kicking off development for product filtering blocks. Stay tuned for updates!
Using WooCommerce Blocks
If you’re using WooCommerce core you’ll have access to blocks, however, for the newest developments you may want to use our feature plugin as well. To get started:
- Head over to your admin dashboard and go to Plugins > Add New.
- Enter the search keyword
- Look for the WooCommerce Blocks plugin and click Install Now.
Once installed and activated you can use the new features listed in this post.
As always, if you have feature requests, or spot any bugs, please log them in detail on Github.