Supported Hooks
Advanced Dynamic Pricing for WooCommerce exposes a growing set of action and filter hooks that let developers extend, modify, and integrate the plugin’s behaviour without touching its core files. This page documents the most important hooks, what each one does, and where to find further examples for each.
If you need a hook that doesn’t exist yet, submit a request via the helpdesk and the team will evaluate adding it to a future release.
Available Hooks
1. adp_load_rule_conditions
This action lets you register a completely new condition type and make it appear in the rule builder’s Cart Conditions selector alongside the plugin’s built-in ones. Use it when none of the existing conditions cover your specific business logic — for example, a condition based on a custom product meta field, a third-party plugin’s data, or a unique customer attribute.
Each custom condition needs a PHP class with a check() method that the rule engine calls at evaluation time, plus an HTML template that defines how the condition appears in the rule builder UI.
→ Read the full guide on programming a custom condition
2. adp_before_apply_rule and adp_is_apply_rule
These two hooks fire during the rule evaluation cycle, giving you control over individual rules just before the plugin applies them to a product or cart.
adp_before_apply_rule fires before the plugin processes a rule and lets you adjust the rule’s settings dynamically at runtime — for example, modifying the discount amount or the product filter criteria based on external conditions such as the current date, the customer’s session data, or a third-party plugin’s state.
adp_is_apply_rule lets you return false to cancel a rule entirely for the current request. This makes it the right hook for conditional rule suppression — blocking a rule from firing based on logic that lives outside the rule’s own conditions, such as a custom meta value, a feature flag, or an integration with another plugin.
3. wdp_before_apply_to_wc_cart and wdp_after_apply_to_wc_cart
These two action hooks bracket Advanced Dynamic Pricing’s full cart processing cycle — one fires immediately before the plugin starts applying its rules to the WooCommerce cart, and the other fires immediately after it finishes.
The primary use case is managing third-party hooks that conflict with the plugin’s internal cart manipulation. Advanced Dynamic Pricing rebuilds cart items internally during its calculation cycle, which can inadvertently trigger callbacks from other plugins that listen on WooCommerce cart hooks like woocommerce_cart_emptied or woocommerce_after_calculate_totals. The solution is to detach the conflicting callback on wdp_before_apply_to_wc_cart and reattach it on wdp_after_apply_to_wc_cart, creating a clean window during which Advanced Dynamic Pricing runs without interference.
You can see this pattern in action in the PayPal for WooCommerce compatibility fix and the Payment Gateway Based Fees fix.
Additional Hooks Used Across the Plugin
The hooks above cover the most common developer use cases, but Advanced Dynamic Pricing exposes many more throughout its codebase. The following hooks appear in various code samples and compatibility fixes across this documentation:
| Hook | Type | Used for |
|---|---|---|
wdp_conditions | Filter | Registering custom condition classes in the rule builder |
wdp_current_user_roles | Filter | Injecting custom group or membership identifiers for the current user |
wdp_preloaded_list_user_roles | Filter | Populating the role/group selector in the admin rule builder |
wdp_calculate_totals_hook_priority | Filter | Controlling the priority of the plugin’s cart totals recalculation hook |
wdp_format_bulk_table_message | Filter | Overriding or translating the bulk table message string |
wdp_price_display_html | Filter | Controlling the final price HTML output per product |
wdp_custom_override_cents | Filter | Applying custom rounding logic to dynamically calculated prices |
adp_get_price_html_is_mod_needed | Filter | Disabling the plugin’s price HTML modification per product type and context |
Each of these hooks appears with full usage examples in the relevant documentation articles — follow the links in the Related Documentation section below to find the article that matches your use case.
Requesting a New Hook
Advanced Dynamic Pricing’s hook set grows with each release based on real developer needs. If you need a hook that the plugin doesn’t currently expose — for example, a filter on a specific price calculation step, or an action at a particular point in the rule evaluation cycle — submit a support ticket describing your use case. Include the specific point in the plugin’s execution flow where you need to intervene and what you want to do there. The team regularly adds new hooks based on developer requests.