diff --git a/inc/mep_functions.php b/inc/mep_functions.php index 630a0db..2662c71 100755 --- a/inc/mep_functions.php +++ b/inc/mep_functions.php @@ -554,22 +554,31 @@ function ttttt(){ } if(is_array($user_info_arr) & sizeof($user_info_arr) > 0){ foreach ($user_info_arr as $_user_info) { - if($check_before_create == 0){ - mep_attendee_create('user_form',$order_id,$event_id,$_user_info); - }else{ - mep_delete_attandee_of_an_order($order_id,$event_id); - mep_attendee_create('user_form',$order_id,$event_id,$_user_info); - } + + mep_attendee_create('user_form',$order_id,$event_id,$_user_info); + + // if($check_before_create == 0){ + // mep_attendee_create('user_form',$order_id,$event_id,$_user_info); + // }else{ + // mep_delete_attandee_of_an_order($order_id,$event_id); + // mep_attendee_create('user_form',$order_id,$event_id,$_user_info); + // } + } }else{ foreach($event_ticket_info_arr as $tinfo){ for ($x = 1; $x <= $tinfo['ticket_qty']; $x++) { - if($check_before_create == 0){ - mep_attendee_create('billing',$order_id,$event_id,$tinfo); - }else{ - mep_delete_attandee_of_an_order($order_id,$event_id); - mep_attendee_create('billing',$order_id,$event_id,$tinfo); - } + + mep_attendee_create('billing',$order_id,$event_id,$tinfo); + + // if($check_before_create == 0){ + // mep_attendee_create('billing',$order_id,$event_id,$tinfo); + // }else{ + // mep_delete_attandee_of_an_order($order_id,$event_id); + // mep_attendee_create('billing',$order_id,$event_id,$tinfo); + // } + + } } } @@ -595,22 +604,30 @@ function ttttt(){ } if(is_array($user_info_arr) & sizeof($user_info_arr) > 0){ foreach ($user_info_arr as $_user_info) { - if($check_before_create == 0){ + mep_attendee_create('user_form',$order_id,$event_id,$_user_info); - }else{ - mep_delete_attandee_of_an_order($order_id,$event_id); - mep_attendee_create('user_form',$order_id,$event_id,$_user_info); - } + + // if($check_before_create == 0){ + // mep_attendee_create('user_form',$order_id,$event_id,$_user_info); + // }else{ + // mep_delete_attandee_of_an_order($order_id,$event_id); + // mep_attendee_create('user_form',$order_id,$event_id,$_user_info); + // } + } }else{ foreach($event_ticket_info_arr as $tinfo){ for ($x = 1; $x <= $tinfo['ticket_qty']; $x++) { - if($check_before_create == 0){ - mep_attendee_create('billing',$order_id,$event_id,$tinfo); - }else{ - mep_delete_attandee_of_an_order($order_id,$event_id); - mep_attendee_create('billing',$order_id,$event_id,$tinfo); - } + mep_attendee_create('billing',$order_id,$event_id,$tinfo); + + // if($check_before_create == 0){ + // mep_attendee_create('billing',$order_id,$event_id,$tinfo); + // }else{ + // mep_delete_attandee_of_an_order($order_id,$event_id); + // mep_attendee_create('billing',$order_id,$event_id,$tinfo); + // } + + } } } @@ -639,7 +656,12 @@ function mep_delete_attandee_of_an_order($order_id,$event_id){ 'key' => 'ea_event_id', 'value' => $event_id, 'compare' => '=' - ) + ), + array( + 'key' => 'ea_order_status', + 'value' => 'pending', + 'compare' => '=' + ) ) ); $loop = new WP_Query($args);