Pip Posted June 8, 2020 Share Posted June 8, 2020 Hi Everyone! Need some guidance here. I usually think of workflows but I'm kinda stuck where to go, what to search. I am working on a website where vendors may create a posting (listing). When they click on say "Create" button, they go to a Terms of Use page where they have to agree. Once completed, they are redirected to a page where they can fill in the details. Details such as city where they are located becomes the parent of the page. Kindly note: User is not a super admin. Any leads is totally appreciated! Thanks. Link to comment Share on other sites More sharing options...
kongondo Posted June 8, 2020 Share Posted June 8, 2020 32 minutes ago, Pip said: Any leads is totally appreciated! Well, depends. Backend (PHP) or frontend (mainly JavaScript)? Link to comment Share on other sites More sharing options...
Pip Posted June 8, 2020 Author Share Posted June 8, 2020 2 minutes ago, kongondo said: Well, depends. Backend (PHP) or frontend (mainly JavaScript)? @kongondo I'd go PHP. Controlled and stuff. Thing is I really do not want the user to go in to the back end. Link to comment Share on other sites More sharing options...
kongondo Posted June 8, 2020 Share Posted June 8, 2020 In that case you'll need to be able to track the user. Sessions work best for this (I think, better than cookies). From your description, it seems these are registered users. An example workflow: Vendor logs in. Verify, validate, etc that they are a vendor. If YES, create a session for them Then, use $session->redirect(/url/to/terms/of/usage/user1234) to redirect them to the TOCs. If they are not a vendor, $session->(/redirect/elsewhere/). Vendor completes the form. JS validation just to tell them if they forgot something Vendor agrees and POSTs form Form is posted to a page you have set up Inside the template file of that page, sanitize and validate form inputs If Errors, return back to the form No errors, $session->redirect(/fill-in-details/user1234) Vendor completes the form. JS validation to help them with stuff they might have forgotten to do Vendor POSTs form Form is posted to a page you have set up to receive completed details Sanitize and validate form Errors, redirect back to form No errors, use API to create a page for the vendor Errors creating page, tell vendor to try again (?) No errors, redirect vendor to some thank you page or wherever you want Use ProcessWire's CSRF for the forms. I might have skipped something. Link to comment Share on other sites More sharing options...
huseyin Posted June 8, 2020 Share Posted June 8, 2020 1 hour ago, Pip said: Hi Everyone! Need some guidance here. I usually think of workflows but I'm kinda stuck where to go, what to search. I am working on a website where vendors may create a posting (listing). When they click on say "Create" button, they go to a Terms of Use page where they have to agree. Once completed, they are redirected to a page where they can fill in the details. Details such as city where they are located becomes the parent of the page. Kindly note: User is not a super admin. Any leads is totally appreciated! Thanks. There is not much information. You say "I am working on a website". At which state are you? What is your experiance with Processwire? You may get more targetted answers if you ask steps for only a part of your project instead of the whole.. Link to comment Share on other sites More sharing options...
kongondo Posted June 8, 2020 Share Posted June 8, 2020 (edited) 44 minutes ago, huseyin said: What is your experiance with Processwire? ? . I am not suggesting that you should have been privy to that information, by the way. Edited June 8, 2020 by kongondo Link to comment Share on other sites More sharing options...
Pip Posted June 8, 2020 Author Share Posted June 8, 2020 3 hours ago, kongondo said: In that case you'll need to be able to track the user. Sessions work best for this (I think, better than cookies). From your description, it seems these are registered users. An example workflow: Vendor logs in. Verify, validate, etc that they are a vendor. If YES, create a session for them Then, use $session->redirect(/url/to/terms/of/usage/user1234) to redirect them to the TOCs. If they are not a vendor, $session->(/redirect/elsewhere/). Vendor completes the form. JS validation just to tell them if they forgot something Vendor agrees and POSTs form Form is posted to a page you have set up Inside the template file of that page, sanitize and validate form inputs If Errors, return back to the form No errors, $session->redirect(/fill-in-details/user1234) Vendor completes the form. JS validation to help them with stuff they might have forgotten to do Vendor POSTs form Form is posted to a page you have set up to receive completed details Sanitize and validate form Errors, redirect back to form No errors, use API to create a page for the vendor Errors creating page, tell vendor to try again (?) No errors, redirect vendor to some thank you page or wherever you want Use ProcessWire's CSRF for the forms. I might have skipped something. Thanks @kongondo! So that means I have to do a module to it? Still figuring out where to use API, Module etc. Will check out the CSRF for the forms. Link to comment Share on other sites More sharing options...
kongondo Posted June 8, 2020 Share Posted June 8, 2020 56 minutes ago, Pip said: So that means I have to do a module to it? Not really. It depends on the user (both admin and vendors) experience you want. What sort of information do you want vendors to see in the frontend? If it is simple, then you could get a way with a single page, one per vendor. On admin side, how do you want to manage vendors? Like normal pages? Do you have a mockup (GUI) we could look at? Link to comment Share on other sites More sharing options...
Pip Posted June 22, 2020 Author Share Posted June 22, 2020 Sorry for the long hiatus. I've gotten into an emergency and now some technical issues. Thanks for the responses will get back on this. Thanks for all your responses @kongondo @huseyin Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now