Filter uncanny-automator

automator_woocommerce_order_summary_product_title

Filters the product title displayed in the order summary to customize its appearance or content.

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

Description

Filters the product title displayed in WooCommerce order summaries. Developers can modify the product name for custom display or to include additional information. This hook fires when the order summary is being generated.


Usage

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

Return Value

The filtered value.


Examples

<?php
/**
 * Example of how to use the automator_woocommerce_order_summary_product_title filter.
 * This example will append a custom suffix to the default 'Product' title in the order summary.
 */
add_filter(
	'automator_woocommerce_order_summary_product_title',
	'my_custom_automator_product_title',
	10,
	1
);

/**
 * Modifies the product title in the WooCommerce order summary for Uncanny Automator.
 *
 * @param string $title The original product title.
 * @return string The modified product title.
 */
function my_custom_automator_product_title( $title ) {
	// Append a custom suffix to the product title.
	// In a real-world scenario, you might want to check for specific conditions
	// or make this suffix dynamic based on other data.
	$custom_suffix = ' (For Automator)';
	$modified_title = $title . $custom_suffix;

	// Ensure the modified title is properly escaped for HTML attributes.
	return esc_attr( $modified_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:1036
src/integrations/wholesale-suite/tokens/wss-tokens.php:663
uncanny-automator-pro/src/integrations/woocommerce/tokens/wc-pro-tokens.php:2949

$html[] = '<thead>';
		$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">',


Scroll to Top