Filter uncanny-automator

automator_woocommerce_order_summary_total_title

Filters the "Total:" label displayed in the WooCommerce order summary, allowing customization of the total title.

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

Description

This filter hook allows modification of the "Total" label displayed in WooCommerce order summaries within Uncanny Automator. Developers can change this text dynamically to personalize output. It fires when the order total row is being generated, providing a prime opportunity to customize labels.


Usage

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

Return Value

The filtered value.


Examples

// Change the text displayed for the "Total" label in the WooCommerce order summary
add_filter( 'automator_woocommerce_order_summary_total_title', 'my_automator_change_total_title', 10, 1 );

function my_automator_change_total_title( $total_title ) {
    // You can dynamically change the title based on certain conditions if needed.
    // For this example, we'll simply append a string to the default title.
    $new_total_title = $total_title . ' (Final)';
    return $new_total_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:1118
src/integrations/wholesale-suite/tokens/wss-tokens.php:745
uncanny-automator-pro/src/integrations/woocommerce/tokens/wc-pro-tokens.php:3031

$html[] = '</td>';
			$html[] = '</tr>';
		}
		// Total
		if ( true === apply_filters( 'automator_woocommerce_order_summary_show_total', true, $order ) ) {
			$html[] = '<tr>';
			$html[] = $td;
			$html[] = apply_filters( 'automator_woocommerce_order_summary_total_title', esc_attr__( 'Total:', 'uncanny-automator' ) );
			$html[] = '</td>';
			$html[] = $td_right;
			$html[] = $order->get_formatted_order_total();
			$html[] = '</td>';
			$html[] = '</tr>';
		}
		$html[] = '</table>';


Scroll to Top