WooCommerce Hooks & Filters
Explore WooCommerce actions and filters for product pages, shop listings, carts, shipping, payments, checkout, and orders, with practical PHP examples.
Actions run your PHP callback at a defined point in WooCommerce. Filters pass a value to your callback and expect you to return the value, with or without changes. Both are types of WordPress hooks.
| Hook | Type | Category | Description |
|---|---|---|---|
woocommerce_before_single_product_summary |
Action | Product pages | Run code before the classic product summary appears. |
woocommerce_single_product_summary |
Action | Product pages | Add content among the default product details and purchase controls. |
woocommerce_after_single_product_summary |
Action | Product pages | Add content below the classic product summary, after tabs and related products. |
woocommerce_product_tabs |
Filter | Product pages | Change the array of product tabs and their settings. |
woocommerce_get_price_html |
Filter | Product pages | Adjust formatted price HTML in product cards and details. |
woocommerce_before_shop_loop |
Action | Shop listings | Insert content before the classic shop product grid. |
woocommerce_loop_add_to_cart_link |
Filter | Shop listings | Filter the add-to-cart link HTML used in classic product loops. |
woocommerce_before_calculate_totals |
Action | Cart | Inspect or change cart items before totals are calculated. |
woocommerce_cart_calculate_fees |
Action | Cart | Add conditional fees while WooCommerce calculates cart fees. |
woocommerce_package_rates |
Filter | Shipping | Adjust calculated shipping rates, including labels and available options. |
woocommerce_checkout_fields |
Filter | Checkout | Adjust field definitions in the classic shortcode checkout. |
woocommerce_available_payment_gateways |
Filter | Checkout | Filter which payment methods are offered to a customer. |
woocommerce_order_status_changed |
Action | Orders | React when an order moves from one status to another. |
woocommerce_thankyou |
Action | Orders | Display messages on an order confirmation page. |
This independent reference is maintained by HoverCraft. For implementation details and newly added hooks, consult the official WooCommerce hook index and check the compatibility notes on each page.