Filter uncanny-automator

automator_woocommerce_order_summary_tax_title

Filters the text displayed for the tax title in WooCommerce order summaries.

add_filter( 'automator_woocommerce_order_summary_tax_title', $callback, 10, 1 );

Description

This filter allows developers to modify the title displayed for taxes in WooCommerce order summaries. You can change the text, or even return an empty string to hide the tax title entirely, offering granular control over how tax information is presented within the order summary.


Usage

add_filter( 'automator_woocommerce_order_summary_tax_title', 'your_function_name', 10, 1 );

Return Value

The filtered value.


Examples

/**
 * Change the displayed label for the tax in the order summary.
 *
 * This filter allows you to modify the text used to label the tax amount
 * in the order summary generated by Uncanny Automator.
 *
 * @param string $title The default tax title.
 * @return string The modified tax title.
 */
add_filter( 'automator_woocommerce_order_summary_tax_title', 'my_custom_automator_tax_title', 10, 1 );
function my_custom_automator_tax_title( $title ) {
    // Example: Change "Tax:" to "VAT:" if it's a specific type of tax, or always.
    // In a real scenario, you might check order meta or user roles for conditional changes.
    // For this example, we'll simply prepend "Applied " to the existing title.
    return 'Applied ' . $title;
}

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

src/integrations/woocommerce/tokens/wc-tokens.php:1095
src/integrations/wholesale-suite/tokens/wss-tokens.php:722
uncanny-automator-pro/src/integrations/woocommerce/tokens/wc-pro-tokens.php:3008

$html[] = '</tr>';
		}
		// Tax
		if ( true === apply_filters( 'automator_woocommerce_order_summary_show_taxes', true, $order ) ) {
			if ( ! empty( $order->get_taxes() ) ) {
				$html[] = '<tr>';
				$html[] = $td;
				$html[] = apply_filters( 'automator_woocommerce_order_summary_tax_title', esc_attr__( 'Tax:', 'uncanny-automator' ) );
				$html[] = '</td>';
				$html[] = $td_right;
				$html[] = wc_price( $order->get_total_tax() );
				$html[] = '</td>';
				$html[] = '</tr>';
			}
		}


Scroll to Top