From 41db5d7601e173d8e44e43926a1303c67b47940e Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Thu, 29 Nov 2018 07:08:43 +0000 Subject: [PATCH] version 2.2.0 released with some bug fix and a new feature --- inc/mep_event_meta.php | 29 +++++++++++++++++-- readme.txt | 5 +++- templates/template-prts/event_add_cart.php | 3 +- templates/template-prts/event_ticket_type.php | 11 +++++-- templates/template-prts/total_seat.php | 27 ++++++++--------- woocommerce-event-press.php | 2 +- 6 files changed, 52 insertions(+), 25 deletions(-) diff --git a/inc/mep_event_meta.php b/inc/mep_event_meta.php index 6f47916..ae624df 100644 --- a/inc/mep_event_meta.php +++ b/inc/mep_event_meta.php @@ -24,6 +24,8 @@ function mep_event_meta_box_add(){ add_meta_box( 'mep-event-reg-on-off', 'Registration Status', 'mep_event_change_reg_status_cb', 'mep_events', 'side', 'low' ); + add_meta_box( 'mep-event-available-set-on-off', 'Show Available Seat Count?', 'mep_event_available_seat_cb', 'mep_events', 'side', 'low' ); + } function mep_event_change_reg_status_cb($post){ @@ -40,20 +42,41 @@ function mep_event_change_reg_status_cb($post){ ID ); +?> +
+ +
+ ID; $count=1; +if(array_key_exists('mep_available_seat', $event_meta)){ + $mep_available_seat = $event_meta['mep_available_seat'][0]; +}else{ + $mep_available_seat = 'on'; +} $mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true); if($mep_event_ticket_type){ @@ -20,12 +25,12 @@ foreach ( $mep_event_ticket_type as $field ) { $qm = $field['option_name_t']; $tesqn = $pid.str_replace(' ', '', $qm); $tesq = get_post_meta($pid,"mep_xtra_$tesqn",true); -$llft = ($field['option_qty_t'] - $tesq); +$llft = ($field['option_qty_t'] - (int)$tesq); $qty_t_type = $field['option_qty_t_type']; ?> -
+
diff --git a/templates/template-prts/total_seat.php b/templates/template-prts/total_seat.php index 7c992b4..2746bce 100644 --- a/templates/template-prts/total_seat.php +++ b/templates/template-prts/total_seat.php @@ -7,6 +7,12 @@ function mep_ev_seat(){ $mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true); // echo "Hello"; // print_r($mep_event_ticket_type); +if(array_key_exists('mep_available_seat', $event_meta)){ + $mep_available_seat = $event_meta['mep_available_seat'][0]; +}else{ + $mep_available_seat = 'on'; +} + if($mep_event_ticket_type){ $stc = 0; @@ -22,28 +28,19 @@ $tesq = get_post_meta($post->ID,"mep_xtra_$tesqn",true); $stc = $stc+$field['option_qty_t']; -$llft = ($field['option_qty_t'] - $tesq); +$llft = ($field['option_qty_t'] - (int)$tesq); $leftt = $leftt+$llft; } + + ?> -
( Left)
+
( Left)
-
( Left)
+
( Left)