Cart / Package Totals - Filter Hook References

Modified on Mon, 19 Sep, 2022 at 8:50 AM

This is simply a list of cart/package totals-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-totals-options

  • Parameters:
  • $option_types array()


Example Codes:

function custom_get_totals_options( $option_types ) {

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

add_filter( 'wtars_shipped_admin/get-totals-options', 'custom_get_totals_options', 10 );

wtars_shipped/calculate-{option_type_id}-totals

  • Parameters:
  • $totals array()
  • $data array()


Example Codes:

function custom_calculate_option_type_id_totals( $totals, $data ) {

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

add_filter( 'wtars_shipped/calculate-option_type_id-totals', 'custom_calculate_option_type_id_totals', 10, 2 );

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