Skip Navigation

[Resolved] limit cred submissions

This support ticket is created 2 years, 10 months 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by pedro.S 2 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#2052055

Hi,

I've searched the forum and found some posts to limit cred submissions but mostly are per user, which is not intended.

I have a CPT called Courses.
For each course I create i want to add a form to register pre-signups.
For this to happen (in my way of thinking) I will have to create a parent (course) and a child (student) and allow users to submit a cred form which is the pre-signup. I still don't know if only to registered users or to anyone.

1 - I believe toolset already allows me to do this easily correct?

But i want to limit the amount of cred submissions to 10 per course. So i will accept only 10 students per course.

2 - How can i achieve this with toolset?

In the view that lists the courses and when the course submissions reach 10 it should be listed with a "SOLD" badge, not allowing more signups.

If there is an easier way to do this I'm all ears!

Thank you

#2052331

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-05-11 at 2.28.36 PM.png

Hi Pedro,

Thank you for getting in touch.

1 - I believe toolset already allows me to do this easily correct?

But i want to limit the amount of cred submissions to 10 per course. So i will accept only 10 students per course.

It sounds to me that you only want the course to have only 10 students. In a case like this there is a limiter option in the relationship settings screen for you to limit the number of students/child posts the Parent can have. See Screenshot

2 - How can i achieve this with toolset?

In the view that lists the courses and when the course submissions reach 10 it should be listed with a "SOLD" badge, not allowing more signups.

This one will require a bit of custom code to achieve. You will essentially need to count the child posts and display the Sold Badge if the count is equal to 10. Here is a previous forum thread that should be able to help you on this one.
https://toolset.com/forums/topic/child-posts-count/#post-1228347

Thanks,
Shane

#2052949

Thank you for your time Shane.

I have only issue here which might complicate things quite a bit.
What If I want to define in each course the number of signups separatly? Some courses will have more participants than others.

I checked this post: https://toolset.com/forums/topic/limit-the-number-of-posts-that-users-can-write/

But this is only applied when user is actually filling the form.
If I insert a hidden field in the parent (course) called number of participants, using custom shortcodes i will be able to:

1 - inside a course list view (loop) check if the course number of childs created (pre-signups) is under the "limit field", if true do nothing ... else place a badge "SOLD".
2 - Inside the single course page make the signup button inactive and with different text.

Correct?

Thank you once again.

#2053481

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Pedro,

I have only issue here which might complicate things quite a bit.
What If I want to define in each course the number of signups separatly? Some courses will have more participants than others.

It will probably be doable if the user is only creating the posts through the frontend.

1 - inside a course list view (loop) check if the course number of child created (pre-signups) is under the "limit field", if true do nothing ... else place a badge "SOLD".

I can see this possible if on the course there is a custom field that will tell how many persons can register for this course then you can use the code below.
https://toolset.com/forums/topic/child-posts-count/#post-1228347

This will allow you to count the actual registered person and then compare this to it the amount set in the course.

2 - Inside the single course page make the signup button inactive and with different text.

Yes you can use our conditional to compare the values and switch between the options based on your requirements.

Please let me know if this provides some clarity for you.
Thanks,
Shane

#2053939

Thank you for your time Shane!
My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.