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_shiping_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 | Fully supported β | |
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 blocksw |
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.
- 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 placedwoocommerce_store_api_checkout_update_customer_from_request
- fired when the customer is being updated with data from the checkout requestwoocommerce_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)