Should we use two/one account system on a website with ecommerce

Viewed 26

As a freelancer, I used opencart for my clients, one table called users, another table called customers.

I tried wordpress + woocommerce, that's only one user system. I haven't really used this, just test.

If we use only one user system, I have a question. What/how account should the employee/staff use? Use the private email, like peter@gmail.com? This maybe not easy to manage. Any characters could be the email. like haha123@gmail.com. then we don't know who is who.

Or create a company's account like peter@nike.com, force the staff to use the real name.

But when a staff have two accounts, he login as staff at work time. And he buys things for himself. Then he resigned, leave the company. His work email is canceled, frozen, inactivated. Which means that he cannot access his own order records. And maybe the private order is still ongoing, haven't received, not paid yet. This caused problems.

What solution should we use?

1 Answers

WordPress is based on the Roles and Capabilities system. Users will have a role while Each role will have different capabilities assigned.

Whenever WordPress code performs an action as a logged-in user, it basically checks if the user has the capabilities to perform that action or not.

As you explained in your use case, in that case, a staff member will be assigned a role(let's call it manager) that will allow them to do some staff-related things and he can also use that account to make orders and buy things.

If he resigns then the site manager/admin will change his role as a customer and will allow him to use the website and buy things but he won't be able to staff related things, because the custom role will not have those capabilities.

And in some cases, his connection with any data that should be only assigned to staff will be removed and assigned to someone else.

In short, capabilities do all the magic here and instead of assigning multiple capabilities to each user, WordPress creates a role with a set of capabilities to make it simple, and we can assign that role to a user and change it anytime, to revoke or grant more capabilities.

Related