Order Autopilots - Filter & Action Hook References

Modified on Sat, 19 Nov, 2022 at 8:32 PM

This is simply a list of order autopilot-related filter/action hooks that can be found within the WooCommerce Partial COD - Payment Gateway Restrictions & Fees files. This list also includes the supported parameters and example codes.


woopcd_partialcod-admin/order-activities/get-trigger-types

  • Parameters:
  • $trigger-types array()
  • $args array()


Example Codes:

function custom_get_trigger_types( $trigger-types, $args ) {

    //add your custom code here
    return $trigger-types;
}

add_filter( 'woopcd_partialcod-admin/order-activities/get-trigger-types', 'custom_get_trigger_types', 10, 2 );

woopcd_partialcod-admin/order-activities/get-{method_id}-activity-groups

  • Parameters:
  • $group_types array()
  • $method_id string


Example Codes:

function custom_get_method_id_activity_groups( $group_types, $method_id ) {

    //add your custom code here
    return $group_types;
}

add_filter( 'woopcd_partialcod-admin/order-activities/get-{method_id}-activity-groups', 'custom_get_method_id_activity_groups', 10, 2 );

woopcd_partialcod-admin/order-activities/get-activity-groups

  • Parameters:
  • $group_types array()
  • $method_id string


Example Codes:

function custom_get_activity_groups( $group_types, $method_id ) {

    //add your custom code here
    return $group_types;
}

add_filter( 'woopcd_partialcod-admin/order-activities/get-activity-groups', 'custom_get_activity_groups', 10, 2 );

woopcd_partialcod-admin/order-activities/get-{method_id}-activity-types

  • Parameters:
  • $activity-types array()
  • $method_id string


Example Codes:

function custom_get_method_id_activity_types( $activity-types, $method_id ) {

    //add your custom code here
    return $activity-types;
}

add_filter( 'woopcd_partialcod-admin/order-activities/get-{method_id}-activity-types', 'custom_get_method_id_activity_types', 10, 2 );

woopcd_partialcod-admin/order-activities/get-activity-types

  • Parameters:
  • $activity-types array()
  • $method_id string


Example Codes:

function custom_get_activity_types( $activity-types, $method_id ) {

    //add your custom code here
    return $activity-types;
}

add_filter( 'woopcd_partialcod-admin/order-activities/get-activity-types', 'custom_get_activity_types', 10, 2 );

woopcd_partialcod-admin/order-activities/get-activity-{activity_type_id}-fields

  • Parameters:
  • $fields array()
  • $method_id string


Example Codes:

function custom_get_activity_activity_type_id_fields( $fields, $method_id ) {

    //add your custom code here
    return $fields;
}

add_filter( 'woopcd_partialcod-admin/order-activities/get-activity-{activity_type_id}-fields', 'custom_get_activity_activity_type_id_fields', 10, 2 );

woopcd_partialcod/get-{activity_type_id}-activities

  • Parameters:
  • $activity array()
  • $activity_args array()
  • $order_data array()


Example Codes:

function custom_get_activity_type_id_activities( $activity, $activity_args, $order_data ) {

    //add your custom code here
    return $activity;
}

add_filter( 'woopcd_partialcod/get-{activity_type_id}-activities', 'custom_get_activity_type_id_activities', 10, 3 );

woopcd_partialcod/activity

  • Parameters:
  • $activity array()
  • $activity_id string
  • $order_id integer


Example Codes:

function custom_get_activity( $activity, $activity_id, $order_id ) {

    //add your custom code here
    return $activity;
}

add_filter( 'woopcd_partialcod/activity', 'custom_get_activity', 10, 3 );

woopcd_partialcod/apply-{activity_type_id}-activity

  • Parameters:
  • $order_id integer
  • $activity array()
  • $activity_id string


Example Codes:

function custom_apply_activity_type_id_activity( $order_id, $activity, $activity_id ) {

    //add your custom code here
}

add_action( 'woopcd_partialcod/apply-{activity_type_id}-activity', 'custom_apply_activity_type_id_activity', 10, 3 );

woopcd_partialcod/trigger-order-activities

  • Parameters:
  • $order_id integer
  • $args array()


Example Codes:

function custom_trigger_order_activities( $order_id, $args ) {

    //add your custom code here
}

add_action( 'woopcd_partialcod/trigger-order-activities', 'custom_trigger_order_activities', 10, 2 );


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article