WordPress filter hook

woocommerce_get_order_item_totals_excl_free_fees

Defined by WooCommerce and fired by 6 plugins in total, running on 7M+ sites between them.

How to use woocommerce_get_order_item_totals_excl_free_fees

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_get_order_item_totals_excl_free_fees', function( $empty, $id ) {
	// Change $empty here.
	return $empty;
}, 10, 2 );

Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

6 plugins that fire woocommerce_get_order_item_totals_excl_free_fees

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', empty( $fee['line_total'] ) && empty( $fee['line_tax'] ), $id ) includes/abstracts/abstract-wc-order.php:3053
  2. Invoices for WooCommerce icon Invoices for WooCommerce10,000+ installs apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', empty( $fee['line_total'] ) && empty( $fee['line_tax'] ), $id ) includes/abstracts/abstract-invoice.php:566
  3. YayCurrency icon YayCurrency7,000+ installs apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', empty( $fee['line_total'] ) && empty( $fee['line_tax'] ), $id ) includes/Engine/FEPages/WooCommerceCurrency.php:874
  4. Payment Gateway Currency for WooCommerce icon Payment Gateway Currency for WooCommerce300+ installs apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', empty( $fee['line_total'] ) && empty( $fee['line_tax'] ), $id ) includes/class-alg-wc-pgbc-convert-info-frontend.php:279
  5. CM Commerce for WooCommerce icon CM Commerce for WooCommerce70+ installs apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', ($fee->get_total() + $fee->get_total_tax()) == 0, $id ) includes/emails/class-cm-commerce-email-customer-new-order.php:363
  6. Cryptocurrency Product for WooCommerce icon Cryptocurrency Product for WooCommerce10+ installs apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', empty( $fee['line_total'] ) && empty( $fee['line_tax'] ), $id ) cryptocurrency-product-for-woocommerce.php:1660

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.