• Resolved szelu77

    (@szelu77)


    In WooCommerce admin order list I want to change row background colour if order has specific shipment method. So far I’ve got:

    
    add_action('admin_head', 'styling_admin_order_list' );
    
    function styling_admin_order_list() {
    
        global $pagenow, $post;
    
        if( $pagenow != 'edit.php') return; // Exit
        if( get_post_type($post->ID) != 'shop_order' ) return; // Exit
    
        // HERE I try to check order's shipping method
        $order_shipping_method = 'Royal Mail 24'; 
    
        <style>
            .status-wc-processing {
                background: #d7f8a7;
                color: #0c942b;
            }
        </style>
        <?php
    }

    Unfortunately it colours every second row, not only row order which meets shipment method condition. Any help would be most appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order list page – conditional row background colour’ is closed to new replies.