Hello Team,
I am creating a Directory Listing of Restaurants, and want users to claim their business, but don't know if that is possible with Toolset.
By Claiming Their Business, They Can Edit Listing Which they have claimed and it will be assigned to them as their listing.
In this Process I want them to Register and Select The Listing they want to claim and provide some basic info and submit. After we cross verify the information they provided we can approve their Claim and it will be added to them as their listing.
Thank You
Hello,
I think it is possible with Toolset plugins + some custom codes, here is my suggestion:
1) Setup two post types:
- Restaurants
- Claims(with custom field "verified")
https://toolset.com/course-lesson/creating-a-custom-post-type/
https://toolset.com/course-lesson/creating-custom-fields/
2) Setup one-to-many relationship between "Restaurants" and "Claims"
https://toolset.com/course-lesson/how-to-set-up-post-relationships-in-wordpress/
3) Create a post form for creating new "Claim" post
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/
Send an email notification to specific admin user:
https://toolset.com/course-lesson/send-notifications-when-someone-submits-the-form/
4) In the single "Restaurant" post:
a) For normal user, display above child post form link:
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/#creating-forms-when-a-parent-post-is-preselected
So user can create a "Claim" post and related it with "Restaurant" post
b) For admin user, display a post view:
- Query the "Claim" post
- Filter by:
Post type relationship between "Restaurants" and "Claims" post types.
- In views loop, display a post form for editing "Claims" post(and enable the custom field "verified")
https://toolset.com/course-lesson/front-end-forms-for-editing-content/
So admin user can enable the field "verified", after he submits this form, use action hook "cred_save_data" to trigger a PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
In this PHP function:
a) get the "Claims" post author ID + parent "Restaurants" post ID
https://developer.wordpress.org/reference/functions/get_post_field/
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post
b) change the "Restaurants" post author to the child "Claims" post author:
https://developer.wordpress.org/reference/functions/wp_update_post/
5) In the user's "My account" page, display a post view:
- query "Restaurants" posts
- Filter by post author is same as current logged-in user:
https://toolset.com/documentation/user-guides/views/filtering-views-query-by-author/
- In view's loop, display the editing "Restaurants" post form link
For your reference.
Hello Luo,
That's great to hear that it's possible but instead of custom code can we use Zapier or Uncanny Automator or Integratly.
The custom codes I mentioned above can be setup not too much difficultly, you can create new ticket when you need assistance for it.
For the "Zapier or Uncanny Automator or Integratly" issue, it is out the range of Toolset support, I am not sure if they can do the same task, but it will involve other unexpected compatibility problems.
My issue is resolved now. Thank you!