I added code in theme functions.php to restrict only login

Hi
I added code in theme functions.php
to restrict only login author view his own products/orders
if ( !current_user_can( 'level_10' ) ) {
global $current_user;
$wp_query->set( 'author', $current_user->id );

Each shoppers receiving messages "No Orders Yet" for multisite
after completing confirm page also it shows
no orders yet but in super admin panel all orders displaying properly