Skip to main content

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​

ActionParametersFired when
phplugins_live_carts_cart_loaded$cart (WooCommerce cart)A cart is loaded on the frontend.
phplugins_live_carts_cart_created$cartIdA new cart record is created.
phplugins_live_carts_cart_seen$cartIdA new or existing cart is marked as seen.
phplugins_live_carts_cart_contents_updated$cartIdThe cart contents change.
phplugins_live_carts_cart_converted$cartIdA conversion is detected.
phplugins_live_carts_cart_abandoned$cartIdA cart is marked abandoned.
phplugins_live_carts_cart_deleted$cartIdA cart is permanently deleted.
phplugins_live_carts_cart_email_updated$cartId, $emailAn email address is saved on a cart.
phplugins_live_carts_list_created$cartId, $type, $userIdA Shopper List record is created.
add_action( 'phplugins_live_carts_cart_abandoned', function ( $cartId ) {
// e.g. notify a CRM
} );

Recovery emails​

ActionParametersFired when
phplugins_live_carts_recovery_email_sent$cartId, $emailIdA 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$emailIdAfter a recovery email is saved. The free plugin has already checked the nonce.

Admin screens​

ActionParametersWhere
phplugins_live_carts_admin_cart_details$cartIdUnder the cart contents on the detail page.
phplugins_live_carts_revision_diff_meta$diffInside a revision's details in the history.
phplugins_live_carts_list_after_view_linksnoneAfter the status views above the cart list.
phplugins_live_carts_list_after_bulk_actionsnoneAfter the bulk actions on the cart list.
phplugins_live_carts_list_archive_hintnoneReplaces the text after the "carts are removed after N days" note.

Settings screens​

Each hook outputs inside its tab or section.

ActionWhere
phplugins_live_carts_settings_trackingEnd of the Tracking tab.
phplugins_live_carts_settings_tracking_cart_dataCart data row. Replaces Pro's placeholder in the free plugin.
phplugins_live_carts_settings_tracking_cart_detailsCart details row.
phplugins_live_carts_settings_tracking_cart_exclusionsExclude from tracking row.
phplugins_live_carts_settings_lifecycleEnd of the Lifecycle tab.
phplugins_live_carts_settings_lifecycle_cart_lifecycleCart lifecycle row.
phplugins_live_carts_settings_displayEnd of the Display tab.
phplugins_live_carts_settings_emailEnd of the Email tab.
phplugins_live_carts_save_settings_settingsAfter the Settings form is saved.
phplugins_live_carts_save_settings_healthstatusAfter 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.

  • REST API: read, and with Pro update, carts and shopper lists over HTTP.
  • Webhooks: get a signed JSON request at your own URL when a cart or shopper list changes.
  • Filters: PHP filters for changing how Live Carts tracks, stores and emails carts.