Filter
uncanny-automator
automator_woocommerce_order_summary_tr_text_color
Filters the text color used for order summary table rows in WooCommerce orders.
add_filter( 'automator_woocommerce_order_summary_tr_text_color', $callback, 10, 1 );
Description
Filters the text color for the WooCommerce order summary in Uncanny Automator. Developers can dynamically change the text color for order summary items by returning a valid CSS color string. The hook provides the current color and the order object for context.
Usage
add_filter( 'automator_woocommerce_order_summary_tr_text_color', 'your_function_name', 10, 1 );
Parameters
-
$order(mixed) - This parameter is the default text color for the order summary, which can be overridden by the filter.
Return Value
The filtered value.
Examples
/**
* Change the text color for order summary table rows to a darker grey.
*
* @param string $tr_text_colour The current text color for table rows.
* @param WC_Order $order The WooCommerce order object.
* @return string The modified text color.
*/
add_filter( 'automator_woocommerce_order_summary_tr_text_color', function( $tr_text_colour, $order ) {
// You could add conditional logic here based on the order if needed.
// For example, change color for orders over a certain amount.
// if ( $order->get_total() > 100 ) {
// return '#333333'; // A darker grey for high-value orders
// }
// Return a slightly darker shade of grey than the default.
return '#555555';
}, 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:1002
src/integrations/wholesale-suite/tokens/wss-tokens.php:643
uncanny-automator-pro/src/integrations/woocommerce/tokens/wc-pro-tokens.php:2929
*/
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 );
$container_id = apply_filters( 'automator_woocommerce_order_summary_container_id', 'automator-order-summary-' . $order->get_id(), $order );