I want to enable or disable Shipping Methods, according to user role. I have tested various different codes and approaches, none of which have worked so far. The current code: (source: stacklink ) (Have tested the original snippet as well, without changes, accept for the user role ) Does not work for me. I tested it with ‘local_pickup’ as well,
Tag: user-roles
Redirect specific user role to specific location after WordPress login
I need to redirect the Shop manager user to the orders page i added this in functions.php but not worked add_action(‘init’, ‘edit_for_shop_manager’); function edit_for_shop_manager(){ $user = …
WooCommerce: Automatically change the user role after a certain quantity of completed orders or a minimum amount in one order
I want to change automaticly user role to Premium after 3 completed orders Spending minimum 500 cash in one order I found on internet this two code snipets : And this one to access order history: Source: Checking if customer has already bought something in WooCommerce How I can tweak them to make it work ? Thank you in advance
How to Assign a Gateway Fee in WooCommerce to Multiple User Roles?
I’ve built an online shop on WooCommerce that sells retail as well as wholesale. But credit card fees are so damn expensive. I’m happy to pay the credit card fees for my retail customers but I want to charge my resellers if they choose to pay by credit card. I managed to come up with the following code that works
How do I hide WooCommerce products with a given category based on user role
I have a client with the following issue: I need to be able to split their WooCommerce WordPress site into essentially two categories. If a user is logged in as a “Wholeseller”, only products in the “Wholesale” category get pulled from the database. However if the user is not logged in or is logged in but not a “Wholeseller”, then
Get user role by ID WordPress
I need to somehow check someone’s role with only their id. I have found the current_user_can() check. But this only works for people that are logged in. How would I check for this if that user isn’t the current user? I am using a phone order system but that uses the admin/specific account to order for other people. Answer To