WooCommerce Hooks Guide: Full List and Examples
TL;DR: WooCommerce Hooks are a powerful tool for extending the functionality of an online store without modifying the core code of the theme. We will provide a comprehensive list of WooCommerce Hooks, explain their main uses, and give examples of where they can be placed.
WooCommerce Hooks are similar to WordPress Hooks and are used to set the markup for all pages, making it easier to implement Actions and Filters.
By using WooCommerce Hooks, it’s possible to create independent plugins and extensions without altering the core code of WordPress, WooCommerce, or other plugins. This approach ensures the stability and updatability of the software.
WooCommerce Hooks are a well-documented and straightforward way to expand the capabilities of an online store. To expand your WooCommerce store’s opportunities automatically, you can use a plugin, such as Permalink Manager for WooCommerce, that allows you to configure URL generation strategy and WooCommerce Product Filter for managing filters for WooCommerce products.
How to Use WooCommerce Hooks (Action and Filter Examples)
Before the full list, here’s how you actually use a hook. WooCommerce hooks come in two types – action hooks, which let you inject output or run code at a set point, and filter hooks, which let you modify and return a value. You attach your own function with add_action() or add_filter().
Action hook example – add a notice above the single product:
add_action( 'woocommerce_before_single_product', 'premmerce_single_product_notice', 5 );
function premmerce_single_product_notice() {
echo '<div class="woocommerce-info">';
echo '<p class="shipping-note">Free shipping on orders over $50.</p>';
echo '</div>';
}
Filter hook example – change the single-product “Add to cart” button text:
add_filter( 'woocommerce_product_single_add_to_cart_text', 'premmerce_add_to_cart_text' );
function premmerce_add_to_cart_text() {
return 'Buy now';
}
The action echoes output; the filter returns a value. Every hook below works the same way – find the hook for the spot you want to change, then attach an action or filter to it.
WooCommerce Global Hooks
We’ve referred three hooks to global and they are displayed on the main pages allowing to make some considerable modifications. Among them:
pre_get_product_search_form
It enables adding some data above the basic search of products.

woocommerce_breadcrumb
It allows to display data above the breadcrumbs URLs.

woocommerce_no_products_found
It allows to display the needed data on the Search page if no products have been found.

WooCommmerce Cart Hooks
In general, the Cart page on WooCommerce is marked very well. We’ve divided all the hooks, that are used on the Cart page, into three groups for convenience.
The hooks that are displayed before the product list in the cart
They are:
- woocommerce_before_cart
- woocommerce_before_cart_table
- woocommerce_before_cart_contents
- woocommerce_cart_contents
- woocommerce_after_cart_contents

Hooks displayed after the product list in the cart
The hooks displayed after the product list in the cart are:
- woocommerce_cart_coupon
- woocommerce_cart_actions
- woocommerce_after_cart_table
- woocommerce_cart_collaterals
- woocommerce_before_cart_totals

The hooks that are displayed at the end of an order
The hooks that are displayed at the end of an order are:
- woocommerce_cart_totals_before_shipping
- woocommerce_cart_totals_after_shipping
- woocommerce_cart_totals_before_order_total
- woocommerce_cart_totals_after_order_total
- woocommerce_after_shipping_rate
- woocommerce_before_shipping_calculator
- woocommerce_proceed_to_checkout
- woocommerce_after_cart_totals
- woocommerce_after_cart

In case there are no products in the cart
If there are no products in the cart we see:
woocommerce_cart_is_empty

WooCommerce Checkout Hooks
As the Checkout page on WooCommerce is very functional, we’ve decided to divide all the hooks that are used here into several categories.
Hooks used before the user contact information form
They are:
- woocommerce_before_checkout_form
- woocommerce_checkout_before_customer_details
- woocommerce_checkout_billing
- woocommerce_before_checkout_billing_form

The hooks that are used for setting markup of billing details
They are:
- woocommerce_after_checkout_billing_form
- woocommerce_checkout_shipping
- woocommerce_before_order_notes
- woocommerce_after_order_notes
- woocommerce_checkout_after_order_review

The hooks that are used before the order’s product summary
They are:
- woocommerce_checkout_after_customer_details
- woocommerce_checkout_before_order_review
- woocommerce_review_order_before_cart_contents
- woocommerce_review_order_after_cart_contents
- woocommerce_review_order_before_shipping
- woocommerce_review_order_after_shipping
- woocommerce_review_order_before_order_total
- woocommerce_review_order_after_order_total

The hooks that are displayed below the order form
They are:
- woocommerce_checkout_order_review
- woocommerce_review_order_before_payment
- woocommerce_review_order_before_submit
- woocommerce_review_order_after_submit
- woocommerce_review_order_after_payment
- woocommerce_after_checkout_form

The hooks that are displayed in the product list of an order:
They are:
- woocommerce_order_items_table
- woocommerce_order_item_meta_start
- woocommerce_order_item_meta_end
- woocommerce_order_details_after_order_table
- woocommerce_thankyou

WooCommerce Cart and Checkout Block Hooks
A note on the block-based Cart and Checkout. The hooks above primarily apply to WooCommerce’s classic shortcode-based Cart and Checkout templates. If your store uses the newer Cart and Checkout Blocks, most of those classic woocommerce_checkout_* and woocommerce_cart_* template hooks (especially those that output HTML inside the old PHP templates) will not fire because the blocks are React-based and extend differently.
On the PHP side, block extensibility includes block registration hooks with IntegrationInterface for registering scripts, styles, and script data, as well as the Store API (for example, woocommerce_store_api_register_endpoint_data) for adding custom data to cart and checkout responses. Depending on what you’re building, WooCommerce also provides block-specific APIs such as the Additional Checkout Fields API and Store API checkout hooks.
For the frontend, Cart and Checkout Blocks are typically extended with JavaScript APIs such as Slot and Fill, checkout filters, and other block-specific extension points instead of outputting markup with PHP do_action() template hooks.
If a customization that worked on the classic checkout suddenly does nothing, check whether the store has switched to the block checkout – that’s usually the cause.
WooCommerce Product Hooks
There is a number possible Product page hooks and that’s why we’ve divided them into several categories according to their purpose. We use them with our WooCommerce Product Filter Plugin for filtering results without reloading the page.
Premmerce WooCommerce Product Filter
Get started giving your customers a better way to filter your products to increase site usability and revenue.
The hooks that wrap the entire single product
They are:
- woocommerce_before_main_content
- woocommerce_after_main_content

The hooks that are displayed above and below a product description
They are:
- woocommerce_before_single_product_summary
- woocommerce_after_single_product_summary

The hooks that are displayed at the top and at the foot of the Product page
They are:
- woocommerce_before_single_product
- woocommerce_after_single_product

The hooks that are displayed in the short product description
They are:
- woocommerce_single_product_summary
- woocommerce_product_meta_start
- woocommerce_product_meta_end
- woocommerce_share

The hooks that are displayed in the comments
They are:
- woocommerce_review_before
- woocommerce_review_before_comment_meta
- woocommerce_review_meta
- woocommerce_review_before_comment_text
- woocommerce_review_comment_text
- woocommerce_review_after_comment_text

WooCommerce Category Hooks
WooCommerce provides some hooks for working with the product categories. Let’s review them with screenshots for better visualization. These ones we use with our WooCommerce Variation Swatches Plugin to optimize the WooCommerce-based online stores with large databases of products, attributes, and variations.
woocommerce_archive_description
It is displayed below the category title

woocommerce_shop_loop
It is displayed before the Product card in the list.

woocommerce_before_shop_loop
It is displayed above the product list in the category.

woocommerce_after_shop_loop
It is displayed below the product list in the category.

woocommerce_after_shop_loop_item
It is displayed at the end of every Product card description.

The hooks that additionally mark the Product card in the list
They are:
- woocommerce_after_shop_loop_item_title
- woocommerce_shop_loop_item_title
- woocommerce_before_shop_loop_item_title

WooCommerce My Account Hooks
These hooks are for the detailed marking of the My Account page. We’ve also divided them into two categories.
The main hooks for setting markup of the My Account page
They are:
- woocommerce_before_account_navigation
- woocommerce_after_account_navigation
- woocommerce_account_navigation
- woocommerce_before_edit_account_address_form
- woocommerce_after_edit_account_address_form
- woocommerce_account_content

The additional hooks for setting markup of the My Account page
They are:
- woocommerce_account_dashboard
- woocommerce_before_my_account
- woocommerce_after_my_account

WooCommerce Mini Cart Hooks
These hooks serve to set markup the mini cart that is displayed in the sidebar if you use advanced WooCommerce display settings.
They are:
- woocommerce_before_mini_cart
- woocommerce_before_mini_cart_contents
- woocommerce_mini_cart_contents
- woocommerce_widget_shopping_cart_before_buttons
- woocommerce_widget_shopping_cart_buttons
- woocommerce_after_mini_cart

WooCommerce Email Hooks
They are used for setting email markup. The emails that are sent to the customers after the purchase are marked up and they usually contain a product list.
They are:
- woocommerce_email_after_order_table
- woocommerce_email_before_order_table
- woocommerce_email_customer_details
- woocommerce_email_footer
- woocommerce_email_header
- woocommerce_email_order_details
- woocommerce_email_order_meta

Other Hooks
We’ve described the main hooks that are usually used for setting markup and extension of the basic WooCommerce functionality.
There are also some Hooks that are not so often used. Here is the whole list of them:
- woocommerce_after_account_downloads
- woocommerce_after_account_orders
- woocommerce_after_account_payment_methods
- woocommerce_before_account_download
- woocommerce_before_account_order
- woocommerce_before_account_orders_pagination
- woocommerce_before_account_payment_methods
- woocommerce_edit_account_form
- woocommerce_edit_account_form_end
- woocommerce_edit_account_form_start
- woocommerce_resetpassword_form
- woocommerce_after_available_downloads
- woocommerce_after_checkout_registration_form
- woocommerce_after_checkout_shipping_form
- woocommerce_after_edit_account_form
- woocommerce_after_subcategory
- woocommerce_after_subcategory_title
- woocommerce_auth_page_footer
- woocommerce_auth_page_header
- woocommerce_available_download_end
- woocommerce_available_download_start
- woocommerce_before_available_download
- woocommerce_before_checkout_registration_form
- woocommerce_before_checkout_shipping_form
- woocommerce_before_edit_account_form
- woocommerce_before_subcategory
- woocommerce_before_subcategory_title
- woocommerce_cart_has_error
- woocommerce_checkout_after_terms_and_conditions
- woocommerce_checkout_before_terms_and_conditions
- woocommerce_lostpassword_form
- woocommerce_order_details_after_customer_details
- woocommerce_pay_order_after_submit
- woocommerce_pay_order_before_submit
- woocommerce_product_thumbnails
- woocommerce_shop_loop_subcategory_title
- woocommerce_view_order
In case you need some additional explanations on any hook usage, you’re welcome to leave your comments, and we’ll give more information on the topic you’re interested in promptly, or you see see how we use hooks in our products at our WooCommerce Plugins list.
Comments
Ready to Get Started?
Join over 100,000 smart shop owners who use Premmerce plugins to power their WooCommerce stores.
Get started