Handling Fees - Filter Hook References

Modified on Mon, 19 Sep 2022 at 08:42 AM

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:

function custom_fee_cost( $fee_cost, $fee_id, $instance_id ) {

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

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:

function custom_fee_taxes( $fee_taxes, $fee_id, $instance_id ) {

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

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:

function custom_fee_tax( $fee_tax, $fee_id, $instance_id ) {

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

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:

function custom_fee_tooltip( $fee_tooltip, $fee_id, $instance_id ) {

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

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:

function custom_fee_title( $fee_title, $fee_id, $instance_id ) {

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

add_filter( 'wtars_shipped/fee-title', 'custom_fee_title', 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 atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article