Shipping Costs / Shipping Fees - Filter Hook References

Shipping Costs / Shipping Fees - Filter Hook References

This is simply a list of shipping costs/fees related filter hooks found within the WooCommerce Table Rate Shipping files. This list also includes the supported parameters and example codes.


wtars_shipped_admin/get-cost-type-groups

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

Example Codes:

  1. function custom_get_cost_type_groups( $group_types, $args ) {
  2.   //add your custom code here
  3.   return $group_types;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-cost-type-groups', 'custom_get_cost_type_groups', 10, 2 );

wtars_shipped_admin/get-cost-group-types-{group_type_id}

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

Example Codes:

  1. function custom_get_cost_types( $cost_types, $args ) {
  2.   //add your custom code here
  3.   return $cost_types;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-cost-group-types-custom_group_id', 'custom_get_cost_types', 10, 2 );

wtars_shipped_admin/get-cost-type-{cost_type_id}-fields

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

Example Codes:

  1. function custom_get_cost_type_fields( $in_fields, $args ) {
  2.   //add your custom code here
  3.   return $in_fields;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-cost-type-custom_cost_type_id-fields', 'custom_get_cost_type_fields', 10, 2 );

wtars_shipped_admin/get-cost-type-fields

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

Example Codes:

  1. function custom_get_cost_type_fields( $in_fields, $args ) {
  2.   //add your custom code here
  3.   return $in_fields;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-cost-type-fields', 'custom_get_cost_type_fields', 10, 2 );

wtars_shipped_admin/get-cost-add-methods

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

Example Codes:

  1. function custom_get_cost_add_methods( $add_methods, $args ) {
  2.    //add your custom code here
  3.    return $add_methods;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-cost-add-methods', 'custom_get_cost_add_methods', 10, 2 );

wtars_shipped_admin/get-cost-box-fields

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

Example Codes:

  1. function custom_get_cost_box_fields( $in_fields, $args ) {
  2.    //add your custom code here
  3.    return $in_fields;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-cost-box-fields', 'custom_get_cost_box_fields', 10, 2 );

wtars_shipped_admin/process-cost-options

  • Parameters:
  • $cost_option array()
  • $raw_cost array()
  • $args array()

Example Codes:

  1. function custom_process_cost_options( $cost_option, $raw_cost, $args ) {
  2.    //add your custom code here
  3.    return $cost_option;
  4. }
  5. add_filter( 'wtars_shipped_admin/process-cost-options', 'custom_process_cost_options', 10, 3 );

wtars_shipped_admin/process-cost-type-{cost_type_id}-options

  • Parameters:
  • $cost_option array()
  • $raw_cost array()
  • $args array()

Example Codes:

  1. function custom_process_cost_options( $cost_option, $raw_cost, $args ) {
  2.    //add your custom code here
  3.    return $cost_option;
  4. }
  5. add_filter( 'wtars_shipped_admin/process-cost-type-cost_type_id-options', 'custom_process_cost_options', 10, 3 );

wtars_shipped_admin/get-based-on-required-ids

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

Example Codes:

  1. function custom_get_based_on_required_ids( $cost_type_ids, $args ) {
  2.    //add your custom code here
  3.    return $cost_type_ids;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-based-on-required-ids', 'custom_get_based_on_required_ids', 10, 2 );

wtars_shipped_admin/get-item-based-on-required-ids

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

Example Codes:

  1. function custom_get_item_based_on_required_ids( $cost_type_ids, $args ) {
  2.    //add your custom code here
  3.    return $cost_type_ids;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-item-based-on-required-ids', 'custom_get_item_based_on_required_ids', 10, 2 );

wtars_shipped_admin/get-round-required-ids

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

Example Codes:

  1. function custom_get_round_required_ids( $cost_type_ids, $args ) {
  2.    //add your custom code here
  3.    return $cost_type_ids;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-round-required-ids', 'custom_get_round_required_ids', 10, 2 );

wtars_shipped_admin/{module}/get-products-required-ids

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

Example Codes:

  1. function custom_get_products_required_ids( $cost_type_ids, $args ) {
  2.    //add your custom code here
  3.    return $cost_type_ids;
  4. }
  5. add_filter( 'wtars_shipped_admin/shipping-rates/get-products-required-ids', 'custom_get_products_required_ids', 10, 2 );

wtars_shipped_admin/get-products-required-ids

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

Example Codes:

  1. function custom_get_products_required_ids( $cost_type_ids, $args ) {
  2.    //add your custom code here
  3.    return $cost_type_ids;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-products-required-ids', 'custom_get_products_required_ids', 10, 2 );

wtars_shipped_admin/get-package-grouping-types

  • Parameter:
  • $package_grouping_types array()
  • $args array()

Example Codes:

  1. function custom_get_package_grouping_types( $package_grouping_types, $args ) {
  2.    //add your custom code here
  3.    return $package_grouping_types;
  4. }
  5. add_filter( 'wtars_shipped_admin/get-package-grouping-types', 'custom_get_package_grouping_types', 10, 2 );

wtars_shipped/calculate-{cost_type_id}-cost

  • Parameters:
  • $cost array()
  • $cost_args array()
  • $data array()

Example Codes:

  1. function custom_calculate_cost_type_id_cost( $cost, $cost_args, $data ) {
  2.    //add your custom code here
  3.    return WC_Shipped_Cost_Types::prepare_cost( $cost, 10, $cost_args );
  4. }
  5. add_filter( 'wtars_shipped/calculate-cost_type_id-cost', 'custom_calculate_cost_type_id_cost', 10, 3 );
    • Related Articles

    • Shipping Rates - Filter Hook References

      This is simply a list of shipping rates-related filter hooks found within the WooCommerce Table Rate Shipping files. This list also includes the supported parameters and example codes. wtars_shipped/rate-cost Parameters: $rate_cost array() $rate_id ...
    • Handling Fees - Filter Hook References

      This is simply a list of handling fee-related filter hooks found within the WooCommerce Table Rate Shipping files. This list also includes the supported parameters and example codes. wtars_shipped/fee-cost Parameters: $rate_metas array() $rate_id ...
    • Others - Filter Hook References

      This is simply a list of other filter hooks found within the WooCommerce Table Rate Shipping files. This list also includes the supported parameters and example codes. wtars_shipped_admin/get-settings-section-fields Parameters: $in_fields array() ...
    • Conditions - Filter Hook References

      This is simply a list of conditions related filter hooks found within the WooCommerce Table Rate Shipping files. This list also includes the supported parameters and example codes. wtars_shipped_admin/get-condition-groups Parameters: $group_types ...
    • Product Rules - Filter Hook References

      This is simply a list of product rules related filter hooks found within the WooCommerce Table Rate Shipping files. This list also includes the supported parameters and example codes. wtars_shipped_admin/get-product-filter-groups Parameters: ...