Actions
All hooks below are fired by the free plugin. Live Carts Pro uses several of them to add its features, which is a good place to look for examples.
Cart lifecycle
| Action | Parameters | Fired when |
|---|---|---|
phplugins_live_carts_cart_loaded | $cart (WooCommerce cart) | A cart is loaded on the frontend. |
phplugins_live_carts_cart_created | $cartId | A new cart record is created. |
phplugins_live_carts_cart_seen | $cartId | A new or existing cart is marked as seen. |
phplugins_live_carts_cart_contents_updated | $cartId | The cart contents change. |
phplugins_live_carts_cart_converted | $cartId | A conversion is detected. |
phplugins_live_carts_cart_abandoned | $cartId | A cart is marked abandoned. |
phplugins_live_carts_cart_deleted | $cartId | A cart is permanently deleted. |
phplugins_live_carts_cart_email_updated | $cartId, $email | An email address is saved on a cart. |
phplugins_live_carts_list_created | $cartId, $type, $userId | A Shopper List record is created. |
add_action( 'phplugins_live_carts_cart_abandoned', function ( $cartId ) {
// e.g. notify a CRM
} );
Recovery emails
| Action | Parameters | Fired when |
|---|---|---|
phplugins_live_carts_recovery_email_sent | $cartId, $emailId | A recovery email was sent successfully. $emailId is the recovery email's post ID. |
phplugins_live_carts_recovery_email_settings | $post (WP_Post or empty) | Inside the recovery email editor sidebar. Add your own fields. Pro uses it for Discount percentage. |
phplugins_live_carts_recovery_email_settings_save | $emailId | After a recovery email is saved. The free plugin has already checked the nonce. |
Admin screens
| Action | Parameters | Where |
|---|---|---|
phplugins_live_carts_admin_cart_details | $cartId | Under the cart contents on the detail page. |
phplugins_live_carts_revision_diff_meta | $diff | Inside a revision's details in the history. |
phplugins_live_carts_list_after_view_links | none | After the status views above the cart list. |
phplugins_live_carts_list_after_bulk_actions | none | After the bulk actions on the cart list. |
phplugins_live_carts_list_archive_hint | none | Replaces the text after the "carts are removed after N days" note. |
Settings screens
Each hook outputs inside its tab or section.
| Action | Where |
|---|---|
phplugins_live_carts_settings_tracking | End of the Tracking tab. |
phplugins_live_carts_settings_tracking_cart_data | Cart data row. Replaces Pro's placeholder in the free plugin. |
phplugins_live_carts_settings_tracking_cart_details | Cart details row. |
phplugins_live_carts_settings_tracking_cart_exclusions | Exclude from tracking row. |
phplugins_live_carts_settings_lifecycle | End of the Lifecycle tab. |
phplugins_live_carts_settings_lifecycle_cart_lifecycle | Cart lifecycle row. |
phplugins_live_carts_settings_display | End of the Display tab. |
phplugins_live_carts_settings_email | End of the Email tab. |
phplugins_live_carts_save_settings_settings | After the Settings form is saved. |
phplugins_live_carts_save_settings_healthstatus | After the Status form is saved. |
Deprecated
phplugins_live_carts_settings_general and phplugins_live_carts_save_settings are older names. Use the per-tab hooks above.