Handling Fees - Filter Hook References

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 array()
  • $instance_id array()

Example Codes:

  1. function custom_fee_cost( $fee_cost, $fee_id, $instance_id ) {
  2.   //add your custom code here
  3.   return $fee_cost;
  4. }
  5. add_filter( 'wtars_shipped/fee-cost', 'custom_fee_cost', 10, 3 );

wtars_shipped/fee-taxes

  • Parameters:
  • $fees_taxes array()
  • $fee_id array()
  • $instance_id array()

Example Codes:

  1. function custom_fee_taxes( $fee_taxes, $fee_id, $instance_id ) {
  2.   //add your custom code here
  3.   return $fee_taxes;
  4. }
  5. add_filter( 'wtars_shipped/fee-taxes', 'custom_fee_taxes', 10, 3 );

wtars_shipped/fee-tax

  • Parameters:
  • $fee_tax array()
  • $fee_id array()
  • $instance_id array()

Example Codes:

  1. function custom_fee_tax( $fee_tax, $fee_id, $instance_id ) {
  2.   //add your custom code here
  3.   return $fee_tax;
  4. }
  5. add_filter( 'wtars_shipped/fee-tax', 'custom_fee_tax', 10, 3 );

wtars_shipped/fee-tooltip

  • Parameters:
  • $fee_tooltip array()
  • $fee_id array()
  • $instance_id array()

Example Codes:

  1. function custom_fee_tooltip( $fee_tooltip, $fee_id, $instance_id ) {
  2.   //add your custom code here
  3.    return $fee_tooltip;
  4. }
  5. add_filter( 'wtars_shipped/fee-tooltip', 'custom_fee_tooltip', 10, 3 );

wtars_shipped/fee-title

  • Parameters:
  • $fee_title array()
  • $fee_id array()
  • $instance_id array()

Example Codes:

  1. function custom_fee_title( $fee_title, $fee_id, $instance_id ) {
  2.    //add your custom code here
  3.    return $fee_title;
  4. }
  5. add_filter( 'wtars_shipped/fee-title', 'custom_fee_title', 10, 3 );