Cart and Checkout Blocks: Becoming the Default Experience

This post was updated on November 15, 2023, to include instructions on declaring incompatibility with the new experience.

In today’s highly competitive business landscape, merchants need a streamlined and optimized out-of-the-box checkout experience. WooCommerce has been investing in a new seamless checkout flow while harnessing the power of Blocks for easy look and feel customizations without the need for coding. The Cart and Checkout blocks offer conversion-optimized features and a simplified shopper flow. With easy customization options, merchants can maintain their brand identity and provide a visually appealing and consistent checkout journey for their customers.

Over the past months, the Cart and Checkout blocks were available as optional features in WooCommerce Core. Now, the time has come to transition the Cart and Checkout blocks out of the Beta phase and make them the default experience for all new users in the upcoming November release of WooCommerce Core (8.3). This move is crucial as we’re committed to delivering a fast and performant checkout experience and maximizing the value we provide to our users.

The Cart and Checkout shortcodes will continue to be available in WooCommerce Core for existing stores that have customized checkout flows requiring them, and for any new stores that have specific needs not yet possible with the Cart and Checkout blocks. We are continuing to promote, encourage, and equip third-party developers to transition their code to be compatible with the new checkout experience as the future of WooCommerce.

Documentation

All the documentation is available in our GitHub repository. For integration work, the WooCommerce Blocks Handbook is the best starting point. It includes a section specifically dedicated to third-party developers and comprehensive Developer Resources. We also offer components and utilities to aid smoother integrations with the WooCommerce Mini-Cart, Cart, and Checkout Blocks. The components can also be viewed in Storybook.

Declare compatibility with the Cart and Checkout blocks

Declaring compatibility in your extension is straightforward, and helps merchants better understand the root cause if compatibility conflicts arise. Extensions will fall into 3 categories, which will determine next steps to take:

  1. If an extension is incompatible with the Cart and Checkout Blocks, it should declare its incompatibility.
  2. If an extension is compatible with the Cart and Checkout Blocks, it should declare its compatibility.
  3. If an extension isn’t related to the Cart and Checkout flow, then no actions are required.

In order to declare compatibility, you will need to take the following steps:

Declare WC tested up to in your main plugin file(s) using the WooCommerce version support header, WC tested up to:

 /*

 * Plugin Name: WooCommerce Example Extension

 * Plugin URI: https://wordpress.org/plugins/[EXAMPLE EXTENSION]/

 * Description: Sample description

 * Author: WooCommerce

 * Author URI: https://woocommerce.com/

 * Version: 1.0.0

 * Text Domain: woocommerce-example-extension

 * Domain Path: /languages

 * WC requires at least: 6.0

 * WC tested up to: 8.0

 */

As many WordPress extensions aren’t WooCommerce related, we will only check for compatibility in extensions which use the WC tested up to header. 

Next, add the following code snippet to your main plugin file(s) for compatible extensions:

add_action( 'before_woocommerce_init', function() {

    if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {

        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, true );

    }

} );



Add the following code snippet to your main plugin file(s) for incompatible extensions:

add_action( 'before_woocommerce_init', function() {

    if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {

        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, false );

    }

} );

How can we help you?

If you need a new extensibility point, utility, or component, you should make a request in our GitHub repository. The WooCommerce team will thoroughly evaluate proposals for missing functionality based on key factors like feasibility, impact on the shopper experience, and priority compared to other roadmap initiatives. The clearer the use case, the better we are able to assess the priority of addressing the request.

If you have any questions during the integration process, our recommendation is to reach out on our GitHub Discussions section Q&A – Extension Integrations and Customizations or in the Community Slack #woocommerce-blocks-and-block-themes channel.

Our team usually prioritizes extensibility/integration-related questions, as they tend to be helpful for expanding the Checkout feature set and improving the shopper experience.

Frequently Asked Questions

Do you plan to add new extensibility options to the Cart and Checkout blocks?

We’re currently exploring introducing new capabilities, such as replacing the “Place order” button with a custom component, to ensure you can easily extend the Blocks experience providing merchants with valuable features to boost checkout conversions, increase shopper engagement, and maximize their lifetime value. We’ll have more news coming soon.

How can the user revert to the Cart and Checkout shortcodes?

The user can switch back to the shortcode-based cart or checkout by doing the following:

  1. Click on the Pages menu item, and then locate and edit the Cart or Checkout page.
  2. In the Editor, enable the List View and then locate the Cart or Checkout Block.
  3. Select and delete the Cart or Checkout block.
  4. Add a new Shortcode block in its place.
  5. Type [woocommerce_cart] or [woocommerce_checkout] in the Shortcode block, depending on whether he wants to restore the shortcode-based cart or checkout.
  6. Save the changes.

We’re working on a complementary flow that allows users to revert to shortcodes with fewer steps. We’ll publish a post with all the details. 

As we approach the November release of WooCommerce Core, we encourage you to embrace this new experience. Together, we can build a win-win situation for everyone involved and deliver a fast, performant, and shopper-friendly checkout flow.


Keep yourself in the loop!

Sign up for the WooCommerce developer newsletter:
This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form


7 responses to “Cart and Checkout Blocks: Becoming the Default Experience”

  1. That’s a lot of documentation…. is there, somewhere in there, a simple step-by-step tutorial? e.g. On how to add a new field to the checkout? (I couldn’t find one). I see the tutorials on doing things with payment gateways.

    1. Possibly the answer to my own question is “by implementing a forced inner block”. The documentation could really do with some FAQs that address real-world questions, to supplement the comprehensiveness of the “here’s a full technical manual for someone who’s already pretty familiar with the innards of this” approach.

      1. Thank you so much for reaching out David. We recently published a video tutorial: Extending the WooCommerce Checkout Block https://developer.woocommerce.com/2023/08/07/extending-the-woocommerce-checkout-block-to-add-custom-shipping-options/.

        You can see here how to add a new field. I also recommend looking at the Developer Resources section from our docs https://github.com/woocommerce/woocommerce-blocks/tree/trunk/docs#developer-resources

        We are in the process of updating our documentation around extensibility so we really appreciate your feedback.

  2. Christian Johansson Avatar
    Christian Johansson

    The added complexity and lack of easy documentation makes this look like an attempt to exclude third-party integrators from extending the WooCommerce checkout, similar to Magento 2 Adobe lockdown this is maybe the start of the end of WooCommerce in the competition of open e-commerce systems.

    The distributed minified source files like ‘assets/client/blocks/checkout-blocks/billing-address-frontend.js’ are not open in the sense that anyone can see what is going on in them. They are starting to become more or less like binary files.

    WooCommerce moves a lot closer to Shopify but the difference is that Shopify is a closed system and WooCommerce is supposed to be a open project

    1. Nadir Seghir Avatar
      Nadir Seghir

      Hey Christian! Thank you for your feedback.

      makes this look like an attempt to exclude third-party integrators from extending the WooCommerce checkout

      This couldn’t be further from the truth, yet I understand the frustration. In reality, our main goal and everyday focus is to bring plugins and third-party developers to up date with the new Checkout. This is our one of the metrics we benchmark ourselves with.

      The distributed minified source files like ‘assets/client/blocks/checkout-blocks/billing-address-frontend.js’ are not open in the sense that anyone can see what is going on in them. They are starting to become more or less like binary files.

      We moved away from shipping source code because it was bloating the zip file and causing unnessarry downloades, the source remains open in github, where we do all of our planning and work.

      The file you linked to is here.
      https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/assets/js/blocks/checkout/inner-blocks/checkout-billing-address-block/frontend.tsx

      You can see the file in the editor directly and navigate from there:

      https://github.dev/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/assets/js/blocks/checkout/inner-blocks/checkout-billing-address-block/frontend.tsx

      You can see everything that the Checkout team worked on and is working here:
      https://github.com/woocommerce/woocommerce/issues?q=label:%22team:+Rubik%22+

      WooCommerce moves a lot closer to Shopify but the difference is that Shopify is a closed system and WooCommerce is supposed to be a open project

      We continue to be open in our development and discussions, most discussions happen in github.

      This is a recent project we worked on in which 20+ person from the community shimmed in with comments, suggestions, and enhancement.

      https://github.com/woocommerce/woocommerce/discussions/42995

      What I can see is that for Checkout, we’re more opinionated about how to edit it and extend it, we’re playing it safe here. We can’t commit to extensibility patterns we can’t maintain or end up removing. Checkout is a critical step in a shop journey and it what makes or breaks a store conversion.

  3. Aaron Bennett Avatar
    Aaron Bennett

    This seems like a step backward for customisation, or at least easy customisation – all I want to do is add a gift message text field directly under the additional notes, but this seems so convoluted trying to find instructions / tutorials.

    The new cart and checkout look great and are fairly easy to style, but a nightmare trying to extend functionality.

    1. Nadir Seghir Avatar
      Nadir Seghir

      Adding fields to Checkout block is easier than ever, even easier than the old Checkout, with a single function call:

      https://developer.woocommerce.com/docs/cart-and-checkout-additional-checkout-fields/

Leave a Reply

Your email address will not be published. Required fields are marked *