Partial Payment Amounts - Filter Hook References

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

This is simply a list of partial payment amount-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/get-payment-amount-type-groups

  • Parameters:
  • $group_types array()
  • $args array()


Example Codes:

function custom_get_payment_amount_type_groups( $group_types, $args ) {

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

add_filter( 'woopcd_partialcod-admin/get-payment-amount-type-groups', 'custom_get_payment_amount_type_groups', 10, 2 );

woopcd_partialcod-admin/get-payment-amount-types-{group-type-id}

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


Example Codes:

function custom_get_payment_amount_types_group_type_id( $amount-types, $args ) {

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

add_filter( 'woopcd_partialcod-admin/get-payment-amount-types-{group-type-id}', 'custom_get_payment_amount_types_group_type_id', 10, 2 );

woopcd_partialcod-admin/get-payment-amount-type-{amount_type_id}-fields

  • Parameters:
  • $fields array()
  • $args array()


Example Codes:

function custom_get_payment_amount_type_amount_type_id_fields( $fields, $args ) {

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

add_filter( 'woopcd_partialcod-admin/get-payment-amount-type-{amount_type_id}-fields', 'custom_get_payment_amount_type_amount_type_id_fields', 10, 2 );

woopcd_partialcod-admin/get-payment-amount-type-fields

  • Parameters:
  • $fields array()
  • $args array()


Example Codes:

function custom_get_payment_amount_type_fields( $fields, $args ) {

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

add_filter( 'woopcd_partialcod-admin/get-payment-amount-type-fields', 'custom_get_payment_amount_type_fields', 10, 2 );

woopcd_partialcod-admin/get-payment-amount-required-ids

  • Parameters:
  • $amount_type_ids array()
  • $args array()


Example Codes:

function custom_get_payment_amount_required_ids( $amount_type_ids, $args ) {

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

add_filter( 'woopcd_partialcod-admin/get-payment-amount-required-ids', 'custom_get_payment_amount_required_ids', 10, 2 );

woopcd_partialcod-admin/get-payment-based-on-required-ids

  • Parameters:
  • $amount_type_ids array()
  • $args array()


Example Codes:

function custom_get_payment_based_on_required_ids( $amount_type_ids, $args ) {

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

add_filter( 'woopcd_partialcod-admin/get-payment-based-on-required-ids', 'custom_get_payment_based_on_required_ids', 10, 2 );

woopcd_partialcod-admin/get-payment-item-based-on-required-ids

  • Parameters:
  • $amount_type_ids array()
  • $args array()


Example Codes:

function custom_get_payment_item_based_on_required_ids( $amount_type_ids, $args ) {

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

add_filter( 'woopcd_partialcod-admin/get-payment-item-based-on-required-ids', 'custom_get_payment_item_based_on_required_ids', 10, 2 );

woopcd_partialcod-admin/process-payment-amount-options

  • Parameters:
  • $amount array()
  • $raw_amount array()
  • $args array()


Example Codes:

function custom_process_payment_amount_options( $amount, $raw_amount, $args ) {

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

add_filter( 'woopcd_partialcod-admin/process-payment-amount-options', 'custom_process_payment_amount_options', 10, 3 );

woopcd_partialcod-admin/process-payment-amount-type-{amount_type_id}-options

  • Parameters:
  • $amount array()
  • $raw_amount array()
  • $args array()


Example Codes:

function custom_process_payment_amount_type_amount_type_id_options( $amount, $raw_amount, $args ) {

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

add_filter( 'woopcd_partialcod-admin/process-payment-amount-type-{amount_type_id}-options', 'custom_process_payment_amount_type_amount_type_id_options', 10, 3 );

woopcd_partialcod/calculate-{amount_type_id}-payment-amount

  • Parameters:
  • $amount numeric
  • $raw_amount array()
  • $args array()


Example Codes:

function custom_calculate_amount_type_id_payment_amount( $amount, $amount_args, $cart_data ) {

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

add_filter( 'paygeo/calculate-{amount_type_id}-payment-amount', 'custom_calculate_amount_type_id_payment_amount', 10, 3 );


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