Filter uncanny-automator

automator_woocommerce_order_summary_border_color

Filters the border color for the WooCommerce order summary section.

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

Description

Filters the border color of the WooCommerce order summary. This hook allows developers to customize the border color displayed in order summaries within Uncanny Automator workflows. By default, it's set to '#eee'. The $order object is also available for conditional styling.


Usage

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

Parameters

$order (mixed)
This parameter is the default border color for the WooCommerce order summary.

Return Value

The filtered value.


Examples

<?php
/**
 * Change the order summary border color to a dark grey.
 *
 * @param string $default_color The default border color.
 * @param WC_Order $order The WooCommerce order object.
 * @return string The new border color.
 */
add_filter( 'automator_woocommerce_order_summary_border_color', function( $default_color, $order ) {
    // Check if the order is valid and if it's a specific type of order (e.g., a test order).
    // In a real scenario, you might check for order status, customer meta, etc.
    if ( $order instanceof WC_Order && $order->get_meta( '_is_test_order' ) === 'yes' ) {
        return '#333'; // Return a dark grey for test orders.
    }

    // Otherwise, return the default color.
    return $default_color;
}, 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:1000
src/integrations/wholesale-suite/tokens/wss-tokens.php:641
uncanny-automator-pro/src/integrations/woocommerce/tokens/wc-pro-tokens.php:2927

*
	 * @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
		$max_width        = apply_filters( 'automator_woocommerce_order_summary_max_width', '640px', $order );


Scroll to Top