So here’s the way I would approach this.
- I’d create a custom page in WP called something like ‘Employee Order Screen’ or ‘Company Name Order Manager’. Something like that. Let the users/employees feel like it’s custom or proprietary.
- Then you want to create a template in either your theme/child theme or in a custom plugin (preferred), lets name the file
template-order-manager.php
. - Now we have to make sure that ONLY employees can see the file, so you could use one of the lower WP user roles, subscriber (although that may be for customers as well, so maybe not an option) or use ‘contributor’ or ‘author’ user levels. If employees HAVE their own WP accounts already and you’re just looking to give them a better UI, then use whatever role they have already or create an option in your plugin that allows you to grant permission to specific user accounts and then at the start of the plugin run a check to make sure the the user is logged in and that their user account is one of the one’s permitted. (A lot of this varies very heavily based on how the organization is currently operating and allowing employees access to the site. I know one org that just has a single ’employee’ account and all the employees share it. I know, I know…) Basically, first thing you do in this new template is ensure that ONLY those who access it, can access it. Everyone else get’s bounced.
- The next step is to pull in the Order data – you’d have to use a WP_Query and set whatever arguments and parameters you need to bring in the correct Orders (which I assume is a custom post_type.)
- Once you have the orders you want displayed via the Query, you would then code up the new interface to display the list of orders however you wanted them to be displayed.
- Now you have to decide if, when editing an order, you want it displayed on this same screen or if you want it to open a different template when an employee interacts with the order. If it’s a new screen/page, then replicate the steps for adding a page and template above. I’d personally probably do this all on a single screen and dynamically load the editable order beside the list of orders. Keep everyone in the same place.
- Finally, you could use AJAX at this point to allow the orders to be edited without page reloads.
Like I said, there’s a lot of different ways to do this and at multiple points you’ll make decisions based on what works best for the organization/company in question. For example, I would prefer to keep the order list and the order edit screen on the same page, but then what if the employees will predominantly be using smaller tablets to edit the orders as they walk around a warehouse, then perhaps different screens would be better.
Hope this helps.