All docs / Developer Guide

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

ShortcodeDescription
[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:

  1. URL parameters (Email, email, contactId, Id, etc.)
  2. POST data with the same parameter names
  3. 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:

HookWhen it fires
infusedwoo_payment_completeAfter payment is processed and synced to Keap (triggers recipes)
infusedwoo_product_purchaseAfter per-product actions run (tag, email, action set)
infusedwoo_order_processAfter order processing creates/updates the contact
infusedwoo_reg_processAfter user registration creates/updates a contact
infusedwoo_automation_loadedWhen recipe system is ready (register custom components here)
iw_order_importedAfter a Keap order is imported to WooCommerce
iw_order_exportedAfter a WooCommerce order is exported to Keap
infusedwoo_user_cancelled_subWhen a user cancels a subscription from My Account

Key Filters

These filters let you modify data before InfusedWoo processes it:

FilterPurpose
iw_should_use_rest_apiOverride REST vs XML-RPC decision per service
iw_reg_contactvalsModify contact data before creating on registration
iw_before_updatecontactModify contact data before updating existing contact
iw_before_addcontactModify contact data before adding new contact
infusedwoo_create_contact_on_checkoutReturn false to skip contact creation at checkout
iw_pg_merchant_idOverride the Keap merchant account ID per order
infusedwoo_modify_orderModify order data before creating in Keap
iw_max_auto_adjustmentMax rounding adjustment for payment amounts
infusedwoo_tc_msgCustomize terms & conditions message text
infusedwoo_cookiealert_msgCustomize 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

MethodEndpointPurpose
GET/settings/apiGet API settings
PUT/settings/apiUpdate API settings
GET/settings/cacheGet cache status
POST/settings/cache/clearClear caches
GET/automation/recipesList automation recipes
POST/automation/recipesCreate a recipe
GET/automation/recipes/{id}Get recipe details
PUT/automation/recipes/{id}Update a recipe
GET/payments/keap-gatewayGet gateway status
GET/payments/other-gatewaysGet 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:

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