Filter uncanny-automator

automator_woocommerce_order_summary_quantity_title

Filters the quantity title displayed in the WooCommerce order summary for Uncanny Automator.

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

Description

This filter allows developers to modify the "Quantity" title displayed in WooCommerce order summaries within Uncanny Automator. You can change the default text to customize how quantity information is presented in triggered emails or other automator outputs.


Usage

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

Return Value

The filtered value.


Examples

<?php
/**
 * Example: Modify the 'Quantity' title in the WooCommerce order summary.
 *
 * This filter allows you to change the default text 'Quantity' that appears
 * as a column header in the order summary table generated by Uncanny Automator.
 *
 * @param string $title The default title for the quantity column.
 * @return string The modified title for the quantity column.
 */
add_filter( 'automator_woocommerce_order_summary_quantity_title', 'modify_automator_quantity_title', 10, 1 );

function modify_automator_quantity_title( $title ) {
	// Example: Append a suffix to the title if it's the default 'Quantity'.
	// This could be useful for adding context or a specific label for your automation.
	if ( $title === esc_attr__( 'Quantity', 'uncanny-automator' ) ) {
		$title = $title . ' (Ordered)';
	}

	// You could also entirely replace the title, for example:
	// $title = 'Number of Items';

	return $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:1037
src/integrations/wholesale-suite/tokens/wss-tokens.php:664
uncanny-automator-pro/src/integrations/woocommerce/tokens/wc-pro-tokens.php:2950

$html[] = '<tr class="row">';
		$th     = sprintf(
			'<th class="td" scope="col" style="color: %s; border: 1px solid %s; vertical-align: middle; padding: 12px; text-align: left;">',
			$tr_text_colour,
			$tr_border_colour
		);
		$html[] = $th . '<strong>' . apply_filters( 'automator_woocommerce_order_summary_product_title', esc_attr__( 'Product', 'uncanny-automator' ) ) . '</strong></th>';
		$html[] = $th . '<strong>' . apply_filters( 'automator_woocommerce_order_summary_quantity_title', esc_attr__( 'Quantity', 'uncanny-automator' ) ) . '</strong></th>';
		$html[] = $th . '<strong>' . apply_filters( 'automator_woocommerce_order_summary_price_title', esc_attr__( 'Price', 'uncanny-automator' ) ) . '</strong></th>';
		$html[] = '</thead>';
		if ( $items ) {
			/** @var WC_Order_Item_Product $item */
			$td = sprintf(
				'<td class="td" style="color: %s; border: 1px solid %s; padding: 12px; text-align: left; vertical-align: middle; font-family: %s">',
				$td_text_colour,


Scroll to Top