diff --git a/css/style.css b/css/style.css index 29f4aea..c59cc56 100644 --- a/css/style.css +++ b/css/style.css @@ -1479,6 +1479,16 @@ h4.mep-cart-table-title { padding: 0 0 0 25px; } +p#mep_btn_notice { + text-align: center; + width: 300px; + float: none; + margin: 0; +} + + + + /* Responsive CSS =====================================================================*/ @media only screen and (min-width: 768px) and (max-width: 990px) { diff --git a/inc/mep_event_meta.php b/inc/mep_event_meta.php index 8c21f3b..928c9f0 100644 --- a/inc/mep_event_meta.php +++ b/inc/mep_event_meta.php @@ -7,10 +7,10 @@ function mep_event_meta_box_add(){ add_meta_box( 'mep-event-price', __('Event Price (Event Base price, It will not work if you add Event Ticket type Price)','mage-eventpress'), 'mep_event_price_meta_box_cb', 'mep_events', 'normal', 'high' ); - add_meta_box( 'mep-event-extra-price', __('Event Extra Service (Extra Service as Product that you can sell and it is not included on event package)','mage-eventpress'), 'mep_event_extra_price_option', 'mep_events', 'normal', 'high' ); - add_meta_box( 'mep-event-ticket-type', __('Event Ticket Type and Pricing','mage-eventpress'), 'mep_event_ticket_type', 'mep_events', 'normal', 'high' ); + add_meta_box( 'mep-event-extra-price', __('Event Extra Service (Extra Service as Product that you can sell and it is not included on event package)','mage-eventpress'), 'mep_event_extra_price_option', 'mep_events', 'normal', 'high' ); + add_meta_box( 'mep-event-date', __('Event Date & Time','mage-eventpress'), 'mep_event_date_meta_box_cb', 'mep_events', 'normal', 'high' ); add_meta_box( 'mep-event-emails', __('Event Email text','mage-eventpress'), 'mep_event_email_meta_box_cb', 'mep_events', 'normal', 'high' ); @@ -111,16 +111,7 @@ if(array_key_exists('_tax_class', $values)){ $tx_class = $values['_tax_class'][0 diff --git a/inc/mep_extra_price.php b/inc/mep_extra_price.php index b1e24b6..f8dca91 100644 --- a/inc/mep_extra_price.php +++ b/inc/mep_extra_price.php @@ -1,6 +1,6 @@ $val) { + if ($val['option_name'] === $extra_service['option_name']) { + if($val['option_qty'] > 0){ + $event_extra[$us]['service_name'] = stripslashes( strip_tags($val['option_name']) ); + + $event_extra[$us]['service_qty'] = stripslashes(strip_tags($val['option_qty'])); + $event_extra[$us]['service_price'] = stripslashes(strip_tags($val['option_price'])); + } + }else{ + $event_extra = array(); + } + } + + $us++; +} + - $cart_item_data['event_ticket_info'] = $ticket_type_arr; - - - + $cart_item_data['event_ticket_info'] = $ticket_type_arr; $cart_item_data['event_extra_option'] = $new; $cart_item_data['event_user_info'] = $user; $cart_item_data['event_tp'] = $tp; $cart_item_data['line_total'] = $tp; $cart_item_data['line_subtotal'] = $tp; - $cart_item_data['event_id'] = $product_id; + $cart_item_data['event_cart_location'] = $event_cart_location; $cart_item_data['event_cart_date'] = $event_cart_date; - - +} + $cart_item_data['event_id'] = $product_id; return $cart_item_data; } diff --git a/inc/mep_upgrade.php b/inc/mep_upgrade.php new file mode 100644 index 0000000..507f771 --- /dev/null +++ b/inc/mep_upgrade.php @@ -0,0 +1,154 @@ + 'mep_events_attendees', + 'posts_per_page' => -1, + + 'meta_query' => array( + + + array( + 'key' => 'ea_event_id', + 'value' => $event_id, + 'compare' => '=' + ), + array( + 'key' => 'ea_order_id', + 'value' => $order_id, + 'compare' => '=' + ), + array( + 'key' => 'ea_ticket_type', + 'value' => $type, + 'compare' => '=' + ), + array( + 'key' => 'ea_name', + 'value' => $name, + 'compare' => '=' + ), + array( + 'key' => 'ea_email', + 'value' => $email, + 'compare' => '=' + ), + array( + 'key' => 'ea_phone', + 'value' => $phone, + 'compare' => '=' + ) + ) + ); + + + $loop = new WP_Query($args); + return $loop->post_count; +} + + + +add_action('admin_init','mep_get_all_order_data_and_create_attendee'); + +function mep_get_all_order_data_and_create_attendee(){ + +if ( get_option( 'mep_event_magor_update_3' ) != 'completed' ) { + +global $wpdb; +$args = array( + 'limit' => -1, + 'return' => 'ids', +); +$query = new WC_Order_Query( $args ); +$orders = $query->get_orders(); +$c = 1; + +foreach($orders as $order_id){ + $order = wc_get_order( $order_id ); + $order_meta = get_post_meta($order_id); + + foreach ( $order->get_items() as $item_id => $item_values ) { + $item_id = $item_id; + } + + $event_info = maybe_unserialize(mep_event_get_order_meta($item_id,'_event_user_info')); + + $event_id = mep_event_get_order_meta($item_id,'event_id') ? mep_event_get_order_meta($item_id,'event_id') : 0; + + if(is_array($event_info) && sizeof($event_info) > 0 && $event_id > 0){ + // echo '
'; + // print_r(array_merge($event_info,$event_id)); + + foreach($event_info as $_event_info){ + + $user_name = isset($_event_info['user_name']) ? $_event_info['user_name'] : ''; + $user_email = isset($_event_info['user_email']) ? $_event_info['user_email'] : ''; + $user_phone = isset($_event_info['user_phone']) ? $_event_info['user_phone'] : ''; + $user_address = isset($_event_info['user_address']) ? $_event_info['user_address'] : ''; + $user_gender = isset($_event_info['user_gender']) ? $_event_info['user_gender'] : ''; + $user_tshirtsize = isset($_event_info['user_tshirtsize']) ? $_event_info['user_tshirtsize'] : ''; + $user_company = isset($_event_info['user_company']) ? $_event_info['user_company'] : ''; + + $user_designation = isset($_event_info['user_designation']) ? $_event_info['user_designation'] : ''; + + $user_website = isset($_event_info['user_website']) ? $_event_info['user_website'] : ''; + $user_vegetarian = isset($_event_info['user_vegetarian']) ? $_event_info['user_vegetarian'] : ''; + $user_ticket_type = isset($_event_info['user_ticket_type']) ? $_event_info['user_ticket_type'] : ''; + + + $check = mep_check_attendee_exists($event_id,$order_id,$user_name,$user_email,$user_phone,$user_address,$user_gender,$user_company,$user_designation,$user_website,$user_vegetarian,$user_tshirtsize,$user_ticket_type); + + if($check == 0){ + + $first_name = isset($order_meta['_billing_first_name'][0]) ? $order_meta['_billing_first_name'][0] : ''; + $last_name = isset($order_meta['_billing_last_name'][0]) ? $order_meta['_billing_last_name'][0] : ''; + $uname = $first_name.' '.$last_name; + $payment_method = isset($order_meta['_payment_method_title'][0]) ? $order_meta['_payment_method_title'][0] : array(); + $user_id = isset($order_meta['_customer_user'][0]) ? $order_meta['_customer_user'][0] : array(); + $event_name = get_the_title($event_id); + $order_status = $order->get_status(); + + $new_post = array( + 'post_title' => $uname, + 'post_content' => '', + 'post_category' => array(), // Usable for custom taxonomies too + 'tags_input' => array(), + 'post_status' => 'publish', // Choose: publish, preview, future, draft, etc. + 'post_type' => 'mep_events_attendees' //'post',page' or use a custom post type if you want to + ); + + //SAVE THE POST + $pid = wp_insert_post($new_post); + $pin = $user_id.$order_id.$event_id.$pid; + update_post_meta( $pid, 'ea_name', $user_name); + update_post_meta( $pid, 'ea_address_1', $user_address); + update_post_meta( $pid, 'ea_email', $user_email); + update_post_meta( $pid, 'ea_phone', $user_phone); + update_post_meta( $pid, 'ea_gender', $user_gender); + update_post_meta( $pid, 'ea_company', $user_company); + update_post_meta( $pid, 'ea_desg', $user_designation); + update_post_meta( $pid, 'ea_website', $user_website); + update_post_meta( $pid, 'ea_vegetarian', $user_vegetarian); + update_post_meta( $pid, 'ea_tshirtsize', $user_tshirtsize); + update_post_meta( $pid, 'ea_ticket_type', $user_ticket_type); + update_post_meta( $pid, 'ea_payment_method', $payment_method); + update_post_meta( $pid, 'ea_event_name', $event_name); + update_post_meta( $pid, 'ea_event_id', $event_id); + update_post_meta( $pid, 'ea_order_id', $order_id); + update_post_meta( $pid, 'ea_user_id', $user_id); + update_post_meta( $pid, 'ea_ticket_no', $pin); + update_post_meta( $pid, 'ea_order_status', $order_status); + + } + + } + + } + +} +update_option( 'mep_event_magor_update_3', 'completed' ); +} + + +// die(); +} \ No newline at end of file diff --git a/readme.txt b/readme.txt index 194625e..7815766 100644 --- a/readme.txt +++ b/readme.txt @@ -149,14 +149,14 @@ our support team will back to you shortly. -### How to Add New Event -https://www.youtube.com/watch?v=2VLWSUS6GPI +### How to install Woo Commerce Event Manager Plugin in 3 Minutes +https://www.youtube.com/watch?v=_CRPyKHPhTU -### How to Add Ticket Base Event -https://www.youtube.com/watch?v=2VLWSUS6GPI +### WooCommerce Event Manager Pro Addons Setup And Full Functionality Explained +https://www.youtube.com/watch?v=LZj6oUavTQg -### How to Buy/Purchase/Booking an Event -https://www.youtube.com/watch?v=IyUCCIeS6P8 +### How to Configure Event Manager Attendee Registration Form +https://www.youtube.com/watch?v=F9wnlUjXa6I **CHECKOUT OUR OTHER PRODUCTS** @@ -403,4 +403,17 @@ A. you can create support ticket here with problem details with possible screens *= 2.7.2 = * Update Release: ==> Bug Fixed -15 Sep 2019* \ No newline at end of file +15 Sep 2019* + + +*= 2.7.3 = +* Update Release: +==> Bug Fixed +* + + +*= 2.8.0 = +* Update Release: +==> Bug Fixed +==> Event seating issue fixed while order status chganged +04 Nov 2019* \ No newline at end of file diff --git a/templates/template-prts/event_add_cart.php b/templates/template-prts/event_add_cart.php index 3cc1396..9a76223 100644 --- a/templates/template-prts/event_add_cart.php +++ b/templates/template-prts/event_add_cart.php @@ -42,24 +42,23 @@ $simple_rsv = ''; $interval = $datetime1->diff($datetime2); $mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true); - $stc = 0; - $leftt = 0; + $total_seat = mep_event_total_seat(get_the_id(),'total'); + $total_resv = mep_event_total_seat(get_the_id(),'resv'); + $total_sold = mep_ticket_sold(get_the_id()); + $total_left = $total_seat - ($total_sold + $total_resv); + + + if (is_array($mep_event_ticket_type) || is_object($mep_event_ticket_type)){ foreach ($mep_event_ticket_type as $field ) { $qm = $field['option_name_t']; - $opt_qty = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0; -// $opt_rst_qty = $field['option_rsv_t'] ? $field['option_rsv_t'] : 0; - $tesqn = $post_id.str_replace(' ', '', $qm); - $tesq = get_post_meta($post_id,"mep_xtra_$tesqn",true); - $stc = $stc+$opt_qty; - $llft = ($opt_qty - (int)$tesq); - $leftt = $leftt+$llft; } }else{$qm='';} + if($mep_event_ticket_type){ - $seat_left = $leftt; + $seat_left = $total_left; }else{ - $seat_left = $seat_left; + $seat_left = $total_left; } @@ -122,29 +121,7 @@ if(array_key_exists('mep_rsv_seat', $event_meta)){ $mep_available_seat = 'on'; } -if($mep_event_ticket_type){ - - $stc = 0; - $leftt = 0; - $res = 0; - -foreach ( $mep_event_ticket_type as $field ) { - $qm = $field['option_name_t']; - $opt_qty = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0; -$opt_rst_qty = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0; - $tesqn = $post->ID.str_replace(' ', '', $qm); - $tesq = get_post_meta($post->ID,"mep_xtra_$tesqn",true); - $stc = $stc+$opt_qty; - $res = $res + (int)$opt_rst_qty; - $res = (int)$res; - $llft = ($opt_qty - (int)$tesq); - $leftt = ($leftt+$llft); - } - $leftt = $leftt-$res; -}else{ - $leftt = $event_meta['mep_total_seat'][0]- $total_book; -} - + $leftt = $total_left; $days = $interval->d; $hours = $interval->h; $minutes = $interval->i; @@ -168,7 +145,8 @@ if($reg_status!='off'){