diff --git a/inc/admin_setting_panel.php b/inc/admin_setting_panel.php index 3992681..34b3014 100644 --- a/inc/admin_setting_panel.php +++ b/inc/admin_setting_panel.php @@ -143,14 +143,14 @@ class MAGE_Events_Setting_Controls { ) ), array( - 'name' => 'mep_event_expire_on_datetime', + 'name' => 'mep_event_expire_on_datetimes', 'label' => __( 'When will event expire', 'mage-eventpress' ), 'desc' => __( 'Please select when event will expire, On event start time or event endtime', 'mage-eventpress' ), 'type' => 'select', 'default' => 'mep_event_start_date', 'options' => array( - 'event_start_date' => 'Event Start Time', - 'event_end_date' => 'Event End Time' + 'event_start_datetime' => 'Event Start Time', + 'event_end_datetime' => 'Event End Time' ) ), diff --git a/inc/mep_event_meta.php b/inc/mep_event_meta.php index 22762df..23067a0 100644 --- a/inc/mep_event_meta.php +++ b/inc/mep_event_meta.php @@ -1416,8 +1416,8 @@ $event_start_date = strip_tags($_POST['event_start_date']); $event_start_time = strip_tags($_POST['event_start_time']); $event_end_date = strip_tags($_POST['event_end_date']); $event_end_time = strip_tags($_POST['event_end_time']); -// $mep_event_end_date = strip_tags($_POST['mep_event_end_date']); -$mep_event_cc_email_text = strip_tags($_POST['mep_event_cc_email_text']); +// $mep_event_end_date = strip_tags($_POST['mep_event_end_date']); +$mep_event_cc_email_text = $_POST['mep_event_cc_email_text']; $latitude = isset($_POST['latitude']) ? strip_tags($_POST['latitude']) : ""; @@ -1454,13 +1454,16 @@ $mep_reg_tshirtsize_list = update_post_meta( $pid, 'mep_reg_tshirtsize_list $update_template = update_post_meta( $pid, 'mep_event_template', $mep_event_template); $update_mep_org_address = update_post_meta( $pid, 'mep_org_address', $mep_org_address); - +$event_start_datetime = date('Y-m-d H:i:s',strtotime($event_start_date.' '.$event_start_time)); +$event_end_datetime = date('Y-m-d H:i:s',strtotime($event_end_date.' '.$event_end_time)); update_post_meta( $pid, 'event_start_date', $event_start_date); update_post_meta( $pid, 'event_start_time', $event_start_time); update_post_meta( $pid, 'event_end_date', $event_end_date); update_post_meta( $pid, 'event_end_time', $event_end_time); +update_post_meta( $post_id, 'event_start_datetime', $event_start_datetime ); +update_post_meta( $post_id, 'event_end_datetime', $event_end_datetime ); $mep_event_ticket_type = get_post_meta($pid, 'mep_event_ticket_type', true); diff --git a/inc/mep_extra_price.php b/inc/mep_extra_price.php index 4af35ce..02c7545 100644 --- a/inc/mep_extra_price.php +++ b/inc/mep_extra_price.php @@ -267,9 +267,30 @@ if(isset($values['event_ticket_qty'])){ }else{ $event_ticket_qty = " "; } + + + + $user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec',12); + $date_format = get_option( 'date_format' ); + $time_format = get_option( 'time_format' ); + $wpdatesettings = $date_format.' '.$time_format; + + if($user_set_format == 12){ + $cart_date = date_i18n( 'Y-m-d h:i A', strtotime( $values['event_cart_date'] ) ); + }elseif($user_set_format == 24){ + $cart_date = date_i18n( 'Y-m-d H:i', strtotime( $values['event_cart_date'] ) ); + }elseif($user_set_format == 'wtss'){ + $cart_date = date_i18n( $wpdatesettings, strtotime( $values['event_cart_date'] ) ); + } + + + + + + $product_id = $values['product_id']; $cart_location = $values['event_cart_location']; - $cart_date = $values['event_cart_date']; + $form_position = mep_get_option( 'mep_user_form_position', 'general_attendee_sec', 'details_page' ); if($form_position=='details_page'){ @@ -281,7 +302,7 @@ $form_position = mep_get_option( 'mep_user_form_position', 'general_attendee_sec - + $item->add_meta_data('Date',$cart_date); $item->add_meta_data('Location',$cart_location); $item->add_meta_data('_event_ticket_info',$values['event_ticket_info']); diff --git a/inc/mep_shortcode.php b/inc/mep_shortcode.php index b5334f5..7d78573 100644 --- a/inc/mep_shortcode.php +++ b/inc/mep_shortcode.php @@ -101,7 +101,7 @@ function mep_event_list($atts, $content=null){ $pagination = $params['pagination']; $sort = $params['sort']; $column = $params['column']; - $event_expire_on = mep_get_option( 'mep_event_expire_on_datetime', 'general_setting_sec', 'event_start_date'); + $event_expire_on = mep_get_option( 'mep_event_expire_on_datetimes', 'general_setting_sec', 'event_start_datetime'); ob_start(); ?>