Skip to main content

Extensibility in blocks

These documents are all dealing with extensibility in the various WooCommerce Blocks.

Imports and dependency extraction

The documentation in this section will use window globals in code examples, for example:

const { registerCheckoutFilters } = window.wc.blocksCheckout;

However, if you're using @woocommerce/dependency-extraction-webpack-plugin for enhanced dependency management you can instead use ES module syntax:

import { registerCheckoutFilters } from '@woocommerce/blocks-checkout';

See @woocommerce/dependency-extraction-webpack-plugin for more information.

Hooks (actions and filters)

DocumentDescription
ActionsDocumentation covering action hooks on the server side.
FiltersDocumentation covering filter hooks on the server side.
Migrated HooksDocumentation covering the migrated WooCommerce core hooks.

REST API

DocumentDescription
Exposing your data in the Store API.Explains how you can add additional data to Store API endpoints.
Available endpoints to extend with ExtendSchemaA list of all available endpoints to extend.
Available FormattersAvailable Formatters to format data for use in the Store API.
Updating the cart with the Store APIUpdate the server-side cart following an action from the front-end.

Checkout Payment Methods

DocumentDescription
Checkout Flow and EventsAll about the checkout flow in the checkout block and the various emitted events that can be subscribed to.
Payment Method IntegrationInformation about implementing payment methods.
Filtering Payment MethodsInformation about filtering the payment methods available in the Checkout Block.

Checkout Block

In addition to the reference material below, please see the block-checkout package documentation which is used to extend checkout with Filters, Slot Fills, and Inner Blocks.

DocumentDescription
How the Checkout Block processes an orderThe detailed inner workings of the Checkout Flow.
IntegrationInterfaceThe IntegrationInterface class and how to use it to register scripts, styles, and data with WooCommerce Blocks.
Available FiltersAll about the filters that you may use to change values of certain elements of WooCommerce Blocks.
Slots and FillsExplains Slot Fills and how to use them to render your own components in Cart and Checkout.
Available Slot FillsAvailable Slots that you can use and their positions in Cart and Checkout.
DOM EventsA list of DOM Events used by some blocks to communicate between them and with other parts of WooCommerce.
Filter RegistryThe filter registry allows callbacks to be registered to manipulate certain values.
Additional Checkout FieldsThe filter registry allows callbacks to be registered to manipulate certain values.