Skip Navigation

[Resolved] Save data in a Custom Post Type after an action in the front-end

This support ticket is created 4 years, 8 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 1 reply, has 2 voices.

Last updated by Shane 4 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#1545651

Situation:
I have a CPT "Workshops", with a custom field "Available seats".
So when someone enters this page, he'll see for example "Workshop A, available seats = 10"

What I want to accomplish:
After a visitor clicked a button "JOIN", the number of seats should decrease by 1, so that the next visitor will see "Workshop A, available seats = 9"

My question:
Is it possible to save "(current value - 1)" to the field "Available seats" of "Workshop A", after a button has been clicked?
Can I achieve this with Toolset?

Thank you!

#1545827

Shane
Supporter

Languages: English (English )

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

Hi Peter,

Thank you for getting in touch.

You can do this with toolset by using our Hooks to decrease the value but it would need to be done manually.

For e.g you have a Form that only has the button Join on it.

When the user hits Join it will submit the form and in the Hook you will modify the custom field value.

I do recommend using a better solution like Woocommerce that will handle the quantity better because once you click on the Join/Add to Cart button then the quantity will automatically decrease and you will have some record of which user got the seat.

Thanks,
Shane