Skip to content

Hooks for integrations

base-plugin does not depend on the marketing/CRM packages. Where it used to call the Klaviyo package directly it now fires an action, and the Klaviyo package (barberklingen/woocommerce-klaviyo >= 3.2.0) listens. Any other integration can listen to the same hooks.

Action Arguments Fired from Klaviyo listener
flow-checkout/subscription/parent-order WC_Order $parent_order, WC_Subscription $subscription AjaxCheckoutSubscription::create_parent_order() Klaviyo\Watchers\Orders schedules PENDING_ORDER
flow-checkout/subscription/marketing-permissions WC_Subscription $subscription, ?string $context BaseAjaxCheckout::apply_marketing_permissions() Klaviyo\Trackers\CheckoutTracking adds the marketing consent and an order note
base-plugin/subscription/addon-product/item-deleted WC_Subscription $subscription, SubscriptionItemAddon $removed_item AddonSubscriptionsBackend::on_before_delete_order_item() when the product is on no other addon line Klaviyo\Watchers\PluginsEventAPIProvisioner schedules SUBSCRIPTION_UPDATED with the addon disabled

Actions fired through BaseAjaxCheckout::do_action() (such as parent-order) are also fired with a /context-{context} suffix. flow-checkout/subscription/marketing-permissions is fired directly and has no suffixed variant; the request context is its second argument instead.

New hooks outside an existing family get the base-plugin/ prefix.

Rule

src/ must not reference the Klaviyo\ namespace. tests/Architecture/NoKlaviyoCouplingTest.php enforces it.