WPPizza – A Restaurant Plugin for WordPress › Support › General Support › order history
- AuthorPosts
- 2 March, 2020 at 8:58 am #46792
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
Marco2 March, 2020 at 1:50 pm #46793i 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 - AuthorPosts
- The topic ‘order history’ is closed to new replies.