If you’re developing or customizing a WooCommerce store, understanding the checkout page hooks is essential. Hooks allow you to modify or extend WooCommerce functionality without changing core files. In this post, we’ll explore all the important WooCommerce checkout page hooks, their usage, and examples for practical implementation.
What are WooCommerce Hooks?
WooCommerce hooks come in two types:
- Actions: Execute custom PHP functions at specific places.
- Filters: Modify data before it’s output or saved.
Both types are widely used in the checkout page to add custom fields, messages, or change the layout.
WooCommerce Checkout Page Structure
The WooCommerce checkout page is made up of several parts:
- Customer billing/shipping details
- Order review
- Payment method section
- Place order button
Each of these sections includes multiple action hooks and filter hooks.
Most Common Checkout Page Hooks
Let’s explore the key hooks, categorized by the section of the checkout process they affect.
1. Before Checkout Form
do_action('woocommerce_before_checkout_form', $checkout);
Use this hook to display content or notices before the checkout form starts.
Example:
add_action('woocommerce_before_checkout_form', function() {
echo '<div class="notice">Please ensure your billing details are correct.</div>';
});
2. Checkout Form Start
do_action('woocommerce_checkout_before_customer_details');
Used before the customer detail fields (billing and shipping). Great for adding headers or custom instructions.
3. Billing Fields
do_action('woocommerce_before_checkout_billing_form', $checkout);
do_action('woocommerce_after_checkout_billing_form', $checkout);
Add custom fields or content before or after the billing section.
4. Shipping Fields
do_action('woocommerce_before_checkout_shipping_form', $checkout);
do_action('woocommerce_after_checkout_shipping_form', $checkout);
Works like the billing form hooks, but for shipping.
5. After Customer Details
do_action('woocommerce_checkout_after_customer_details');
Great for adding content between customer details and the order review section.
6. Before & After Order Review
do_action('woocommerce_checkout_before_order_review');
do_action('woocommerce_checkout_after_order_review');
Used to customize the section around the order summary.
7. Order Review Table Hooks
Inside the review table, WooCommerce includes granular hooks:
do_action('woocommerce_review_order_before_cart_contents');
do_action('woocommerce_review_order_after_cart_contents');
do_action('woocommerce_review_order_before_order_total');
do_action('woocommerce_review_order_after_order_total');
You can use these to modify product display, totals, or even add upsells.
8. Payment Section
do_action('woocommerce_review_order_before_payment');
do_action('woocommerce_review_order_after_payment');
These wrap the payment gateway options.
9. Place Order Button Area
do_action('woocommerce_review_order_before_submit');
do_action('woocommerce_review_order_after_submit');
Used for messages, trust badges, terms checkboxes, etc., before or after the final Place Order button.
10. After Checkout Form
do_action('woocommerce_after_checkout_form', $checkout);
Perfect for adding content like FAQs or trust banners after the form.
Bonus: Modify Checkout Fields Using Filters
If you want to add, remove, or modify checkout fields, use the following filter:
add_filter('woocommerce_checkout_fields', 'custom_checkout_fields');
function custom_checkout_fields($fields) {
$fields['billing']['billing_phone']['label'] = 'Your Mobile Number';
return $fields;
}
You can even add new custom fields and later validate/save them using:
add_action('woocommerce_checkout_process', 'custom_field_validation');
add_action('woocommerce_checkout_update_order_meta', 'save_custom_checkout_field');
Final Thoughts
WooCommerce makes it incredibly flexible to customize the checkout page using hooks. Whether you’re improving the user experience, adding analytics, or modifying layouts, these hooks are your best friends.
If you’re building WooCommerce plugins or themes, mastering these hooks will give you full control over the checkout process.


Leave a Reply