Filter
uncanny-automator
automator_woocommerce_order_summary_tr_border_color
Filters the border color for table rows in the WooCommerce order summary.
add_filter( 'automator_woocommerce_order_summary_tr_border_color', $callback, 10, 1 );
Description
Filters the border color for rows within the WooCommerce order summary displayed in Uncanny Automator. Developers can dynamically change this color, for example, based on order status or customer data, to visually differentiate order items.
Usage
add_filter( 'automator_woocommerce_order_summary_tr_border_color', 'your_function_name', 10, 1 );
Parameters
-
$order(mixed) - This parameter provides the default border color for the order summary table rows.
Return Value
The filtered value.
Examples
add_filter( 'automator_woocommerce_order_summary_tr_border_color', 'my_custom_order_summary_tr_border_color', 10, 2 );
/**
* Changes the border color for table rows in the WooCommerce order summary for Uncanny Automator.
*
* This function allows customization of the TR border color based on order properties.
*
* @param string $border_color The current border color.
* @param WC_Order $order The WooCommerce order object.
* @return string The modified border color.
*/
function my_custom_order_summary_tr_border_color( $border_color, $order ) {
// Example: Change border color to red for orders over $100
if ( $order->get_total() > 100 ) {
return '#ff0000'; // Red
}
// Example: Change border color to blue for orders from a specific customer ID
if ( $order->get_customer_id() === 123 ) {
return '#0000ff'; // Blue
}
// Default color if no conditions are met
return $border_color;
}
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:1001
src/integrations/wholesale-suite/tokens/wss-tokens.php:642
uncanny-automator-pro/src/integrations/woocommerce/tokens/wc-pro-tokens.php:2928
* @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 );
$container_class = apply_filters( 'automator_woocommerce_order_summary_container_class', 'automator-order-summary-container', $order );