Cart Contents - Filter Hook References - Shipped

Cart Contents - Filter Hook References

This is simply a list of cart contents-related filter hooks found within the WooCommerce Table Rate Shipping files. This list also includes the supported parameters and example codes.


wtars_shipped/get-cart-item

  • Parameters:
  • $cart_item array()
  • $item array()

Example Codes:

  1. function custom_fee_title( $cart_item, $item ) {
  2.   //add your custom code here
  3.   return $cart_item;
  4. }
  5. add_filter( 'wtars_shipped/get-cart-item', 'custom_get_cart_item', 10, 2 );

wtars_shipped/get-cart-product-data

  • Parameters:
  • $product_data array()
  • $product array()
  • $item_key array()

Example Codes:

  1. function custom_get_cart_product_data( $product_data, $product, $item_key ) {
  2.   //add your custom code here
  3.   return $product_data;
  4. }
  5. add_filter( 'wtars_shipped/get-cart-product-data', 'custom_get_cart_product_data', 10, 3 );

wtars_shipped/get-cart-totals

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

Example Codes:

  1. function custom_get_cart_totals( $totals, $cart ) {
  2.   //add your custom code here
  3.   return $totals;
  4. }
  5. add_filter( 'wtars_shipped/get-cart-totals', 'custom_get_cart_totals', 10, 2 );

wtars_shipped/get-cart-applied-coupons

  • Parameters:
  • $applied_coupons array()
  • $cart array()

Example Codes:

  1. function custom_get_cart_applied_coupons( $applied_coupons, $cart ) {
  2.   //add your custom code here
  3.   return $applied_coupons;
  4. }
  5. add_filter( 'wtars_shipped/get-cart-applied-coupons', 'custom_get_cart_applied_coupons', 10, 2 );

wtars_shipped/get-cart-shipping-rates

  • Parameters:
  • $shipping_rates array()
  • $cart array()

Example Codes:

  1. function custom_get_cart_shipping_rates( $shipping_rates, $cart ) {
  2.   //add your custom code here
  3.   return $shipping_rates;
  4. }
  5. add_filter( 'wtars_shipped/get-cart-shipping-rates', 'custom_get_cart_shipping_rates', 10, 2 );

wtars_shipped/get-cart-method-id

  • Parameters:
  • $method_id array()
  • $cart array()

Example Codes:

  1. function custom_get_cart_method_id( $method_id, $cart ) {
  2.   //add your custom code here
  3.   return $method_id;
  4. }
  5. add_filter( 'wtars_shipped/get-cart-method-id', 'custom_get_cart_method_id', 10, 2 );

wtars_shipped/get-cart-customer

  • Parameters:
  • $customer array()
  • $cart array()

Example Codes:

  1. function custom_get_cart_customer( $customer, $cart ) {
  2.   //add your custom code here
  3.   return $customer;
  4. }
  5. add_filter( 'wtars_shipped/get-cart-customer', 'custom_get_cart_customer', 10, 2 );
    • Related Articles

    • Package Contents - Filter Hook References

      This is simply a list of package contents-related filter hooks found within the WooCommerce Table Rate Shipping files. This list also includes the supported parameters and example codes. wtars_shipped/get-package-item Parameters: $package_item ...
    • 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: ...
    • 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 ...
    • 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: ...
    • 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() ...