wc block issue
This commit is contained in:
parent
ea0a6c5db5
commit
608de5e4ee
|
@ -625,10 +625,15 @@ function mep_check_attendee_exist_before_create($order_id,$event_id){
|
|||
}
|
||||
|
||||
|
||||
add_action('woocommerce_checkout_order_processed', 'mep_event_booking_management', 10);
|
||||
add_action('woocommerce_checkout_order_processed', 'mep_event_booking_management', 90);
|
||||
add_action('__experimental_woocommerce_blocks_checkout_order_processed', 'mep_event_booking_management', 90);
|
||||
// add_action('woocommerce_blocks_checkout_order_processed', 'mep_event_booking_management', 90);
|
||||
if (!function_exists('mep_event_booking_management')) {
|
||||
function mep_event_booking_management( $order_id) {
|
||||
|
||||
$result = !is_numeric($order_id) ? json_decode($order_id) : [0];
|
||||
// $order_id = json_last_error() === JSON_ERROR_NONE ? $result->id : $order_id;
|
||||
$order_id = !is_numeric($order_id) ? $result->id : $order_id;
|
||||
|
||||
if ( ! $order_id )
|
||||
{return;}
|
||||
|
@ -637,13 +642,13 @@ function mep_check_attendee_exist_before_create($order_id,$event_id){
|
|||
$order = wc_get_order( $order_id );
|
||||
$order_meta = get_post_meta($order_id);
|
||||
$order_status = $order->get_status();
|
||||
|
||||
if($order_status != 'failed'){
|
||||
|
||||
$form_position = mep_get_option( 'mep_user_form_position', 'general_attendee_sec', 'details_page' );
|
||||
|
||||
if($form_position=='checkout_page'){
|
||||
|
||||
|
||||
|
||||
foreach ( $order->get_items() as $item_id => $item_values ) {
|
||||
$item_id = $item_id;
|
||||
}
|
||||
|
@ -664,11 +669,9 @@ function mep_check_attendee_exist_before_create($order_id,$event_id){
|
|||
}
|
||||
if(is_array($user_info_arr) & sizeof($user_info_arr) > 0){
|
||||
foreach ($user_info_arr as $_user_info) {
|
||||
|
||||
if($check_before_create < count($user_info_arr)){
|
||||
mep_attendee_create('user_form',$order_id,$event_id,$_user_info);
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
foreach($event_ticket_info_arr as $tinfo){
|
||||
|
@ -684,6 +687,7 @@ function mep_check_attendee_exist_before_create($order_id,$event_id){
|
|||
}
|
||||
|
||||
}else{
|
||||
|
||||
foreach ( $order->get_items() as $item_id => $item_values ) {
|
||||
$item_id = $item_id;
|
||||
$event_id = wc_get_order_item_meta($item_id,'event_id',true);
|
||||
|
@ -723,12 +727,10 @@ function mep_check_attendee_exist_before_create($order_id,$event_id){
|
|||
}
|
||||
}
|
||||
do_action('mep_after_event_booking',$order_id,$order->get_status());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mep_delete_attandee_of_an_order($order_id,$event_id){
|
||||
|
||||
$args = array (
|
||||
|
|
Loading…
Reference in New Issue