Click here to Skip to main content
15,891,621 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to help my company make our website more effective. We currently offer classes that people can register for online and pay through Paypal. Class sizes are either 16 or 12 max. Currently, our website will continue to allow students to register for classes (submit their payments through Paypal) even if the maximum student limit has been met.

Ex: An email confirmation has been submitted to our work email that "Abby" has paid for a class. She is student #16. 10 minutes later, an email confirmation from "Joe" comes into our work email for the same class. He is student #17. We can't accept him into our class because we can only have 16 people in the class.

We use WordPress, and we have been monitoring every classes ongoing registrations, so that when they reach their max, 16 or 12, we go into WordPress and manually click on "Sold Out" so that it appears on our website -- so that people can see that the class is sold out.

Is there a way we can set up our website to automatically post the "Sold Out" sign over classes when their max student limit (16 or 12) is met?

Thanks so much!!

Sarah
Posted
Comments
Maciej Los 25-Sep-13 15:56pm    
I think a have seen this question in a past...
Please, use SearchBox.
Abhinav Gauniyal 25-Sep-13 16:26pm    
If you have to do this once only , you can do this manually too :)

1 solution

Add a new option to the database using add_option( 'max_class_size', 12 );

Then, edit your code and get the number of already registered users, the same way the emails get the no, and do something like

PHP
if ( $no_of_users >= get_option( 'max_class_size' ) ){
//Tell the user we are sold out
}
else
{
//Procedure to register user.
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900