Developer Overview
Hooks, filters, shortcodes, REST API endpoints, and extending InfusedWoo with custom code.
This section is for developers who want to extend InfusedWoo with custom code, build integrations, or customize behavior using hooks and filters.
Shortcodes
| Shortcode | Description |
|---|---|
[iw_inf_contact_field_val field="FieldName"] | Display a Keap contact field value on any page |
[iw_merge]{{Contact:FirstName}}[/iw_merge] | Use InfusedWoo merge fields in page/post content |
[iw_get_val field="param"] | Display a URL query parameter value |
[iw_post_val field="param"] | Display a POST form field value |
[iw_inf_contact_field_val]
Displays a Keap contact field value. The contact is identified by:
- URL parameters (
Email,email,contactId,Id, etc.) - POST data with the same parameter names
- The currently logged-in WordPress user’s email
Built-in fields:
Hello [iw_inf_contact_field_val field="FirstName"]!
Your email: [iw_inf_contact_field_val field="Email"]
Custom fields (prefix with underscore):
Your plan: [iw_inf_contact_field_val field="_MembershipLevel"]
Force a specific contact ID:
[iw_inf_contact_field_val field="FirstName" force_id="123"]
Affiliate fields:
Affiliate code: [iw_inf_contact_field_val field="AffCode"]
[iw_merge]
Wraps content and resolves InfusedWoo merge fields (same {{Category:Field}} syntax used in automation recipes). Uses the logged-in user’s email by default, or specify one:
[iw_merge]Hello {{Contact:FirstName}}, your last order was {{Order:OrderTotal}}[/iw_merge]
[iw_merge user_email="[email protected]"]{{Contact:FirstName}}[/iw_merge]
This shortcode uses the same merge field system as Automation Recipes. See the Merge Fields Reference for all available categories and fields.
[iw_get_val] / [iw_post_val]
Display raw GET or POST parameter values. Useful on thank-you pages or form confirmation pages:
Thanks, [iw_get_val field="name"]! Your order #[iw_get_val field="order_id"] is confirmed.
Key Hooks (Actions)
These hooks let you run custom code at key integration points:
| Hook | When it fires |
|---|---|
infusedwoo_payment_complete | After payment is processed and synced to Keap (triggers recipes) |
infusedwoo_product_purchase | After per-product actions run (tag, email, action set) |
infusedwoo_order_process | After order processing creates/updates the contact |
infusedwoo_reg_process | After user registration creates/updates a contact |
infusedwoo_automation_loaded | When recipe system is ready (register custom components here) |
iw_order_imported | After a Keap order is imported to WooCommerce |
iw_order_exported | After a WooCommerce order is exported to Keap |
infusedwoo_user_cancelled_sub | When a user cancels a subscription from My Account |
Key Filters
These filters let you modify data before InfusedWoo processes it:
| Filter | Purpose |
|---|---|
iw_should_use_rest_api | Override REST vs XML-RPC decision per service |
iw_reg_contactvals | Modify contact data before creating on registration |
iw_before_updatecontact | Modify contact data before updating existing contact |
iw_before_addcontact | Modify contact data before adding new contact |
infusedwoo_create_contact_on_checkout | Return false to skip contact creation at checkout |
iw_pg_merchant_id | Override the Keap merchant account ID per order |
infusedwoo_modify_order | Modify order data before creating in Keap |
iw_max_auto_adjustment | Max rounding adjustment for payment amounts |
infusedwoo_tc_msg | Customize terms & conditions message text |
infusedwoo_cookiealert_msg | Customize cookie consent banner message |
See Hooks & Filters Reference for the complete list with code examples.
Product Integration Panel
InfusedWoo adds a Keap/Infusionsoft tab to the WooCommerce product data panel. This is implemented in modules/paneledits.php and provides:
- Product type selection (Product vs Subscription)
- Keap product linking
- Tag on purchase
- Email template on purchase
- Action set on purchase
- Subscription plan selection with trial days and sign-up fees
Adding Custom Product Fields
Use WooCommerce’s standard woocommerce_product_options_general_product_data action to add fields, then save them via woocommerce_process_product_meta.
WooCommerce Blocks Support
InfusedWoo supports the new WooCommerce Blocks-based checkout via class-wc-keap-gateway-blocks.php. This includes:
- Payment method registration with the Block Checkout
- Modal payment form support
- Payment plan display
- Subscription details rendering
- Saved cards management
REST API Endpoints
InfusedWoo exposes REST API endpoints under the infusedwoo/v1 namespace. All admin endpoints require manage_woocommerce capability.
Key Endpoints
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /settings/api | Get API settings |
| PUT | /settings/api | Update API settings |
| GET | /settings/cache | Get cache status |
| POST | /settings/cache/clear | Clear caches |
| GET | /automation/recipes | List automation recipes |
| POST | /automation/recipes | Create a recipe |
| GET | /automation/recipes/{id} | Get recipe details |
| PUT | /automation/recipes/{id} | Update a recipe |
| GET | /payments/keap-gateway | Get gateway status |
| GET | /payments/other-gateways | Get other gateways config |
| GET/POST | /settings/support-access/* | Support access management |
Extending Automation Recipes
InfusedWoo’s recipe system is extensible. You can create custom:
- Triggers — New events that start recipes
- Conditions — New checks that filter recipe execution
- Actions — New things recipes can do
- Merge Fields — New dynamic values for use in action fields
See Extending Automation Recipes for an overview, or jump to a specific guide:
- Custom Triggers — Listen for WordPress events and fire recipes
- Custom Conditions — Add filtering logic to recipes
- Custom Actions — Define what recipes do
- Custom Merge Fields — Add dynamic values for action fields
File Structure
infusedwooPRO/
├── core/
│ ├── integration.php # Main integration class (IA_Woocommerce)
│ ├── sdk/ # Keap API SDK (iasdk.php, keap-rest-client.php)
│ ├── gateway/ # Payment gateway files
│ └── logger/ # Logging system
├── admin-menu/
│ ├── rest-api/ # REST API controllers
│ ├── admin-react-loader.php # React admin bootstrap
│ └── support-access-handler.php # Support access AJAX handlers
├── admin-react/
│ ├── src/ # React admin source (TypeScript)
│ └── dist/ # Built admin assets
├── modules/ # Feature modules (paneledits, subscriptions, etc.)
└── 3.0/
├── automation-recipes/ # Recipe engine
│ ├── triggers/ # Trigger classes
│ ├── conditions/ # Condition classes
│ └── actions/ # Action classes
└── woocommerce/ # WooCommerce integration hooks