Cart and Checkout – Hook support and common extensibility paths
Hook compatibility
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) 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 a â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 |
â | |
woocommerce_cart_loaded_from_session |
â | |
woocommerce_cart_updated |
â | |
woocommerce_set_cart_cookies |
â | |
woocommerce_shipping_zone_loaded |
â | |
woocommerce_check_cart_items |
â | May be better to use woocommerce_store_api_validate_cart_item |
woocommerce_before_calculate_totals |
â | |
woocommerce_shipping_init |
â | |
woocommerce_load_shipping_methods |
â | |
woocommerce_cart_calculate_fees |
â | |
woocommerce_calculate_totals |
â | |
woocommerce_after_calculate_totals |
â | |
woocommerce_cart_updated |
â | |
woocommerce_before_get_rates_for_package |
â | |
woocommerce_after_get_rates_for_package |
â | |
woocommerce_checkout_init |
â | |
woocommerce_customer_loaded |
â |
WooCommerce lifecycle filters
Old hook | Works in blocks? | Notes |
---|---|---|
woocommerce_notice_types |
â | 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 |
â | |
woocommerce_product_get_stock_status |
â | |
woocommerce_product_is_in_stock |
â | |
woocommerce_product_get_manage_stock |
â | |
woocommerce_product_get_tax_class |
â | |
woocommerce_product_get_tax_status |
â | |
woocommerce_prices_include_tax |
â | |
woocommerce_apply_base_tax_for_local_pickup |
â | |
woocommerce_local_pickup_methods |
â | Does not affect the blocks-based local pickup methods |
woocommerce_customer_get_shipping_postcode |
â | |
woocommerce_customer_get_shipping_city |
â | |
woocommerce_customer_taxable_address |
â | |
woocommerce_shipping_methods |
â | |
woocommerce_format_localized_price |
â | |
woocommerce_shipping_local_pickup_option |
â | Does not affect the blocks-based local pickup methods |
woocommerce_shipping_pickup_location_option |
â | Unsure if changing this changes the way local pickup shows in the Cart/Checkout |
woocommerce_shipping_method_supports |
â | |
woocommerce_get_tax_location |
â | |
woocommerce_format_postcode |
â | |
woocommerce_matched_tax_rates |
â | |
woocommerce_find_rates |
â | |
woocommerce_matched_rates |
â | |
woocommerce_cart_totals_get_item_tax_rates |
â | |
woocommerce_adjust_non_base_location_prices |
â | |
woocommerce_product_is_taxable |
â | |
woocommerce_price_ex_tax_amount |
â | |
woocommerce_tax_round |
â | |
woocommerce_calc_tax |
â | |
woocommerce_calculate_item_totals_taxes |
â | |
woocommerce_cart_ready_to_calc_shipping |
â | |
woocommerce_product_get_virtual |
â | |
woocommerce_is_virtual |
â | |
woocommerce_product_needs_shipping |
â | |
woocommerce_cart_needs_shipping |
â | |
woocommerce_customer_get_shipping_address_1 |
â | |
woocommerce_customer_get_shipping_address_2 |
â | |
woocommerce_cart_display_prices_including_tax |
â | |
woocommerce_cart_get_subtotal |
â | |
woocommerce_cart_shipping_packages |
â | |
woocommerce_product_get_shipping_class_id |
â | |
woocommerce_countries_shipping_countries |
â | |
woocommerce_get_zone_criteria |
â | |
woocommerce_shipping_zone_shipping_methods |
â | |
woocommerce_shipping_free_shipping_is_available |
â | |
woocommerce_product_get_name |
â | |
woocommerce_shipping_method_add_rate |
â | |
woocommerce_shipping_flat_rate_is_available |
â | |
woocommerce_evaluate_shipping_cost_args |
â | |
woocommerce_calc_shipping_tax |
â | |
woocommerce_localisation_address_formats |
â | |
woocommerce_countries_base_country |
â | |
woocommerce_formatted_address_force_country_display |
â | |
woocommerce_states |
â | |
woocommerce_formatted_address_replacements |
â | |
woocommerce_package_rates |
â | |
woocommerce_shipping_packages |
â | |
woocommerce_shipping_rate_method_id |
â | |
woocommerce_shipping_rate_taxes |
â | |
woocommerce_shipping_rate_cost |
â | |
woocommerce_cart_totals_get_fees_from_cart_taxes |
â | |
woocommerce_calculated_total |
â | This does not seem to have any effect |
woocommerce_cart_get_discount_total |
â | |
woocommerce_cart_get_cart_contents_total |
â | |
woocommerce_get_price_excluding_tax |
â | This does not seem to have any effect |
raw_woocommerce_price |
â | This does not seem to have any effect |
formatted_woocommerce_price |
â | This does not seem to have any effect |
woocommerce_price_trim_zeros |
â | This does not seem to have any effect |
woocommerce_get_cart_page_permalink |
â | This does not seem to have any effect |
woocommerce_get_cart_url |
â | This does not seem to have any effect |
woocommerce_checkout_registration_enabled |
â | This does not seem to have any effect |
woocommerce_get_checkout_page_permalink |
â | This does not seem to have any effect |
woocommerce_get_checkout_url |
â | This does not seem to have any effect |
woocommerce_checkout_get_value |
â | This does not seem to have any effect |
woocommerce_default_address_fields |
â | This does not seem to have any effect |
default_checkout_billing_country |
â | This does not seem to have any effect |
default_checkout_shiping_country |
â | This does not seem to have any effect |
woocommerce_get_country_locale |
â | |
woocommerce_get_country_locale_default |
â | |
woocommerce_get_country_locale_base |
â | |
woocommerce_billing_fields |
ð¶ | Editing core fields is not supported, but adding them is via Additional Checkout Fields API |
woocommerce_shipping_fields |
ð¶ | Editing core fields is not supported, but adding them is via Additional Checkout Fields API |
woocommerce_checkout_fields |
ð¶ | Editing core fields is not supported, but adding them is via Additional Checkout Fields API |
woocommerce_cart_item_product |
â | Modifying individual cart items is not possible |
woocommerce_payment_gateway_supports |
â | |
woocommerce_customer_get_billing_first_name |
â | |
woocommerce_customer_get_billing_last_name |
â | |
woocommerce_customer_get_billing_company |
â | |
woocommerce_customer_get_billing_address_1 |
â | |
woocommerce_customer_get_billing_address_2 |
â | |
woocommerce_customer_get_billing_city |
â | |
woocommerce_customer_get_billing_postcode |
â | |
woocommerce_customer_get_billing_phone |
â | |
woocommerce_customer_get_shipping_first_name |
â | |
woocommerce_customer_get_shipping_last_name |
â | |
woocommerce_customer_get_shipping_company |
â | |
woocommerce_get_item_data |
â | |
woocommerce_cart_get_subtotal_tax |
â | This does not seem to have any effect |
woocommerce_shipping_package_name |
â | |
woocommerce_shipping_rate_id |
â | |
woocommerce_shipping_rate_label |
â | |
woocommerce_cart_get_shipping_taxes |
â | |
woocommerce_cart_get_fee_taxes |
â | |
woocommerce_cart_get_taxes |
â | |
woocommerce_rate_code |
â | |
woocommerce_rate_compound |
â | |
woocommerce_rate_label |
â | |
woocommerce_cart_hide_zero_taxes |
â | |
woocommerce_cart_tax_totals |
â | |
woocommerce_cart_needs_payment |
â | |
woocommerce_order_class |
â | |
woocommerce_checkout_registration_required |
â | |
woocommerce_privacy_policy_page_id |
â | |
woocommerce_get_terms_page_id |
â | |
woocommerce_terms_and_conditions_page_id |
â | |
woocommerce_cart_contents_count |
â | |
woocommerce_country_locale_field_selectors |
â | |
woocommerce_get_return_url |
â | |
woocommerce_cart_hash |
â | |
woocommerce_cart_get_fee_tax |
â | |
woocommerce_customer_default_location_array |
â | |
woocommerce_countries |
â | |
woocommerce_sort_countries |
â | This does not seem to have any effect |
woocommerce_countries_allowed_countries |
â | |
woocommerce_customer_default_location_array |
â | |
woocommerce_customer_get_billing_country |
â | |
woocommerce_customer_get_shipping_country |
â | |
woocommerce_customer_get_billing_state |
â | |
woocommerce_customer_get_shipping_state |
â | |
woocommerce_customer_get_billing_email |
â | |
woocommerce_cart_session_initialize |
â | |
woocommerce_get_checkout_page_id |
â | |
woocommerce_get_cart_page_id |
â | |
woocommerce_is_checkout |
â | |
woocommerce_currency |
â | |
woocommerce_currency_symbols |
â | |
woocommerce_currency_symbol |
â | |
woocommerce_price_format |
â | |
woocommerce_coupons_enabled |
â | |
woocommerce_get_shop_page_id |
â | |
current_theme_supports-woocommerce |
â | |
woocommerce_payment_gateways |
ð¶ | 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 |
â | |
woocommerce_gateway_icon |
â | This hook has no effect since icons are not displayed. |
woocommerce_get_image_size_thumbnail |
â | |
woocommerce_get_image_size_single |
â | |
woocommerce_product_stock_status_options |
â | |
woocommerce_cart_item_name |
â | Use the itemName checkout filter. |
woocommerce_product_get_status |
â | |
woocommerce_product_get_price |
â | |
woocommerce_is_purchasable |
â | |
woocommerce_cart_item_is_purchasable |
â | |
woocommerce_cart_item_data_to_validate |
â | |
woocommerce_get_cart_item_from_session |
â | |
woocommerce_cart_contents_changed |
â | |
woocommerce_get_cart_contents |
â | |
woocommerce_stock_amount |
â | |
woocommerce_cart_item_remove_link |
â | Use the showRemoveItemLink checkout filter. |
woocommerce_cart_item_quantity |
â | 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 |
â | Use woocommerce_store_api_cart_item_images (PR Link with example.) |
woocommerce_cart_no_shipping_available_html |
â | This is not editable |
woocommerce_available_payment_gateways |
ð¶ | 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 |
â | |
woocommerce_cart_get_fee_tax |
â | |
woocommerce_cart_get_cart_contents_tax |
â | |
woocommerce_cart_get_shipping_tax |
â | |
woocommerce_cart_get_shipping_total |
â |
Cart actions
Old hook | Works in blocks? | Notes |
---|---|---|
woocommerce_before_cart |
â | 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 |
â | 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 |
â | 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 |
â | Use the itemName checkout filter. |
woocommerce_before_quantity_input_field |
â | No equivalent now. |
woocommerce_after_quantity_input_field |
â | No equivalent now. |
woocommerce_cart_contents |
â | 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 |
â | ExperimentalDiscountsMeta slot/fill |
woocommerce_cart_actions |
â | ExperimentalOrderMeta slot/fill |
woocommerce_after_cart_contents |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | ExperimentalOrderMeta slot/fill |
woocommerce_cart_totals_before_shipping |
â | ExperimentalOrderShippingPackages |
woocommerce_after_shipping_rate |
â | ExperimentalOrderShippingPackages |
woocommerce_before_shipping_calculator |
â | No specific equivalent. Closest thing is ExperimentalOrderShippingPackages |
woocommerce_after_shipping_calculator |
â | No specific equivalent. Closest thing is ExperimentalOrderShippingPackages |
woocommerce_cart_totals_after_shipping |
â | No specific equivalent. Closest thing is ExperimentalOrderShippingPackages |
woocommerce_cart_totals_before_order_total |
â | No specific equivalent but we do have the totals footer item filters |
woocommerce_cart_totals_after_order_total |
â | No specific equivalent but we do have the totals footer item filters |
woocommerce_proceed_to_checkout |
â | No specific equivalent but the Checkout and Place Order button filters may work |
woocommerce_after_cart_totals |
â | ExperimentalOrderMeta slot/fill |
woocommerce_after_cart |
â | 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 |
â | This does not seem to have any effect |
woocommerce_cart_item_visible |
â | This does not seem to have any effect |
woocommerce_get_remove_url |
â | The removal of items is handled async in the Cart block. |
woocommerce_cart_item_remove_link |
â | The removal of items is handled async in the Cart block. |
woocommerce_cart_item_thumbnail |
â | Changing the thumbnail this way is not supported. See woocommerce_store_api_cart_item_images (PR Link with example.) |
woocommerce_cart_product_price |
â | |
woocommerce_cart_item_price |
â | |
woocommerce_quantity_input_classes |
â | |
woocommerce_quantity_input_max |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | |
woocommerce_cart_item_subtotal |
â | |
woocommerce_cross_sells_columns |
â | The cross sells are rendered as an inner block. |
woocommerce_cross_sells_orderby |
â | The cross sells are rendered as an inner block. |
woocommerce_cross_sells_order |
â | The cross sells are rendered as an inner block. |
woocommerce_cross_sells_total |
â | The cross sells are rendered as an inner block. |
woocommerce_product_cross_sells_products_heading |
â | This can be modified in the editor. |
woocommerce_is_downloadable |
â | Does not seem to have any effect in Cart/Checkout blocks. |
woocommerce_loop_product_link |
â | Changing the product links is not supported in the Cart block. |
woocommerce_product_loop_title_classes |
â | Changing classes to product titles is not supported in the Cart block. |
woocommerce_product_add_to_cart_aria_describedby |
â | Changing aria-describedby on products is not supported in the Cart block. |
woocommerce_sale_flash |
â | This can be modified with the saleBadgePriceFormat checkout filter. |
woocommerce_cart_subtotal |
â | Modifying the cart subtotal display is not supported in the Cart/Checkout blocksw |
oocommerce_shipping_package_details_array |
â | This hook is not fired during Cart block rendering |
woocommerce_shipping_show_shipping_calculator |
â | This is only used when rendering cart templates, which does not happen in the blocks. |
woocommerce_cart_shipping_method_full_label |
â | This hook has no effect in the Cart/Checkout blocks. |
woocommerce_get_shipping_tax |
â | This filter is not used in the Cart/Checkout blocks. |
woocommerce_shipping_calculator_enable_country |
â | This filter is not used in the Cart/Checkout blocks. |
woocommerce_shipping_calculator_enable_state |
â | This filter is not used in the Cart/Checkout blocks. |
woocommerce_shipping_calculator_enable_city |
â | This filter is not used in the Cart/Checkout blocks. |
woocommerce_shipping_calculator_enable_postcode |
â | This filter is not used in the Cart/Checkout blocks. |
woocommerce_cart_totals_fee_html |
â | Modifying the fees display is not supported in the Cart/Checkout blocks |
woocommerce_countries_estimated_for_prefix |
â | |
woocommerce_cart_total |
â | Modifying the cart total using this hook is not supported in the Cart/Checkout blocks |
woocommerce_cart_totals_order_total_html |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 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 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 directly equivalent due to positioning, but ExperimentalOrderShippingPackages could work – so could adding an inner block to the shipping block |
woocommerce_before_order_notes |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
â | 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 |
ð¶ | 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 |
â | The coupon message cannot be customised using this filter. |
woocommerce_form_field_args |
â | Modifying core form fields is not supported yet in the Cart/Checkout blocks. |
woocommerce_form_field_text |
â | Modifying core form fields is not supported yet in the Cart/Checkout blocks. |
woocommerce_form_field |
â | Modifying core form fields is not supported yet in the Cart/Checkout blocks. |
woocommerce_form_field_country |
â | Modifying core form fields is not supported yet in the Cart/Checkout blocks. |
woocommerce_form_field_state |
â | Modifying core form fields is not supported yet in the Cart/Checkout blocks. |
woocommerce_form_field_tel |
â | Modifying core form fields is not supported yet in the Cart/Checkout blocks. |
woocommerce_form_field_email |
â | Modifying core form fields is not supported yet in the Cart/Checkout blocks. |
woocommerce_cart_needs_shipping_address |
â | The wc/store/cart data store should be used to control this. |
woocommerce_ship_to_different_address_checked |
â | The wc/store/checkout data store should be used to check if this checkbox is checked. |
woocommerce_enable_order_notes_field |
â | This block must be removed in the editor, this filter will not affect its presence in the Checkout block |
woocommerce_form_field_textarea |
â | Modifying core form fields is not supported yet in the Cart/Checkout blocks. |
woocommerce_checkout_cart_item_visible |
â | It is not possible to filter cart items from the order summary in the Cart/Checkout blocks. |
woocommerce_cart_item_class |
â | 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 |
â | 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 |
â | Modifying the product subtotal display is not supported in the Cart/Checkout blocks |
woocommerce_cart_item_subtotal |
â | Modifying the product subtotal display is not supported in the Cart/Checkout blocks |
woocommerce_cart_subtotal |
â | Modifying the cart subtotal display is not supported in the Cart/Checkout blocks |
woocommerce_cart_shipping_method_full_label |
â | Modifying the shipping method display is not supported in the Cart/Checkout blocks |
woocommerce_get_shipping_tax |
â | This filter is not used in the Cart/Checkout blocks. |
woocommerce_cart_totals_fee_html |
â | Modifying the fees display is not supported in the Cart/Checkout blocks |
woocommerce_cart_total |
â | Modifying the cart total using this hook is not supported in the Cart/Checkout blocks |
woocommerce_cart_totals_order_total_html |
â | 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 |
â | Modifying the order button html using this hook is not supported in the Cart/Checkout blocks – edit it using the editor. |
woocommerce_gateway_title |
â | 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 |
â | 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 |
â | 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 |
â | This is not controllable via this filter. The block can be removed in the editor. |
woocommerce_get_privacy_policy_text |
â | Modifying the privacy policy text using this filter is not supported. It can be modified in the editor. |
woocommerce_order_button_html |
â | 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 |
â | 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.
- This is supported insofar as we respect what has been set on the cart/customer object when loading the cart.
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)
- We have some hooks that fire during checkout:
- 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.
- This is possible by modifying the quantity_limits property of the cart item in the
Not supported at all
- Modifying the layout by altering template files (unless using a block theme and a custom template)
Last updated: December 20, 2024