From woocommerce-commerce
Explains WordPress hooks for WooCommerce: actions, filters, priorities, and key hooks for products, cart, checkout. Guides adding functionality and tracing execution flow.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin woocommerce-commerceThis skill is limited to using the following tools:
**Fetch live docs**:
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Fetch live docs:
https://developer.wordpress.org/plugins/hooks/ for WordPress Hooks fundamentalssite:developer.woocommerce.com hooks for WooCommerce-specific hookswoocommerce action filter reference for comprehensive hook listingsFire at specific points in execution — used for side effects (sending emails, writing logs, rendering HTML):
do_action( 'hook_name', $arg1, $arg2 ) — fires the actionadd_action( 'hook_name', 'callback', $priority, $accepted_args ) — registers a listenerremove_action( 'hook_name', 'callback', $priority ) — unregisters a listener$priority = runs earlier (default 10)Transform data as it flows through the system — must return a value:
apply_filters( 'filter_name', $value, $arg1, $arg2 ) — applies the filteradd_filter( 'filter_name', 'callback', $priority, $accepted_args ) — registers a filter$value as first argument, must return the (possibly modified) value10| Hook | Type | When |
|---|---|---|
woocommerce_product_get_price | Filter | Price is retrieved |
woocommerce_before_single_product | Action | Before product page renders |
woocommerce_after_single_product_summary | Action | After product summary |
woocommerce_product_options_general_product_data | Action | General tab in product edit |
woocommerce_process_product_meta | Action | Product is saved |
| Hook | Type | When |
|---|---|---|
woocommerce_before_cart | Action | Before cart page |
woocommerce_cart_calculate_fees | Action | Calculate cart fees |
woocommerce_before_calculate_totals | Action | Before totals calculation |
woocommerce_add_to_cart | Action | Item added to cart |
woocommerce_cart_item_price | Filter | Cart item price display |
| Hook | Type | When |
|---|---|---|
woocommerce_before_checkout_form | Action | Before checkout form |
woocommerce_checkout_fields | Filter | Modify checkout fields |
woocommerce_checkout_process | Action | Validate checkout |
woocommerce_checkout_order_processed | Action | Order created from checkout |
woocommerce_payment_complete | Action | Payment completed |
| Hook | Type | When |
|---|---|---|
woocommerce_order_status_changed | Action | Order status transition |
woocommerce_order_status_{from}_to_{to} | Action | Specific status transition |
woocommerce_new_order | Action | New order created |
woocommerce_thankyou | Action | Thank-you page |
| Hook | Type | When |
|---|---|---|
woocommerce_admin_order_data_after_order_details | Action | After order details in admin |
woocommerce_product_data_tabs | Filter | Product data tabs |
woocommerce_product_data_panels | Action | Product data panels content |
woocommerce_get_settings_pages | Filter | Register settings pages |
| Hook | Type | When |
|---|---|---|
woocommerce_init | Action | WooCommerce initialized |
woocommerce_loaded | Action | WooCommerce classes loaded |
before_woocommerce_init | Action | Before WC initializes (declare features here) |
woocommerce_after_register_taxonomy | Action | After taxonomies registered |
Register hooks only when needed:
is_admin() — admin-only hookswp_doing_ajax() — AJAX-only hooksis_checkout(), is_cart() — page-specific hooksUse class methods as callbacks: add_action( 'hook', [ $this, 'method' ] ) or add_action( 'hook', [ __CLASS__, 'static_method' ] )
remove_action() / remove_filter() with the exact callback and priority that was used to add it. For class methods on singletons, reference the instance: remove_action( 'hook', [ WC()->structured_data, 'method' ] )
WooCommerce uses dynamic hooks based on context:
woocommerce_product_get_{$prop} — getter filter for any product propertywoocommerce_order_status_{$status} — status-specific actionwoocommerce_widget_{$widget_id}_args — widget-specific filter$accepted_args when your callback needs more than one argumentadd_filter over directly modifying globalshas_action() / has_filter() to check if a hook is already registereddo_action() / apply_filters() on WooCommerce core hooks from your code (fire your own hooks instead)do_action( 'my_extension_after_process', $data )Fetch the WooCommerce hook reference for current hook names, parameters, and deprecation notices before implementing.