daily pastebin goal
48%
SHARE
TWEET

limit bookings to 1 ticket only

eventsmanager Jun 26th, 2015 320 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function my_em_booking_ticket($result,$EM_Booking){
  2.        
  3.   $ticket_count = 0;
  4.  
  5.   foreach($EM_Booking->tickets_bookings as $EM_Ticket_Booking){
  6.         $ticket_count++;
  7.   }
  8.  
  9.   if ( $ticket_count > 1 ){
  10.         $EM_Booking->add_error('Only one ticket is allowed per booking');
  11.         $result = false;
  12.   }
  13.        
  14.   return $result;
  15. }
  16. add_filter('em_booking_validate','my_em_booking_ticket',100,2);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top