I am using User Role Editor and trying to hide this stripe gateway for specific user
What should I check in settings of user editor role so that I can see orders but not the stripe.
It appears that the "Stripe Gateway" plugin you're using doesn't offer the ability to selectively allow or deny use by role. Testing a few of these today, I haven't found one that does. So the (great) User Role Editor plugin may not be able to help you accomplish this task. But don't despair! There are other ways :-)
If I understand correctly, you want to hide the Stripe settings from one ore more roles/users (so the live API keys are secure), right? It's easiest to remove it from a role.
Actually, there are two steps involved. One is to hide the "Stripe Gateway" menu that you mention, naturally, but Stripe settings are also found under the WooCommerce Payment tab. We would need need to hide that tab for the user/role also.
There may be a more elegant solution but I can offer a suggestion that accomplished this task.
Hopefully that menu has now disappeared for that role in the Dashboard.
Now I couldn't find the exact Stripe plugin that you're using but illustrate with another to produce the screencap here illustrating what I've written (link to screencap). Adminimize - hiding a menu from Shop manager role
The second step is to remove the Payment tab for the WooCommerce Shop Managers role. This has been answered here. Using the code from that post, add the following to your child theme's functions.php (if you're using a child theme).
add_filter( 'woocommerce_settings_tabs_array', 'remove_woocommerce_setting_tabs', 200, 1 );
function remove_woocommerce_setting_tabs( $tabs ) {
// Declare the tabs we want to hide
$tabs_to_hide = array(
'Payments',
);
// Get the current user
$user = wp_get_current_user();
// Check if user is a shop-manager
if ( isset( $user->roles[0] ) && $user->roles[0] == 'shop_manager' ) {
// Remove the tabs we want to hide
$tabs = array_diff($tabs, $tabs_to_hide);
}
return $tabs;
}
The result is illustrated here (link to screencap). Hiding a tab in WooCommerce
I'm sure there are more experienced WooCommerce people who can provide a better answer but I hope this helps.