Order Summary Banner WordPress Function
What it does?
-
Shows only on Orders screens – Detects both classic and HPOS-style order lists and displays a compact summary banner at the top.
-
Uses a rolling 16:00 → 16:00 window – If it’s before 16:00, reports from yesterday 16:00 to today 16:00; otherwise from today 16:00 to tomorrow 16:00.
-
Aggregates key statuses – Counts items from orders in Processing, Completed, and On-Hold.
-
Robust querying – Attempts a modern date-range query; if unsupported, falls back to timestamp filters, then to a direct database query as a final safety net.
-
Clear, scannable UI – Displays the window, total items, and a grid of products (thumbnail, truncated title, SKU, quantity), sorted by quantity desc.
-
Light styling included – Injects minimal CSS to keep the summary neat and readable.
Why it’s useful?
-
Faster pick/pack planning – See exactly what moved in the current operational window without running reports.
-
At-a-glance bestsellers – Spot high-volume items quickly and prioritize restock or packing.
-
Aligned to warehouse cutoffs – The 16:00 boundary mirrors real-world shipping/fulfillment schedules.
-
Works across setups – Resilient to different WooCommerce versions and HPOS configurations thanks to layered fallbacks.
