admin管理员组

文章数量:1336632

I dont know where to start on something I am trying to do other than by asking the question. Please forgive my newness. Thanks in advance -

I have a REstropress WP plug in that shows some order information such as current orders and history.

Right now this page is accessible only from the WP admin section meaning employees need to be logged into the WP admin area to view orders which we dont want. I would like to instead display this information on a url outside of the WP-admin area. We would also like to spruce up the UI to make it more employee friendly which is why we are not using a WP user access restriction plug in.

The url would be on the same website domain as the WP site itself. This would be password protected. All employees would use the same password. The users would be able to edit orders but nothing else. Basically I am looking to make a remote control for the existing plug in if that makes sense?

How would I go about doing this in a realtime way?

I dont know where to start on something I am trying to do other than by asking the question. Please forgive my newness. Thanks in advance -

I have a REstropress WP plug in that shows some order information such as current orders and history.

Right now this page is accessible only from the WP admin section meaning employees need to be logged into the WP admin area to view orders which we dont want. I would like to instead display this information on a url outside of the WP-admin area. We would also like to spruce up the UI to make it more employee friendly which is why we are not using a WP user access restriction plug in.

The url would be on the same website domain as the WP site itself. This would be password protected. All employees would use the same password. The users would be able to edit orders but nothing else. Basically I am looking to make a remote control for the existing plug in if that makes sense?

How would I go about doing this in a realtime way?

Share Improve this question edited May 20, 2020 at 20:23 brett m asked May 20, 2020 at 19:49 brett mbrett m 11 bronze badge 8
  • There are a lot of different ways you can do something like this but it all depends on a lot of other details. The 'URL' where this will be displayed, is it for a different site or the same WP installation? What user level do the employees have if it's WP, and they need to have one because just making it public would allow other customers to see the page. Are you displaying this on a different URL, and what is that other site drive by? Is it a framework, basic HTML, Ruby on Rails, etc. If you can edit this question and provide as much information as possible. – Tony Djukic Commented May 20, 2020 at 20:09
  • Thanks @TonyDjukic . The url would be on the site website domain as the WP site itself. This would be password protected. The users would be able to edit orders but noting else. Basically I am looking to make a remote control for the existing plug in if that makes sense? – brett m Commented May 20, 2020 at 20:15
  • What you're looking at is a front end editor for that plugin's custom post_type then, I think. You should edit your question to include that info, also include what the plugin is as someone may already have the answer. Will all of the employees use the same password? In earnest, the best way to go about doing this would be create a user role for WP that ONLY allows the editing of this custom post type and nothing else. That way you don't have to rebuild and re-create all of the available tools that this plugin provides for editing and managing orders. – Tony Djukic Commented May 20, 2020 at 20:18
  • @TonyDjukic thank you very much again. I have edited the post to clarify further. The WP access restriction is something we looked at but want to spruce up the UI some to make it more user friendly because the plug in isnt great for that. – brett m Commented May 20, 2020 at 20:24
  • I can't write the code for you because I don't know RestoPress and simply just don't have the time to do all of it, but if you like I can post an answer explaining the process, structure and method I'd use to do this. – Tony Djukic Commented May 20, 2020 at 20:27
 |  Show 3 more comments

1 Answer 1

Reset to default 0

So here's the way I would approach this.

  1. 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.
  2. 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.
  3. 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.
  4. 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.)
  5. 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.
  6. 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.
  7. 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.

本文标签: