Filter uncanny-automator

automator_woocommerce_order_summary_table_style

Filters the CSS classes and inline styles applied to the WooCommerce order summary table within the plugin.

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

Description

Customize the styling for the WooCommerce order summary table used in Uncanny Automator. This filter allows developers to modify HTML attributes, CSS classes, or inline styles applied to the table, affecting font color, family, and more. Use it to control the visual presentation of order details within automations.


Usage

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

Parameters

$order (mixed)
This parameter is a placeholder for dynamic content that can be applied as a style to the order summary table.

Return Value

The filtered value.


Examples

<?php
/**
 * Example function to modify the order summary table style for Uncanny Automator.
 *
 * This function allows you to customize the CSS styles applied to the order summary
 * table, potentially for email notifications or other display purposes.
 *
 * @param string $table_styles The current HTML string for table styles.
 * @param WC_Order $order The WooCommerce order object.
 * @return string The modified HTML string for table styles.
 */
function my_custom_automator_order_summary_style( $table_styles, WC_Order $order ) {

	// Example: Add a custom background color to the table header cells (<th>).
	// We'll append our custom CSS to the existing styles.
	$custom_styles = "
		th {
			background-color: #f0f8ff; /* AliceBlue */
			color: #00008b; /* DarkBlue */
		}
		.automator-order-summary-table { /* Target the main table class if available */
			border-collapse: collapse;
			width: 100%;
		}
		.automator-order-summary-table td, .automator-order-summary-table th {
			border: 1px solid #ddd;
			padding: 8px;
		}
	";

	// Append the custom styles to the existing $table_styles.
	$table_styles .= $custom_styles;

	return $table_styles;
}
add_filter( 'automator_woocommerce_order_summary_table_style', 'my_custom_automator_order_summary_style', 10, 2 );

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:999
src/integrations/wholesale-suite/tokens/wss-tokens.php:640
uncanny-automator-pro/src/integrations/woocommerce/tokens/wc-pro-tokens.php:2926

* @param $order
	 *
	 * @return string
	 */
	public function build_summary_style_html( $order ) {
		$font_colour      = apply_filters( 'automator_woocommerce_order_summary_text_color', '#000', $order );
		$font_family      = apply_filters( 'automator_woocommerce_order_summary_font_family', "'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif", $order );
		$table_styles     = apply_filters( 'automator_woocommerce_order_summary_table_style', '', $order );
		$border_colour    = apply_filters( 'automator_woocommerce_order_summary_border_color', '#eee', $order );
		$tr_border_colour = apply_filters( 'automator_woocommerce_order_summary_tr_border_color', '#e5e5e5', $order );
		$tr_text_colour   = apply_filters( 'automator_woocommerce_order_summary_tr_text_color', '#636363', $order );
		$td_border_colour = apply_filters( 'automator_woocommerce_order_summary_td_border_color', '#e5e5e5', $order );
		$td_text_colour   = apply_filters( 'automator_woocommerce_order_summary_td_text_color', '#636363', $order );
		
		// Add filters for container styling


Scroll to Top