function update

This commit is contained in:
magepeopleteam 2021-03-22 12:13:03 +00:00
parent 1dcbceacfb
commit 956f554fab
4 changed files with 75 additions and 47 deletions

View File

@ -72,11 +72,9 @@ function mep_event_enqueue_scripts()
wp_enqueue_script('jquery-ui-accordion');
wp_enqueue_style('mep-jquery-ui-style', plugin_dir_url(__DIR__) . 'css/jquery-ui.css', array());
wp_enqueue_style('mep-event-style', plugin_dir_url(__DIR__) . 'css/style.css', array());
wp_enqueue_style('mep-event-timeline-min-style', plugin_dir_url(__DIR__) . 'css/timeline.min.css', array('mep-event-style'));
wp_enqueue_style('font-awesome-css-cdn', "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css", null, 1);
wp_enqueue_style('font-awesome-css-cdn-5.2.0', "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.2.0/css/all.min.css", null, 1);
wp_enqueue_style('font-awesome-css-cdn-5.2.0', "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.2.0/css/all.min.css", null, 1);
wp_enqueue_style('mep-calendar-min-style', plugin_dir_url(__DIR__) . 'css/calendar.min.css', array());
wp_enqueue_script('mep-moment-js', plugin_dir_url(__DIR__) . 'js/moment.js', array(), 1, true);
wp_enqueue_script('mep-calendar-scripts', plugin_dir_url(__DIR__) . 'js/calendar.min.js', array('jquery', 'mep-moment-js'), 1, false);

View File

@ -649,6 +649,7 @@ class MP_Event_All_Info_In_One
<th style="min-width: 120px;"><?php _e('Start Time', 'mage-eventpress'); ?></th>
<th style="min-width: 120px;"><?php _e('End Date', 'mage-eventpress'); ?></th>
<th style="min-width: 120px;"><?php _e('End Time', 'mage-eventpress'); ?></th>
<?php do_action('mep_date_table_head',$post_id); ?>
<th style="min-width: 60px;"><?php _e('Action', 'mage-eventpress'); ?></th>
</thead>
<tbody class="mp_event_type_sortable">
@ -673,6 +674,7 @@ class MP_Event_All_Info_In_One
echo date('H:i', strtotime($values['event_end_time'][0]));
} ?>" />
</td>
<?php do_action('mep_date_table_body_default_date',$post_id); ?>
<td>
</td>
</tr>
@ -706,6 +708,8 @@ class MP_Event_All_Info_In_One
echo date('H:i', strtotime($field['event_more_end_time']));
} ?>" />
</td>
<?php do_action('mep_date_table_body_more_date',$post_id, $field); ?>
<td>
<div class="mp_event_remove_move">
<button class="button remove-row-d" type="button"><span class="dashicons dashicons-trash" style="margin-top: 3px;color: red;"></span></button>
@ -732,6 +736,7 @@ class MP_Event_All_Info_In_One
<td>
<input type="time" class="mp_formControl" name="event_more_end_time[]" placeholder="End Time" value="" />
</td>
<?php do_action('mep_date_table_empty',$post_id); ?>
<td>
<button class="button remove-row-d"><span class="dashicons dashicons-trash" style="margin-top: 3px;color: red;"></span><?php _e('Remove', 'mage-eventpress'); ?></button>
</td>
@ -759,15 +764,15 @@ class MP_Event_All_Info_In_One
$event_rt_prv_date = get_post_meta($post_id, 'mep_rt_event_prvdate', true) ? get_post_meta($post_id, 'mep_rt_event_prvdate', true) : $event_start_date;
$rt_status = get_post_meta($post_id, 'mep_rich_text_status', true) ? get_post_meta($post_id, 'mep_rich_text_status', true) : 'enable';
?>
<div class='mep_rich_text_status_section'>
<label for='mep_rich_text_status'>
<?php _e('Rich Text Status','mage-eventpress'); ?>
<select id='mep_rich_text_status' name='mep_rich_text_status'>
<option value='enable' <?php if($rt_status == 'enable'){ echo 'Selected'; } ?>><?php _e('Enable','mage-eventpress'); ?></option>
<option value='disable' <?php if($rt_status == 'disable'){ echo 'Selected'; } ?>><?php _e('Disable','mage-eventpress'); ?></option>
</select>
</label>
</div>
<div class='mep_rich_text_status_section'>
<label for='mep_rich_text_status'>
<?php _e('Rich Text Status','mage-eventpress'); ?>
<select id='mep_rich_text_status' name='mep_rich_text_status'>
<option value='enable' <?php if($rt_status == 'enable'){ echo 'Selected'; } ?>><?php _e('Enable','mage-eventpress'); ?></option>
<option value='disable' <?php if($rt_status == 'disable'){ echo 'Selected'; } ?>><?php _e('Disable','mage-eventpress'); ?></option>
</select>
</label>
</div>
<table id='mep_rich_text_table' <?php if($rt_status == 'disable'){ ?> style='display:none;' <?php } ?>>
<tr>
<th><span><?php _e('Type :', 'mage-eventpress'); ?></span></th>
@ -832,22 +837,18 @@ class MP_Event_All_Info_In_One
</td>
</tr>
</table>
<script>
jQuery('[name="mep_rich_text_status"]').change(function() {
var rich_status = jQuery(this).val() ? jQuery(this).val() : 'enable';
if(rich_status == 'enable'){
// mep_rich_text_table
jQuery('#mep_rich_text_table').show(500);
}
else if(rich_status == 'disable'){
jQuery('#mep_rich_text_table').hide(500);
}
});
</script>
<script>
jQuery('[name="mep_rich_text_status"]').change(function() {
var rich_status = jQuery(this).val() ? jQuery(this).val() : 'enable';
if(rich_status == 'enable'){
// mep_rich_text_table
jQuery('#mep_rich_text_table').show(500);
}
else if(rich_status == 'disable'){
jQuery('#mep_rich_text_table').hide(500);
}
});
</script>
<?php
}
@ -1102,15 +1103,15 @@ function mep_events_ticket_type_save($post_id)
$old = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
$new = array();
$names = $_POST['option_name_t'] ? $_POST['option_name_t'] : array();
$ticket_price = $_POST['option_price_t'] ? $_POST['option_price_t'] : array();
$qty = $_POST['option_qty_t'] ? $_POST['option_qty_t'] : array();
$dflt_qty = $_POST['option_default_qty_t'] ? $_POST['option_default_qty_t'] : array();
$rsv = $_POST['option_rsv_t'] ? $_POST['option_rsv_t'] : array();
$qty_type = $_POST['option_qty_t_type'] ? $_POST['option_qty_t_type'] : array();
$sale_end_date = $_POST['option_sale_end_date'] ? $_POST['option_sale_end_date'] : array();
$sale_end_time = $_POST['option_sale_end_time'] ? $_POST['option_sale_end_time'] : array();
$new = array();
$names = $_POST['option_name_t'] ? $_POST['option_name_t'] : array();
$ticket_price = $_POST['option_price_t'] ? $_POST['option_price_t'] : array();
$qty = $_POST['option_qty_t'] ? $_POST['option_qty_t'] : array();
$dflt_qty = $_POST['option_default_qty_t'] ? $_POST['option_default_qty_t'] : array();
$rsv = $_POST['option_rsv_t'] ? $_POST['option_rsv_t'] : array();
$qty_type = $_POST['option_qty_t_type'] ? $_POST['option_qty_t_type'] : array();
$sale_end_date = $_POST['option_sale_end_date'] ? $_POST['option_sale_end_date'] : array();
$sale_end_time = $_POST['option_sale_end_time'] ? $_POST['option_sale_end_time'] : array();
$count = count($names);
@ -1402,10 +1403,12 @@ function mep_event_meta_save($post_id)
$mp_event_virtual_type_des = isset($_POST['mp_event_virtual_type_des']) ? strip_tags($_POST['mp_event_virtual_type_des']) : "";
update_post_meta($pid, 'mp_event_virtual_type_des', $mp_event_virtual_type_des);
$_mdate = apply_filters('mep_more_date_arr_save', $mdate);
if (!empty($mdate) && $mdate != $oldm) {
update_post_meta($post_id, 'mep_event_more_date', $mdate);
} elseif (empty($mdate) && $oldm) {
if (!empty($_mdate) && $_mdate != $oldm) {
update_post_meta($post_id, 'mep_event_more_date', $_mdate);
} elseif (empty($_mdate) && $oldm) {
delete_post_meta($post_id, 'mep_event_more_date', $oldm);
}
}

View File

@ -310,8 +310,19 @@ function mep_get_event_ticket_price_by_name($event,$type) {
}
}
function mep_get_ticket_price_by_event($event,$type,$default_price=0) {
$ticket_type = get_post_meta($event,'mep_event_ticket_type',true);
if($ticket_type){
$all_ticket_tyle = get_post_meta($event,'mep_event_ticket_type',true);
foreach ($all_ticket_tyle as $key => $val) {
if ($val['option_name_t'] === $type) {
return (int) $val['option_price_t'];
}
}
}else{
return $default_price;
}
}
if (!function_exists('mep_attendee_create')) {
@ -399,7 +410,8 @@ $ticket_total_price = (mep_get_event_ticket_price_by_name($event_id,$ticket_type
update_post_meta( $pid, 'ea_tshirtsize', $tshirtsize );
update_post_meta( $pid, 'ea_ticket_type', $ticket_type );
update_post_meta( $pid, 'ea_ticket_qty', $ticket_qty);
update_post_meta( $pid, 'ea_ticket_price', $ticket_total_price);
update_post_meta( $pid, 'ea_ticket_price', mep_get_ticket_price_by_event($event_id,$ticket_type,0));
update_post_meta( $pid, 'ea_ticket_order_amount', $ticket_total_price);
update_post_meta( $order_id, 'ea_ticket_qty', $ticket_qty);
update_post_meta( $order_id, 'ea_ticket_type', $ticket_type );
update_post_meta( $order_id, 'ea_event_id', $event_id );
@ -3233,7 +3245,7 @@ function mep_product_exists( $id ) {
if (!function_exists('mep_get_event_dates_arr')) {
function mep_get_event_dates_arr($event_id){
$now = current_time('Y-m-d H:i:s');
$now = current_time('Y-m-d H:i:s');
$event_start_datetime = get_post_meta($event_id,'event_start_datetime',true);
$event_expire_datetime = get_post_meta($event_id,'event_end_datetime',true);
$event_more_dates = get_post_meta($event_id,'mep_event_more_date',true) ? get_post_meta($event_id,'mep_event_more_date',true) : [];
@ -3255,9 +3267,6 @@ if (!function_exists('mep_get_event_dates_arr')) {
}
}
$event_dates = array_merge($date_arr,$m_date_arr);
return apply_filters('mep_event_dates_in_calender_free',$event_dates,$event_id);
}
}

View File

@ -197,6 +197,24 @@ function mep_get_all_order_data_and_create_attendee()
}
if (get_option('mep_attendee_ticket_price_update_01') != 'completed') {
$args = array(
'post_type' => 'mep_events_attendees',
'posts_per_page' => -1
);
$qr = new WP_Query($args);
foreach ($qr->posts as $result) {
$post_id = $result->ID;
$event_id = get_post_meta($post_id,'ea_event_id',true);
$ticket_type = get_post_meta($post_id,'ea_ticket_type',true);
update_post_meta($post_id, 'ea_ticket_price', mep_get_ticket_price_by_event($event_id,$ticket_type,0));
}
update_option('mep_attendee_ticket_price_update_01', 'completed');
}
if (get_option('mep_attendee_checkin_update_01') != 'completed') {