Skip Navigation

[Resolved] Reply a custom type with messages

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 16 replies, has 2 voices.

Last updated by Jamal 4 years ago.

Assisted by: Jamal.

Author
Posts
#1892179

I want to create a form called "solicitudes" that is submitted and approved in the admin that request appears in the user area of ​​all users that have a custom type associated with a certain category.

Once they receive that request they can accept it and send a proposal / budget from the front. How can I do this?

#1893145

Hello and thank you for contacting the Toolset support.

I am sorry, but I am not sure to fully understand your request. Can you elaborate more? maybe provide a detailed example?

In the meanwhile, I would say, that you will use a One-to-many relationship. And that you will put the form for the child custom post type(solicitudes) inside the content template of the parent post type(I do not know which one). Check this article about how to automatically preselect the parent post: https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/#creating-forms-when-a-parent-post-is-preselected

Let me know more details about this use case and I'll get back to you.

#1893219

Thanks Jamal, I'll see if I can explain something better, maybe there is another way to do it.

The request form is a request for a budget. So user A asks for a budget by filling in a form for the custom type "requests" once user A has sent the form to the administrator, approves it and the user area of ​​user B appears, but user B has to accept sending a budget and answering it.

For example:

User A requests 100 yellow wooden doors

User B sees the request and if he wants, he can reply with his price.

How can we do this?

Both users A and B are registered.

#1893241

I might need some more information.

Let's take your example. I assume that "yellow wooden doors" is a post from a certain post type, right? What's this post type?
If it is true, that would be the parent of the One-to-many relationship.

I assume that User B is the author of "yellow wooden doors", right? Otherwise, why should he see the "request" from user A?
If that's the case, user B will see the requests in a nested view. First, create a view that will display posts authored by the current user. And inside of its loop, put another view that will display child requests related to the current post in the loop.

Regarding, answering a request, we'll need to handle the posts either by status, or a custom field that will hold the status. For example, when user A submits the form, the newly created request will have a status "Pending Review", but when user B replies with a price, we'll change the status to Published. This way, we'll display to each user the statuses that are relevant to him. Does it make sense?

Let me know if what I understood is correct, or if I missed something.

#1893377

Thanks Jamal,

I answer your comments.

"Let's take your example. I assume "yellow wooden doors" is a post of a certain type of post, right? "Yes, this is so.

"What is this type of publication?
If true, it would be the parent of the One-to-Many relationship." If it would be a custom type associated with many companies.

"I assume user B is the author of "yellow wooden doors", right? Otherwise why should I see User A's "request"? "
Custom-type should be shown only to companies in the categories that the administrator decides when the custom type sent by user B goes from pending to approved.

In terms of this:
"As for responding to a request, we will need to handle posts by status or by a custom field that will maintain the status. For example, when User A submits the form, the newly created request will have the status "Pending Review", but when User B responds with a price, we will change the status to Posted. In this way, we will show each user the statuses that are relevant to him. "

If so, how can user A write to that custom type? To write your answer?

THANKS!
.

#1893747

I am really sorry, but I just get more confused.

- What is the custom post type of "yellow wooden doors"?
- Are companies a custom post type?

Can you explain in steps what you would like to implement?
- I have this xxx.
- I want to have this xxx.
- User A goes here xxx.
- etc...

#1893779

Hi Jamal,

It is not currently created but it would be:

Custom type named 'solicitudes' with a form 'solicitudes-form'.

The 'solicitudes' form arrives and the administrator chooses the category where it should be displayed.

Company (its user) that have that category could see that custom type requests in their my-account.

The companies answer with their budget or their message to this personalized type.

#1894813

I still need to understand what you want to achieve in order to efficiently advise you.

In the initial post, you said I want to create a form called "solicitudes" that is submitted and approved in the admin that request appears in the user area of ​​all users that have a custom type associated with a certain category.
Then you gave the example of User A and User B. So, I am having these questions. Please answer them with as many details or concrete examples as much as possible:

- What do you mean by a company? Is it a post type that exists or will be created?
- What is the relation between companies and Users?
- What is the relation between a company and the details of the form(exp: "yellow wooden doors")?
- What do you mean by category? Category of what?

And if it is possible, Can you provide a detailed scenario step by step of the flow that you want to implement?
- User A creates the following (company, category, product, etc...)
- User B can visit the page of (company or product, etc...).
- Then he can use a form to create a solicitude with details(price, number, etc.).
- User B can see the solicitude in his dashboard(or on a page with URL /path-to-the-page ).
- User B can reply to the solicitude with the following details(price, date, etc.)
- User A can see the replied/approved solicitudes on his page (URL of the page)

I am aware that we are, currently, taking too much time. But if I understood very well your use case, I will advise you efficiently. Otherwise, I may give a piece of advice that will be obsolete or wrong once I understand something else later.

#1894885

Hi Jamal,

I will try to answer your questions:

- In the initial post, you said that I want to create a form called "requests" that is submitted and approved in the admin; that request appears in the user area of ​​all users who have a custom type associated with a certain category.
Then you gave the example of User A and User B. So, I have these questions. Answer with as much detail or concrete examples as possible:

- What does company mean? Is it a post type that exists or will it be created? Company is a type of user that can have one or more associated custom types called 'company file'
- What is the relationship between companies and users? It is a type of user that has associated 'company files'
- What is the relationship between a company and the details of the form (exp: "yellow wooden doors")? There are two types of user, companies that have company files, and the 'external' user who is the one who fills in the form to request a quote from company users. (user A)
- What do you mean by category? Category of the company (door seller, chair seller ....) Category of what?

And if possible, can you provide a detailed step-by-step scenario of the flow you want to implement?
- User A creates the following (company, category, product, etc ...) He creates his company page, and sets a category to his company page.
- User B can visit the page of (company or product, etc ...). You do not have to have an account, request a quote from a category of companies (users A) (example: door salesman)
- You can then use a form to create a request with details (price, number, etc.). Use the form to request the budget
- User B can view the request in his dashboard (or on a page with URL / path to page). Yes, if we make you create a user account, you will have the requested budgets in your control panel
- User B can respond to the request with the following details (price, date, etc.) It is user A who responds to the quotes requested by user B
- User A can see the answered / approved requests on his page (page URL) It is user B who can see the answered requests.

Thank you very much for your time Jamal.

#1895147

Thank you for your feedback. I can now advise you on how to build this based on some assumptions that are still not clear to me.

I'll assume the following:
- The solicitude can be created by a user that does not have an account(not logged in).
- The solicitude is approved by an administrator before it can be visible for "Company users".
- No need to send an email notification to all the companies in the chosen category.
- Once the solicitude becomes obsolete, the administrator can remove it or change its status, so it won't be visible anymore to "Company users".

Below how I see it:
- 3 custom post types: Company, Solicitude, and Reply.
- 1 taxonomy assigned to Companies and Solicitude.
- 1 One-to-many relationship between 1 Solicitude and multiple Replies

- 1 Form to create the solicitude.
- 1 View to display the solicitude for Company users, this view needs to be filtered by the status of the post. The administrator needs to make the solitude in a "status" to allow the companies to see it.
- 1 Form to create a Reply to a solicitude. This form may create a notification email to inform the visitor that has created the solicitude. This means that the Solicitude form needs to have an email field so the visitor can receive replies on it.

We can go further in the details of each step if you need further assistance. If you have a staging or dev server, please create the above elements and I'll help you if you get stuck on any step.

But, if you need to implement any of the following assumptions, the above sill not be completely correct:
- An email notification sent to all "Company users" when a new solicitude is created.
- The solicitude lifetime needs to be handled by the visitor or the "Company users".
- The Solicitude/Reply process may need further follow-up.

I hope this makes sense to you. Let me know if you have a question or a doubt about something.

#1901257

Thank u for your ideas

I followed all your steps to last step ('- 1 Form to create a Reply to a solicitude. This form may create a notification email to inform the visitor that has created the solicitude. This means that the Solicitude form needs to have an email field so the visitor can receive replies on it.')

How i can create a reply to solicitude?
Should i create a new post form?

Thank u

#1902097

How i can create a reply to solicitude?
Because we have a one-to-many relationship between solitudes and replies. The new reply post needs to be connected(as a child) to the solicitude post(parent).

Should i create a new post form?
Yes. Create a post form that will create a new "Reply" post. Check this article on how to automatically preselect the parent post: https://toolset.com/forums/topic/preset-parent-relationship-of-child-form-inside-parents-view/

If you need to send the notification to the user that created the solicitude, check this previous ticket https://toolset.com/forums/topic/send-notification-to-recipient-email-defined-in-parent-post-custom-field/

#1902331

Okay, i read two topics and i don't understand how i can add a new form.

I created a new form post but i dont know what i have to add on it.
I dont know how to automatically preselect parent post.

#1902849

Oh sorry! The link that I wanted to share instead of https://toolset.com/forums/topic/preset-parent-relationship-of-child-form-inside-parents-view/
Is https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/#creating-forms-when-a-parent-post-is-preselected

This article will explain how to automatically preselect the parent post "solicitude" in the "Reply" post form.

My apologies for the confusion.

#1905553

Don't worry about that.
Okay, i followed all steps but i think that it is not working. . .

What have I done?

1. One Custom type called Solicitude.
2. One post form to create custom types solicitude.
3. One content template to show all info created after submit the form. ('Create Child post link' added also)
4. One custom type called Replies.
5. One post form to create custom types replies.
6. One content template to show all info created after submit the form.
7. Set up Relationship one-to-many between Replies and Solicitude. (One Solicitud can be assigned to Infinite Replies).

What happened?

When user creates a new Solicitude (with front-end post form), solicitude creates sucessfully.
Admin publishes solicitudes and then, company users can view the solicitude.
Company users fill the form (reply form) and creates the reply.

What is not working?

Replies and Solicitudes are not connected or havent relationship. When i create a new reply, i think that it doesnt detect what are his parent reply. Is there any way to show solicitude parent in reply template?

Thank you