get only todays orders on order history page

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #19745
    Olly
    Admin & Mod

      if you only want to get todays orders on admin order history page, something like this might work for you

      wppizza v2.x only , for v3 see here http://docs.wp-pizza.com/developers/?section=get-only-todays-orders-on-order-history-page

      
      add_filter('wppizza_filter_orderhistory_ordersquery', 'myprefix_admin_orderhistory_query_filter');
      function myprefix_admin_orderhistory_query_filter($query){
      $today = date('Y-m-d',current_time('timestamp'));
      $today_start = $today.' 00:00:00';
      $today_end = $today.' 23:59:59';
      /* edit/alter the query adding condition after where*/
      $query = str_ireplace('WHERE', 'WHERE order_date>="'.$today_start.'" AND order_date<="'.$today_end.'" AND ');
      return $query;
      }
      
    Viewing 1 post (of 1 total)
    • The topic ‘get only todays orders on order history page’ is closed to new replies.