How to check whether any woocommerce order contains a product-ID? : I'm coding a plugin which should check whether an order contains an product-ID.
How can I check all orders if any contains the product-ID and then mark this order as finished?
I know how to check an order on thankyou-page, but the order-ID there is already given:
Thank you all and @johnnyd23 for the code below.


    foreach ( $order_summary as $order ) {
        $order = wc_get_order( $order->order_id );
        $order_id = $order->get_id();
        $order_items = get_products_for_order( $order_id );
        if ( $order->get_status() == 'processing' ) {
            foreach( $order_items as $item ) {
                if ( $item->is_featured() ) {
                    echo 'Something';
                } else {
                    echo 'Something else';
                }
            }
        }
    }

