Cart / Package Totals - Filter Hook References

Cart / Package Totals - Filter Hook References

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:

  1. function custom_get_totals_options( $option_types ) {
  2.   //add your custom code here
  3.   return $option_types;
  4. }
  5. 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:

  1. function custom_calculate_option_type_id_totals( $totals, $data ) {
  2.   //add your custom code here
  3.   return $totals;
  4. }
  5. add_filter( 'wtars_shipped/calculate-option_type_id-totals', 'custom_calculate_option_type_id_totals', 10, 2 );