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,9 +72,7 @@ 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('mep-calendar-min-style', plugin_dir_url(__DIR__) . 'css/calendar.min.css', array());

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>
@ -844,10 +849,6 @@ class MP_Event_All_Info_In_One
}
});
</script>
<?php
}
@ -1403,9 +1404,11 @@ function mep_event_meta_save($post_id)
update_post_meta($pid, 'mp_event_virtual_type_des', $mp_event_virtual_type_des);
if (!empty($mdate) && $mdate != $oldm) {
update_post_meta($post_id, 'mep_event_more_date', $mdate);
} elseif (empty($mdate) && $oldm) {
$_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) {
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 );
@ -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

@ -198,6 +198,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') {
$args = array(