Skip to main content

Extensible WooCommerce Blocks

WooCommerce provides powerful extensibility mechanisms for customizing Cart, Checkout, and Product Collection blocks without modifying core code. This guide covers filters, Slot Fills, inner blocks, and integration points.

Overview

Extensible blocks support three primary customization approaches:
  1. Filters: Modify data and rendering output (prices, labels, CSS classes)
  2. Slot Fills: Inject custom components into predefined locations
  3. Inner Blocks: Add custom nested blocks to extensible parent blocks

Filter Registry

The Filter Registry allows you to register callbacks that modify block behavior and appearance.

Registering Filters

Use registerCheckoutFilters to register multiple filters at once:
The first parameter (my-extension) is your unique namespace. Use your plugin slug to avoid conflicts.

Available Cart & Checkout Filters

Cart Line Items

Checkout Actions

Totals and Coupons

Context-Aware Filtering

Filters receive context information to enable conditional logic:
The args parameter contains context, cartItem, and extensions data. Always check context to ensure filters apply in the right location.

Slot Fills

Slot Fills allow you to inject custom React components into predefined locations in Cart and Checkout blocks.

Using Slot Fills

Available Slots

ExperimentalOrderMeta

Renders below the order summary, above “Proceed to Checkout”:
Passed Props:
  • cart: Cart data in camelCase
  • extensions: Custom data from ExtendSchema
  • context: Block name (woocommerce/cart or woocommerce/checkout)

ExperimentalOrderShippingPackages

Renders inside shipping options:
Passed Props:
  • collapsible: Whether panels are collapsible
  • collapse: Whether panels start collapsed
  • showItems: Whether to show package contents
  • noResultsMessage: React element for no results
  • renderOption: Function to render shipping rates
  • cart, extensions, context, components

ExperimentalOrderLocalPickupPackages

Renders in Checkout Pickup Options (Checkout only):
Passed Props:
  • renderPickupLocation: Function to render pickup address
  • cart, extensions, components

ExperimentalDiscountsMeta

Renders below the coupon code input:
Passed Props:
  • cart, extensions, context
Slots prefixed with Experimental are subject to change. They may be renamed or removed in future versions. Monitor WooCommerce release notes when upgrading.

Inner Blocks

Add custom blocks as children of Cart and Checkout blocks.

Creating an Inner Block

Registering Inner Blocks

Register your inner block type with the filter:

Product Collection Extensibility

Product Collection blocks support custom collections and filters.

Registering Custom Collections

Custom Collection with Query

Custom Inner Blocks

Preview State Management

DOM Events

WooCommerce blocks emit custom DOM events for inter-block communication.

Cart & Checkout Events

Product Collection Events

Integration Interface

Use IntegrationInterface to properly register scripts and data:
Register the integration:

Troubleshooting

Filter Not Working

If logged in as administrator, you’ll see error messages in the UI and console:

Slot Fill Not Rendering

Ensure correct scope:

Script Not Loading

Verify asset file is generated:
Check dependencies are enqueued:

Next Steps

Tutorials

Build complete examples step-by-step

Store API Extension

Add custom data to cart and checkout endpoints

Additional Checkout Fields

Add custom fields to checkout forms

Payment Method Integration

Create custom payment method blocks