Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * if ( $EM_Booking->booking_spaces > 2){ echo "Max of 2 ticket spacess is allowed"; }
- */
- function my_em_booking_ticket($result,$EM_Booking){
- $ticket_count = 0;
- foreach($EM_Booking->tickets_bookings as $EM_Ticket_Booking){
- $ticket_count++;
- }
- if ( $ticket_count > 1 ){
- $EM_Booking->add_error('Only one ticket is allowed per booking');
- $result = false;
- }
- return $result;
- }
- add_filter('em_booking_validate','my_em_booking_ticket',100,2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement