Allow Users to View And Not Edit WooCommerce Orders

View Edit Woocommerce

We had an interesting request from a PublishPress user this week. They wanted to allow a WordPress user to view WooCommerce orders but not be able to edit the orders.

This is possible with the PublishPress plugins, and in this guide we'll explain how it's done.

  • Install the PublishPress Capabilities Pro plugin.
  • Install the PublishPress Permissions plugin.
  • Go to “Capabilities” then “Roles” in your WordPress admin area.
  • Click “Copy” under the “Contributor”. We're choosing this because it's a basic role with very limited permissions and is very similar to the new role we want to create.
Contrib Copy
Contrib Copy
  • Give a name to the new role. In this example, the name is “Order Viewer”.
  • Click “Create Role”.
Order Viewer
Order Viewer

Now you can set the capabilities for this new role.

  • Go to “Capabilities” in your WordPress admin menu.
  • Choose the new user role in the top-left corner.
  • Set up their capabilities, as in the screenshot below. The key boxes to check are “Edit” for Posts and “Edit” for Orders.
Edit Posts Order
Edit Posts Order

In the previous step we gave users in the role the ability to use “Edit” for Posts. If you don't want users to edit posts, here is what to do next:

  • Go to “Capabilities” then “Admin Menus” in your WordPress admin menu.
  • Choose the new user role in the top-left corner.
  • Check the box for “Posts”.
Block Posts Menu
Block Posts Menu

Now you can add a user to your new role and test what they can see. If you log in to your WordPress site as an “Order Viewer”, this screenshot below shows what the user will see. They will be able to view the order but they will not be able to edit it. If the user tries to edit the order, they will see the message, “Sorry, you are not allowed to edit this item.”

View Order Only
View Order Only

Users will be able to click on the eye icon in the center of the screenshot above. This will give them a modal window with all the details of the order.

Congratulations: you have successfully created a user role that can view but not edit orders.

Preview Order Modal
Preview Order Modal

Leave a Reply

Your email address will not be published. Required fields are marked *

Professional publishing plugins for WordPress! Get PublishPress