We have a pretty specific situation and I wonder anyone already make something similar. On Woocommerce order we generate user in WP with order mail. Then our agents need to change their password manually because this password is like a PIN code to their content. We ship these PIN numbers by classic mail in an envelope. The problem is that agents need to manually go from order dashboard to Users – find the right user and change their password. Is there any way to make an input field
on the order dashboard to set a password for the user linked to this order?
Question posted in Woocommerce
The official Woocommerce documentation can be found here.
The official Woocommerce documentation can be found here.
3
Answers
This will help you to add a new column in the order list table – that contains the link to edit user of the corresponding customer.
Here is a complete solution that will add in admin orders list a custom column with a button (in each row) allowing editing the user password via Ajax.
Then when shop manager will click on the button of the desired order, an input text field will appear where the new password can be updated via Ajax.
A message will be shortly displayed showing if this update has succeeded or not.
So here is the complete code:
Code goes in functions.php file of the active child theme (or active theme). Tested and works.
Here is another similar way but this time on Admin single edit order pages with a custom Metabox on right side, using Ajax to update the customer password.
A message will be shortly displayed showing if this password update has succeeded or not disallowing empty password submissions or whitespaces in the password.
Here is the code:
Code goes in functions.php file of the active child theme (or active theme). Tested and works.