# Today's Orders Dashboard Widget

> Shows how many WooCommerce orders came in today and their total, with the latest orders listed below.

- Type: PHP
- Runs: Admin only
- Category: [Dashboard](https://wpide.com/library/category/dashboard/)
- Requires: WooCommerce
- Tags: dashboard, widget, woocommerce
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-todays-orders-widget/

## Code

```php
add_action( 'wp_dashboard_setup', function () {
    if ( ! function_exists( 'wc_get_orders' ) || ! current_user_can( 'edit_shop_orders' ) ) {
        return;
    }

    wp_add_dashboard_widget( 'wpide_woo_today', 'Today\'s Orders', function () {
        $start  = wp_date( 'Y-m-d' ) . ' 00:00:00';
        $orders = wc_get_orders( array(
            'limit'        => 50,
            'status'       => array( 'wc-processing', 'wc-completed', 'wc-on-hold' ),
            'date_created' => '>=' . strtotime( get_gmt_from_date( $start ) ),
            'orderby'      => 'date',
            'order'        => 'DESC',
        ) );

        $total = 0;
        foreach ( $orders as $order ) {
            $total += (float) $order->get_total();
        }

        printf( '<p style="font-size:16px"><strong>%1$d</strong> orders &middot; <strong>%2$s</strong></p>', count( $orders ), wp_kses_post( wc_price( $total ) ) );

        if ( ! $orders ) {
            return;
        }

        echo '<ul>';
        foreach ( array_slice( $orders, 0, 5 ) as $order ) {
            printf(
                '<li><a href="%1$s">#%2$s</a> %3$s &middot; %4$s</li>',
                esc_url( $order->get_edit_order_url() ),
                esc_html( $order->get_order_number() ),
                esc_html( $order->get_formatted_billing_full_name() ),
                wp_kses_post( $order->get_formatted_order_total() )
            );
        }
        echo '</ul>';
    } );
} );
```

## Notes

The total sums the shown statuses in the store currency and counts up to 50 orders.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Today's Orders Dashboard Widget" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
