woocommerce/docs/block-development/reference/hooks/zh-cn/hook-alternatives.md
2026-04-15 10:18:01 +08:00

43 KiB

sidebar_label
Hook alternatives

Hook alternatives

These are the hooks that run when loading the Cart/Checkout shortcodes and blocks. Some are general WooCommerce lifecycle hooks, some are specific to the Cart and Checkout pages. These were generated by logging each call to do_action and apply_filters and reviewing the issues mentioning "hooks" and "filter(s)" in the old WooCommerce Blocks repository.

Legend

Icon Description
Fully supported
🔶 Partially supported
Not supported
Unknown

If a hook is marked as Unknown (Unknown) it means we were not able to verify whether the hook is supported for some reason. As time goes on, we will attempt to validate more of these hooks. The goal is to have no hooks with an Unknown status remaining in any of the tables.

WooCommerce lifecycle actions

These hooks run on every Woo page load, some affect the blocks, some don't, some only affect them partially.

Old hook Works in blocks? Notes
woocommerce_load_cart_from_session Fully supported
woocommerce_cart_loaded_from_session Fully supported
woocommerce_set_cart_cookies Fully supported
woocommerce_shipping_zone_loaded Fully supported
woocommerce_check_cart_items Fully supported May be better to use woocommerce_store_api_validate_cart_item
woocommerce_before_calculate_totals Fully supported
woocommerce_shipping_init Fully supported
woocommerce_load_shipping_methods Fully supported
woocommerce_cart_calculate_fees Fully supported
woocommerce_calculate_totals Fully supported
woocommerce_after_calculate_totals Fully supported
woocommerce_cart_updated Fully supported
woocommerce_before_get_rates_for_package Fully supported
woocommerce_after_get_rates_for_package Fully supported
woocommerce_checkout_init Fully supported
woocommerce_customer_loaded Fully supported

WooCommerce lifecycle filters

Old hook Works in blocks? Notes
woocommerce_notice_types Unknown WC Blocks does not handle additional notice types outside of the core ones. Non-supported notices would be displayed as "info" notices.
woocommerce_kses_notice_allowed_tags Unknown
woocommerce_product_get_stock_status Fully supported
woocommerce_product_is_in_stock Fully supported
woocommerce_product_get_manage_stock Unknown
woocommerce_product_get_tax_class Fully supported
woocommerce_product_get_tax_status Unknown
woocommerce_prices_include_tax Unknown
woocommerce_apply_base_tax_for_local_pickup Unknown
woocommerce_local_pickup_methods Not supported Does not affect the blocks-based local pickup methods
woocommerce_customer_get_shipping_postcode Fully supported
woocommerce_customer_get_shipping_city Fully supported
woocommerce_customer_taxable_address Unknown
woocommerce_shipping_methods Fully supported
woocommerce_format_localized_price Unknown
woocommerce_shipping_local_pickup_option Not supported Does not affect the blocks-based local pickup methods
woocommerce_shipping_pickup_location_option Unknown Unsure if changing this changes the way local pickup shows in the Cart/Checkout
woocommerce_shipping_method_supports Fully supported
woocommerce_get_tax_location Unknown
woocommerce_format_postcode Unknown
woocommerce_matched_tax_rates Unknown
woocommerce_find_rates Unknown
woocommerce_matched_rates Unknown
woocommerce_cart_totals_get_item_tax_rates Fully supported
woocommerce_adjust_non_base_location_prices Unknown
woocommerce_product_is_taxable Fully supported
woocommerce_price_ex_tax_amount Fully supported
woocommerce_tax_round Fully supported
woocommerce_calc_tax Fully supported
woocommerce_calculate_item_totals_taxes Fully supported
woocommerce_cart_ready_to_calc_shipping Fully supported
woocommerce_product_get_virtual Fully supported
woocommerce_is_virtual Fully supported
woocommerce_product_needs_shipping Fully supported
woocommerce_cart_needs_shipping Fully supported
woocommerce_customer_get_shipping_address_1 Fully supported
woocommerce_customer_get_shipping_address_2 Fully supported
woocommerce_cart_display_prices_including_tax Fully supported
woocommerce_cart_get_subtotal Fully supported
woocommerce_cart_shipping_packages Fully supported
woocommerce_product_get_shipping_class_id Fully supported
woocommerce_countries_shipping_countries Fully supported
woocommerce_get_zone_criteria Fully supported
woocommerce_shipping_zone_shipping_methods Fully supported
woocommerce_shipping_free_shipping_is_available Unknown
woocommerce_product_get_name Fully supported
woocommerce_shipping_method_add_rate Fully supported
woocommerce_shipping_flat_rate_is_available Fully supported
woocommerce_evaluate_shipping_cost_args Fully supported
woocommerce_calc_shipping_tax Fully supported
woocommerce_localisation_address_formats Fully supported
woocommerce_countries_base_country Unknown
woocommerce_formatted_address_force_country_display Unknown
woocommerce_states Fully supported
woocommerce_formatted_address_replacements Unknown
woocommerce_package_rates Fully supported
woocommerce_shipping_packages Fully supported
woocommerce_shipping_rate_method_id Fully supported
woocommerce_shipping_rate_taxes Fully supported
woocommerce_shipping_rate_cost Fully supported
woocommerce_cart_totals_get_fees_from_cart_taxes Fully supported
woocommerce_calculated_total Not supported This does not seem to have any effect
woocommerce_cart_get_discount_total Fully supported
woocommerce_cart_get_cart_contents_total Fully supported
woocommerce_get_price_excluding_tax Not supported This does not seem to have any effect
raw_woocommerce_price Not supported This does not seem to have any effect
formatted_woocommerce_price Not supported This does not seem to have any effect
woocommerce_price_trim_zeros Not supported This does not seem to have any effect
woocommerce_get_cart_page_permalink Not supported This does not seem to have any effect
woocommerce_get_cart_url Not supported This does not seem to have any effect
woocommerce_checkout_registration_enabled Fully supported This does not seem to have any effect
woocommerce_get_checkout_page_permalink Not supported This does not seem to have any effect
woocommerce_get_checkout_url Not supported This does not seem to have any effect
woocommerce_checkout_get_value Not supported This does not seem to have any effect
woocommerce_default_address_fields Not supported This does not seem to have any effect
default_checkout_billing_country Not supported This does not seem to have any effect
default_checkout_shipping_country Not supported This does not seem to have any effect
woocommerce_get_country_locale Fully supported
woocommerce_get_country_locale_default Unknown
woocommerce_get_country_locale_base Unknown
woocommerce_billing_fields Partially supported 🔶 Editing core fields is not supported, but adding them is via Additional Checkout Fields API
woocommerce_shipping_fields Partially supported 🔶 Editing core fields is not supported, but adding them is via Additional Checkout Fields API
woocommerce_checkout_fields Partially supported 🔶 Editing core fields is not supported, but adding them is via Additional Checkout Fields API
woocommerce_cart_item_product Not supported Modifying individual cart items is not possible
woocommerce_payment_gateway_supports Fully supported
woocommerce_customer_get_billing_first_name Fully supported
woocommerce_customer_get_billing_last_name Fully supported
woocommerce_customer_get_billing_company Fully supported
woocommerce_customer_get_billing_address_1 Fully supported
woocommerce_customer_get_billing_address_2 Fully supported
woocommerce_customer_get_billing_city Fully supported
woocommerce_customer_get_billing_postcode Fully supported
woocommerce_customer_get_billing_phone Fully supported
woocommerce_customer_get_shipping_first_name Fully supported
woocommerce_customer_get_shipping_last_name Fully supported
woocommerce_customer_get_shipping_company Fully supported
woocommerce_get_item_data Partially supported 🔶 Checkout blocks strip most HTML from metadata, allowing only a, b, em, i, strong, br, abbr, and span.
woocommerce_cart_get_subtotal_tax Not supported This does not seem to have any effect
woocommerce_shipping_package_name Fully supported
woocommerce_shipping_rate_id Unknown
woocommerce_shipping_rate_label Fully supported
woocommerce_cart_get_shipping_taxes Fully supported
woocommerce_cart_get_fee_taxes Fully supported
woocommerce_cart_get_taxes Fully supported
woocommerce_rate_code Unknown
woocommerce_rate_compound Unknown
woocommerce_rate_label Fully supported
woocommerce_cart_hide_zero_taxes Unknown
woocommerce_cart_tax_totals Fully supported
woocommerce_cart_needs_payment Fully supported
woocommerce_order_class Fully supported
woocommerce_checkout_registration_required Unknown
woocommerce_privacy_policy_page_id Fully supported
woocommerce_get_terms_page_id Unknown
woocommerce_terms_and_conditions_page_id Unknown
woocommerce_cart_contents_count Unknown
woocommerce_country_locale_field_selectors Not supported
woocommerce_get_return_url Fully supported
woocommerce_cart_hash Fully supported
woocommerce_cart_get_fee_tax Fully supported
woocommerce_customer_default_location_array Fully supported
woocommerce_countries Fully supported
woocommerce_sort_countries Not supported This does not seem to have any effect
woocommerce_countries_allowed_countries Fully supported
woocommerce_customer_default_location_array Fully supported
woocommerce_customer_get_billing_country Fully supported
woocommerce_customer_get_shipping_country Fully supported
woocommerce_customer_get_billing_state Fully supported
woocommerce_customer_get_shipping_state Fully supported
woocommerce_customer_get_billing_email Fully supported
woocommerce_cart_session_initialize Fully supported
woocommerce_get_checkout_page_id Fully supported
woocommerce_get_cart_page_id Fully supported
woocommerce_is_checkout Fully supported
woocommerce_currency Fully supported
woocommerce_currency_symbols Fully supported
woocommerce_currency_symbol Fully supported
woocommerce_price_format Fully supported
woocommerce_coupons_enabled Fully supported
woocommerce_get_shop_page_id Fully supported
current_theme_supports-woocommerce Fully supported
woocommerce_payment_gateways Partially supported 🔶 Integration with WC Blocks is still required, beyond unsetting gateways, manipulating the payment gateways here may not work in the Cart and Checkout blocks
woocommerce_get_base_location Fully supported
woocommerce_gateway_icon Not supported This hook has no effect since icons are not displayed.
woocommerce_get_image_size_thumbnail Fully supported
woocommerce_get_image_size_single Fully supported
woocommerce_product_stock_status_options Fully supported
woocommerce_cart_item_name Not supported Use the itemName checkout filter.
woocommerce_product_get_status Fully supported
woocommerce_product_get_price Fully supported
woocommerce_is_purchasable Fully supported
woocommerce_cart_item_is_purchasable Fully supported
woocommerce_cart_item_data_to_validate Fully supported
woocommerce_get_cart_item_from_session Fully supported
woocommerce_cart_contents_changed Fully supported
woocommerce_get_cart_contents Fully supported
woocommerce_stock_amount Fully supported
woocommerce_cart_item_remove_link Not supported Use the showRemoveItemLink checkout filter.
woocommerce_cart_item_quantity Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_product_get_image Not supported Use woocommerce_store_api_cart_item_images (PR Link with example.)
woocommerce_cart_no_shipping_available_html Not supported This is not editable
woocommerce_available_payment_gateways Partially supported 🔶 Integration with WC Blocks is still required, beyond unsetting gateways, manipulating the payment gateways here may not work in the Cart and Checkout blocks
woocommerce_cart_get_total Fully supported
woocommerce_cart_get_fee_tax Fully supported
woocommerce_cart_get_cart_contents_tax Fully supported
woocommerce_cart_get_shipping_tax Fully supported
woocommerce_cart_get_shipping_total Fully supported

Cart actions

Old hook Works in blocks? Notes
woocommerce_before_cart Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Cart items" block could work, but it would have to be positioned manually by the merchant. It is also possible to use the render_block_{$name} filter to render before and after blocks using PHP.
woocommerce_before_cart_table Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Cart items" block could work, but it would have to be positioned manually by the merchant.
woocommerce_before_cart_contents Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Cart items" block could work, but it would have to be positioned manually by the merchant.
woocommerce_after_cart_item_name Not supported Use the itemName checkout filter.
woocommerce_before_quantity_input_field Not supported No equivalent now.
woocommerce_after_quantity_input_field Not supported No equivalent now.
woocommerce_cart_contents Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Cart items" block could work, but it would have to be positioned manually by the merchant.
woocommerce_cart_coupon Not supported ExperimentalDiscountsMeta slot/fill
woocommerce_cart_actions Not supported ExperimentalOrderMeta slot/fill
woocommerce_after_cart_contents Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Cart items" block could work, but it would have to be positioned manually by the merchant.
woocommerce_after_cart_table Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Cart items" block could work, but it would have to be positioned manually by the merchant.
woocommerce_before_cart_collaterals Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Cart items" block could work, but it would have to be positioned manually by the merchant.
woocommerce_cart_collaterals Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Cart items" block could work, but it would have to be positioned manually by the merchant.
woocommerce_before_cart_totals Not supported ExperimentalOrderMeta slot/fill
woocommerce_cart_totals_before_shipping Not supported ExperimentalOrderShippingPackages
woocommerce_after_shipping_rate Not supported ExperimentalOrderShippingPackages
woocommerce_before_shipping_calculator Not supported No specific equivalent. Closest thing is ExperimentalOrderShippingPackages
woocommerce_after_shipping_calculator Not supported No specific equivalent. Closest thing is ExperimentalOrderShippingPackages
woocommerce_cart_totals_after_shipping Not supported No specific equivalent. Closest thing is ExperimentalOrderShippingPackages
woocommerce_cart_totals_before_order_total Not supported No specific equivalent but we do have the totals footer item filters
woocommerce_cart_totals_after_order_total Not supported No specific equivalent but we do have the totals footer item filters
woocommerce_proceed_to_checkout Not supported No specific equivalent but the Checkout and Place Order button filters may work
woocommerce_after_cart_totals Not supported ExperimentalOrderMeta slot/fill
woocommerce_after_cart Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Cart items" block could work, but it would have to be positioned manually by the merchant.

Cart filters

Old hook Works in blocks? Notes
woocommerce_cart_item_product_id Not supported This does not seem to have any effect
woocommerce_cart_item_visible Not supported This does not seem to have any effect
woocommerce_get_remove_url Not supported The removal of items is handled async in the Cart block.
woocommerce_cart_item_remove_link Not supported The removal of items is handled async in the Cart block.
woocommerce_cart_item_thumbnail Not supported Changing the thumbnail this way is not supported. See woocommerce_store_api_cart_item_images (PR Link with example.)
woocommerce_cart_product_price Not supported
woocommerce_cart_item_price Not supported
woocommerce_quantity_input_classes Not supported
woocommerce_quantity_input_max Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_quantity_input_min Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_quantity_input_step Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_quantity_input_pattern Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_quantity_input_inputmode Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_quantity_input_placeholder Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_quantity_input_autocomplete Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_quantity_input_args Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_quantity_input_type Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_cart_item_quantity Not supported This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.
woocommerce_cart_product_subtotal Not supported
woocommerce_cart_item_subtotal Not supported
woocommerce_cross_sells_columns Not supported The cross sells are rendered as an inner block.
woocommerce_cross_sells_orderby Not supported The cross sells are rendered as an inner block.
woocommerce_cross_sells_order Not supported The cross sells are rendered as an inner block.
woocommerce_cross_sells_total Not supported The cross sells are rendered as an inner block.
woocommerce_product_cross_sells_products_heading Not supported This can be modified in the editor.
woocommerce_is_downloadable Not supported Does not seem to have any effect in Cart/Checkout blocks.
woocommerce_loop_product_link Not supported Changing the product links is not supported in the Cart block.
woocommerce_product_loop_title_classes Not supported Changing classes to product titles is not supported in the Cart block.
woocommerce_product_add_to_cart_aria_describedby Not supported Changing aria-describedby on products is not supported in the Cart block.
woocommerce_sale_flash Not supported This can be modified with the saleBadgePriceFormat checkout filter.
woocommerce_cart_subtotal Not supported Modifying the cart subtotal display is not supported in the Cart/Checkout blocks
oocommerce_shipping_package_details_array Not supported This hook is not fired during Cart block rendering
woocommerce_shipping_show_shipping_calculator Not supported This is only used when rendering cart templates, which does not happen in the blocks.
woocommerce_cart_shipping_method_full_label Not supported This hook has no effect in the Cart/Checkout blocks.
woocommerce_get_shipping_tax Not supported This filter is not used in the Cart/Checkout blocks.
woocommerce_shipping_calculator_enable_country Not supported This filter is not used in the Cart/Checkout blocks.
woocommerce_shipping_calculator_enable_state Not supported This filter is not used in the Cart/Checkout blocks.
woocommerce_shipping_calculator_enable_city Not supported This filter is not used in the Cart/Checkout blocks.
woocommerce_shipping_calculator_enable_postcode Not supported This filter is not used in the Cart/Checkout blocks.
woocommerce_cart_totals_fee_html Not supported Modifying the fees display is not supported in the Cart/Checkout blocks
woocommerce_countries_estimated_for_prefix Not supported
woocommerce_cart_total Not supported Modifying the cart total using this hook is not supported in the Cart/Checkout blocks
woocommerce_cart_totals_order_total_html Not supported Modifying the cart total using this hook is not supported in the Cart/Checkout blocks

Checkout actions

Old hook Works in blocks? Notes
woocommerce_before_checkout_form_cart_notices Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_before_checkout_form Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_before_customer_details Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_billing Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_before_checkout_billing_form Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_after_checkout_billing_form Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_shipping Not supported Not directly equivalent due to positioning, but ExperimentalOrderShippingPackages could work - so could adding an inner block to the shipping block
woocommerce_before_checkout_shipping_form Not supported Not directly equivalent due to positioning, but ExperimentalOrderShippingPackages could work - so could adding an inner block to the shipping block
woocommerce_after_checkout_shipping_form Not supported Not directly equivalent due to positioning, but ExperimentalOrderShippingPackages could work - so could adding an inner block to the shipping block
woocommerce_before_order_notes Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_after_order_notes Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_after_customer_details Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_before_order_review_heading Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_before_order_review Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_order_review Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_before_cart_contents Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_after_cart_contents Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_before_shipping Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_after_shipping_rate Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_after_shipping Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_before_order_total Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_after_order_total Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_before_payment Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block or Payment block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_before_terms_and_conditions Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_terms_and_conditions Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_after_terms_and_conditions Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_before_submit Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_after_submit Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_review_order_after_payment Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block or Payment block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_after_order_review Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Order Summary" block could work, but it would have to be positioned manually by the merchant.
woocommerce_after_checkout_form Not supported No specific equivalent and no Slot/fill for this area. Maybe adding an inner block to the "Checkout Fields" block could work, but it would have to be positioned manually by the merchant.
woocommerce_checkout_update_order_review Not supported These type of AJAX events do not occur when using the Cart/Checkout blocks

Checkout filters

Old hook Works in blocks? Notes
woocommerce_add_notice Partially supported 🔶 These notices are only added on page load of the Cart/Checkout blocks. Any that happen during API requests are stored and output on the next full page load.
woocommerce_checkout_coupon_message Not supported The coupon message cannot be customised using this filter.
woocommerce_form_field_args Not supported Modifying core form fields is not supported yet in the Cart/Checkout blocks.
woocommerce_form_field_text Not supported Modifying core form fields is not supported yet in the Cart/Checkout blocks.
woocommerce_form_field Not supported Modifying core form fields is not supported yet in the Cart/Checkout blocks.
woocommerce_form_field_country Not supported Modifying core form fields is not supported yet in the Cart/Checkout blocks.
woocommerce_form_field_state Not supported Modifying core form fields is not supported yet in the Cart/Checkout blocks.
woocommerce_form_field_tel Not supported Modifying core form fields is not supported yet in the Cart/Checkout blocks.
woocommerce_form_field_email Not supported Modifying core form fields is not supported yet in the Cart/Checkout blocks.
woocommerce_cart_needs_shipping_address Not supported The wc/store/cart data store should be used to control this.
woocommerce_ship_to_different_address_checked Not supported The wc/store/checkout data store should be used to check if this checkbox is checked.
woocommerce_enable_order_notes_field Not supported This block must be removed in the editor, this filter will not affect its presence in the Checkout block
woocommerce_form_field_textarea Not supported Modifying core form fields is not supported yet in the Cart/Checkout blocks.
woocommerce_checkout_cart_item_visible Not supported It is not possible to filter cart items from the order summary in the Cart/Checkout blocks.
woocommerce_cart_item_class Not supported It is not possible to add classes to specific cart items in the order summary in the Cart/Checkout blocks.
woocommerce_checkout_cart_item_quantity Not supported It is not possible to modify the quantity display of cart items in the order summary in the Cart/Checkout blocks.
woocommerce_cart_product_subtotal Not supported Modifying the product subtotal display is not supported in the Cart/Checkout blocks
woocommerce_cart_item_subtotal Not supported Modifying the product subtotal display is not supported in the Cart/Checkout blocks
woocommerce_cart_subtotal Not supported Modifying the cart subtotal display is not supported in the Cart/Checkout blocks
woocommerce_cart_shipping_method_full_label Not supported Modifying the shipping method display is not supported in the Cart/Checkout blocks
woocommerce_get_shipping_tax Not supported This filter is not used in the Cart/Checkout blocks.
woocommerce_cart_totals_fee_html Not supported Modifying the fees display is not supported in the Cart/Checkout blocks
woocommerce_cart_total Not supported Modifying the cart total using this hook is not supported in the Cart/Checkout blocks
woocommerce_cart_totals_order_total_html Not supported Modifying the order total html using this hook is not supported in the Cart/Checkout blocks - edit it using the editor.
woocommerce_order_button_text Not supported Modifying the order button html using this hook is not supported in the Cart/Checkout blocks - edit it using the editor.
woocommerce_gateway_title Not supported These can be included in the "Content" rendered by gateways registered with the Cart/Checkout block but it is not possible to control this via PHP filters.
woocommerce_gateway_icon Not supported Gateway icons are not shown. They can be included in the "Content" rendered by gateways registered with the Cart/Checkout block but it is not possible to control this via PHP filters.
woocommerce_gateway_description Not supported Changing gateways this way is not possible, gateways need to register with the Cart/Checkout blocks using JavaScript and third party extensions can't modify these front-end details.
woocommerce_checkout_show_terms Not supported This is not controllable via this filter. The block can be removed in the editor.
woocommerce_get_privacy_policy_text Not supported Modifying the privacy policy text using this filter is not supported. It can be modified in the editor.
woocommerce_order_button_html Not supported Modifying the order button html using this hook is not supported in the Cart/Checkout blocks - edit it using the editor.
woocommerce_update_order_review_fragments Not supported Fragments are not used on the Cart/Checkout blocks.

Place order actions

This section is a work in progress.

Place order filters

This section is a work in progress.

Order summary actions

This section is a work in progress.

Order summary filters

This section is a work in progress.

Common extensibility paths

Cart and Checkout blocks

Fully supported with no modification needed

  • Modifying fees and other prices on the cart (woocommerce_cart_calculate_fees)
  • Updating customer information during the WC lifecycle events, e.g. on woocommerce_init, updating a customer's address would reflect in the Cart/Checkout blocks.
  • Adding Shipping methods
  • Changing product names using woocommerce_product_get_name

Partially supported or supported by alternative approach

  • Modifying the layout, e.g. inserting content before/after specific sections such as shipping, payment, and the billing/shipping addresses. Examples include: Outputting content in various places, e.g. before the cart contents are printed (woocommerce_cart_contents) and before the shipping rates (woocommerce_before_shipping_rate):
    • This is supported by our use of Slot/Fill and by registering inner blocks as children of the block you want to show them after.
  • Adding payment methods
    • Simply adding the payment method is not enough, developers need to register a React component to show in the payments block as well.
  • Adding shipping methods for local pickup
    • Should work as normal, but does require the method to support collectable
  • Modify the names of items in the cart
    • Requires the developer to use a JS filter rather than PHP filter

Not supported at all

  • Modifying individual cart line items to add or change content/change HTML (outside of what is offered by our checkout filters).

Checkout block

Fully supported with no modification needed

  • Pre-filling values on the form (Some merchants achieve this by overriding their values using woocommerce_checkout_get_value)
    • This is supported insofar as we respect what has been set on the cart/customer object when loading the cart. woocommerce_checkout_get_value is not supported in the Checkout block, but this is this hooks only use-case.

Partially supported or supported by alternative approach

  • Adding new Checkout fields (commonly achieved with the woocommerce_checkout_fields hook)
    • Supported by the Additional Checkout Fields API, not all field types are supported right now
  • Custom field validation using hooks such as woocommerce_checkout_process
    • Supported by hooking into the payment processing events - validation at the point of pressing "Place order" this is only be possible for payment methods. Other extensions could add validation errors to the data store prior to the button being pressed, and this would prevent checkout, but it is not a good solution, especially if the validation checks are expensive.
  • Updating orders/customers with hooks before/during/after order placement
    • We have some hooks that fire during checkout:
      • woocommerce_store_api_checkout_order_processed - fired when the order has been placed
      • woocommerce_store_api_checkout_update_customer_from_request - fired when the customer is being updated with data from the checkout request
      • woocommerce_store_api_checkout_update_order_meta - fired when order meta data is being updated with data from the request
    • Any other WC hooks that fire in the Shortcode process (e.g. woocommerce_checkout_order_processed will not fire on Store API requests from the blocks)
  • Customising the place order button text using woocommerce_order_button_text
    • Not supported with hooks but it is possible in the editor. There is no programmatic way to achieve this right now.

Not supported at all

  • Changing existing core fields (commonly achieved with the woocommerce_checkout_fields hook)
  • Removing billing/shipping addresses (using the above method)
  • Performanign actions just before the order is finalised (woocommerce_checkout_create_order)

Cart block

Fully supported with no modification needed

  • None that aren't already covered by "both blocks" section.

Partially supported or supported by alternative approach

  • Limiting quantity selections on cart items, e.g. minimum, maximum or step values. Previously this would be done using filters such as woocommerce_quantity_input_step
    • This is possible by modifying the quantity_limits property of the cart item in the woocommerce_store_api_product_quantity_{$value_type} filter.

Not supported at all

  • Modifying the layout by altering template files (unless using a block theme and a custom template)