Settings & Restrictions - Filter Hook References

Modified on Sat, 19 Nov, 2022 at 7:24 PM

This is simply a list of settings & restrictions-related filter 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/method-options/get-{method_id}-rule-option-groups

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


Example Codes:

function custom_get_method_id_rule_option_groups( $group_types, $method_id ) {

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

add_filter( 'woopcd_partialcod-admin/method-options/get-{method_id}-rule-option-groups', 'custom_get_method_id_rule_option_groups', 10, 2 );

woopcd_partialcod-admin/method-options/get-rule-option-groups

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


Example Codes:

function custom_get_rule_option_groups( $group_types, $method_id ) {

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

add_filter( 'woopcd_partialcod-admin/method-options/get-rule-option-groups', 'custom_get_rule_option_groups', 10, 2 );

woopcd_partialcod-admin/method-options/get-{method_id}-rule-options

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


Example Codes:

function custom_get_method_id_rule_option_types( $option_types, $method_id ) {

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

add_filter( 'woopcd_partialcod-admin/method-options/get-{method_id}-rule-options', 'custom_get_method_id_rule_option_types', 10, 2 );

woopcd_partialcod-admin/method-options/get-rule-options

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


Example Codes:

function custom_get_rule_option_types( $option_types, $method_id ) {

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

add_filter( 'woopcd_partialcod-admin/method-options/get-rule-options', 'custom_get_rule_option_types', 10, 2 );

woopcd_partialcod-admin/method-options/get-rule-{option-option_type_id}-fields

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


Example Codes:

function custom_get_rule_option_option_type_id_fields( $fields, $method_id ) {

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

add_filter( 'woopcd_partialcod-admin/method-options/get-rule-{option-option_type_id}-fields', 'custom_get_rule_option_option_type_id_fields', 10, 2 );

woopcd_partialcod-admin/process-option-type-{option_type_id}

  • Parameters:
  • $options array()
  • $raw_options array()
  • $args array()


Example Codes:

function custom_process_option_type_option_type_id( $options, $raw_options, $args ) {

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

add_filter( 'woopcd_partialcod-admin/process-option-type-{option_type_id}', 'custom_process_option_type_option_type_id', 10, 3 );

woopcd_partialcod/method-option

  • Parameters:
  • $option array()
  • $option_id string


Example Codes:

function custom_method_option( $option, $option_id ) {

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

add_filter( 'woopcd_partialcod/method-option', 'custom_method_option', 10, 2 );

woopcd_partialcod/get-{option_type_id}-options

  • Parameters:
  • $option array()
  • $option_args array()
  • $cart_data array()


Example Codes:

function custom_get_option_type_id_options( $option, $option_args, $cart_data ) {

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

add_filter( 'woopcd_partialcod/get-{option_type_id}-options', 'custom_get_option_type_id_options', 10, 3 );

woopcd_partialcod/get-{option_type_id}-messages

  • Parameters:
  • $m_messages array()
  • $option array()
  • $option_id array()


Example Codes:

function custom_get_option_type_id_messages( $m_messages, $option, $option_id ) {

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

add_filter( 'woopcd_partialcod/get-{option_type_id}-messages', 'custom_get_option_type_id_messages', 10, 3 );

woopcd_partialcod/apply-{option_type_id}-method-option

  • Parameters:
  • $method array()
  • $option array()


Example Codes:

function custom_apply_option_type_id_method_option( $method, $option ) {

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

add_filter( 'woopcd_partialcod/apply-{option_type_id}-method-option', 'custom_apply_option_type_id_method_option', 10, 2 );

woopcd_partialcod/apply-method-messages

  • Parameters:
  • $messages array()


Example Codes:

function custom_apply_method_messages( $messages ) {

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

add_filter( 'woopcd_partialcod/apply-method-messages', 'custom_apply_method_messages', 10, 1 );








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