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