order history

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #46792
    MARCO
    Participant

      Hi currently in my file (function.php) I used this:
      /**
      * rende visibile amministratore ordine solo ordini da ieri a oggi
      */
      add_filter(‘wppizza_filter_orders_query’, ‘myprefix_admin_orderhistory_query_filter’);
      function myprefix_admin_orderhistory_query_filter($query){

      $today = date(‘Y-m-d’,current_time(‘timestamp’));
      $yesterday_start = date(‘Y-m-d’,strtotime(“-0 days”));
      $today_end = $today.’ 23:59:59′;

      /* edit/alter the query where clause */
      $query = str_ireplace(‘WHERE’, ‘WHERE order_date>=”‘.$yesterday_start.'” AND order_date<=”‘.$today_end.'” AND ‘, $query);

      return $query;
      }
      to make my collaborators view only the orders of the last 24 hours (use contributor user to not give access to the administrative panel to my employees), unfortunately I had not noticed that this prevented my clients from seeing the historian.
      How can I show my clients the complete history, while keeping only the last 24 hours for my employees?
      Thank you
      Good day
      Marco

      #46793
      Olly
      Admin & Mod

        i would guess just wrapping your query into an additional role check would do what you need
        see here for example
        https://wordpress.stackexchange.com/questions/5047/how-to-check-if-a-user-is-in-a-specific-role

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The topic ‘order history’ is closed to new replies.