version 3.2.5 released with date issue fixed

This commit is contained in:
magepeopleteam 2020-05-08 10:09:24 +00:00
parent e6706c5667
commit 79337d94fd
15 changed files with 1919 additions and 1901 deletions

View File

@ -120,4 +120,15 @@ function mep_fw_meta_boxs()
new AddMetaBox($events_speaker_list_meta_args);
}
}

View File

@ -37,11 +37,6 @@ add_meta_box( 'mep-event-rest-count-sec', __('Event Reset Booking Count','mage-e
add_meta_box( 'mep-event-rich-text', __('<span class="dashicons dashicons-admin-generic" style="color:green; padding-right:10px;"></span>Event Rich text','mage-eventpress'), 'mep_event_rich_text_meta_box_cb', 'mep_events', 'normal', 'high' );
}
add_action('admin_head','mep_hide_single_price_section');
@ -102,35 +97,6 @@ function mep_event_rich_text_meta_box_cb($post){
}
add_action('save_post','mep_rt_meta_save');
function mep_rt_meta_save($post_id){
global $wpdb;
if ( ! isset( $_POST['mep_event_ricn_text_nonce'] ) || ! wp_verify_nonce( $_POST['mep_event_ricn_text_nonce'], 'mep_event_ricn_text_nonce' ) )
return;
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return;
if (!current_user_can('edit_post', $post_id))
return;
if (get_post_type($post_id) == 'mep_events') {
$event_rt_status = $_POST['mep_rt_event_status'];
$event_rt_atdnce_mode = $_POST['mep_rt_event_attandence_mode'];
$event_rt_prv_date = $_POST['mep_rt_event_prvdate'];
update_post_meta( $post_id, 'mep_rt_event_status', $event_rt_status);
update_post_meta( $post_id, 'mep_rt_event_attandence_mode', $event_rt_atdnce_mode);
update_post_meta( $post_id, 'mep_rt_event_prvdate', $event_rt_prv_date);
}
}
@ -185,7 +151,6 @@ function mep_event_tax_cb($post){
$values = get_post_custom( $post->ID );
wp_nonce_field( 'mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce' );
$check_values = isset($values['_tax_status'][0]) ? $values['_tax_status'][0] : "";
echo $check_values;
if(array_key_exists('_tax_status', $values)){ $tx_status = $values['_tax_status'][0]; }else{ $tx_status = ''; }
@ -1124,21 +1089,6 @@ function mep_event_date_meta_box_cb($post){
});
</script>
<!-- <div class='sec'>
<table width='100%'>
<tr>
<td>
<label for="event_start_date"> <?php _e('Start Date & Time:','mage-eventpress'); ?> </label>
<span><input class='event_start' id='event_start_date' type="text" name='mep_event_start_date' placeholder="YYYY-MM-DD" value='<?php if(array_key_exists('mep_event_start_date', $values)){ echo $values['mep_event_start_date'][0]; } ?>'> </span>
</td>
<td>
<label for="event_end_date"> <?php _e('End Date & Time:','mage-eventpress'); ?> </label>
<span><input class='event_end' id='event_end_date' type="text" name='mep_event_end_date' placeholder="YYYY-MM-DD" value='<?php if(array_key_exists('mep_event_end_date', $values)){ echo $values['mep_event_end_date'][0]; } ?>'> </span>
</td>
</tr>
</table>
</div> -->
<div class="sec">
@ -1285,7 +1235,7 @@ if($current_template){
add_action('save_post', 'mep_events_ticket_type_save');
function mep_events_ticket_type_save($post_id) {
global $wpdb;
$table_name = $wpdb->prefix . 'mep_event_ticket_type';
if ( ! isset( $_POST['mep_event_ticket_type_nonce'] ) ||
! wp_verify_nonce( $_POST['mep_event_ticket_type_nonce'], 'mep_event_ticket_type_nonce' ) )
@ -1300,64 +1250,65 @@ function mep_events_ticket_type_save($post_id) {
if (get_post_type($post_id) == 'mep_events') {
$old = get_post_meta($post_id, 'mep_event_ticket_type', true);
$old = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
$new = array();
// $options = hhs_get_sample_options();
$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();
$names = $_POST['option_name_t'];
// $selects = $_POST['select'];
$urls = $_POST['option_price_t'];
$qty = $_POST['option_qty_t'];
$dqty = $_POST['option_default_qty_t'];
$rsv = $_POST['option_rsv_t'];
$qty_type = $_POST['option_qty_t_type'];
// $required = $_POST['option_required_t'];
// $total_sold = $_POST['option_sold'];
$order_id = 0;
$count = count( $names );
for ( $i = 0; $i < $count; $i++ ) {
// $new[$i]['option_name_t'] = !empty($names[$i]) ? stripslashes( strip_tags( $names[$i] ) ) : '';
// $new[$i]['option_price_t'] = !empty($ticket_price[$i]) ? stripslashes( strip_tags( $ticket_price[$i] ) ) : '';
// $new[$i]['option_qty_t'] = !empty($qty[$i]) ? stripslashes( strip_tags( $qty[$i] ) ) : '';
// $new[$i]['option_rsv_t'] = !empty($rsv[$i]) ? stripslashes( strip_tags( $rsv[$i] ) ) : '';
// $new[$i]['option_default_qty_t'] = !empty($dflt_qty[$i]) ? stripslashes( strip_tags( $dflt_qty[$i] ) ) : '';
// $new[$i]['option_qty_t_type'] = !empty($qty_type[$i]) ? stripslashes( strip_tags( $qty_type[$i] ) ) : '';
if ( $names[ $i ] != '' ) :
$new[ $i ]['option_name_t'] = stripslashes( strip_tags( $names[ $i ] ) );
endif;
if ( $urls[$i] != '' ) :
$new[$i]['option_price_t'] = stripslashes( strip_tags( $urls[$i] ) );
if ( $ticket_price[ $i ] != '' ) :
$new[ $i ]['option_price_t'] = stripslashes( strip_tags( $ticket_price[ $i ] ) );
endif;
if ( $qty[ $i ] != '' ) :
$new[ $i ]['option_qty_t'] = stripslashes( strip_tags( $qty[ $i ] ) );
endif;
if ( $rsv[ $i ] != '' ) :
$new[ $i ]['option_rsv_t'] = stripslashes( strip_tags( $rsv[ $i ] ) );
endif;
if ( $dqty[$i] != '' ) :
$new[$i]['option_default_qty_t'] = stripslashes( strip_tags( $dqty[$i] ) );
if ( $dflt_qty[ $i ] != '' ) :
$new[ $i ]['option_default_qty_t'] = stripslashes( strip_tags( $dflt_qty[ $i ] ) );
endif;
if ( $qty_type[ $i ] != '' ) :
$new[ $i ]['option_qty_t_type'] = stripslashes( strip_tags( $qty_type[ $i ] ) );
endif;
// if ( $required[$i] != '' ) :
// $new[$i]['option_required_t'] = stripslashes( strip_tags( $required[$i] ) );
// endif;
$opt_name = $post_id.str_replace(' ', '', $names[$i]);
// update_post_meta( $post_id, "mep_xtra_$opt_name",0 );
}
if ( !empty( $new ) && $new != $old )
update_post_meta( $post_id, 'mep_event_ticket_type', $new );
elseif ( empty($new) && $old )
$ticket_type_list = apply_filters('mep_ticket_type_arr_save',$new);
if ( !empty( $ticket_type_list ) && $ticket_type_list != $old )
update_post_meta( $post_id, 'mep_event_ticket_type', $ticket_type_list );
elseif ( empty($ticket_type_list) && $old )
delete_post_meta( $post_id, 'mep_event_ticket_type', $old );
}
}
@ -1446,22 +1397,29 @@ if (get_post_type($post_id) == 'mep_events') {
/**
* Now Saving the Event Meta Field Data
*/
add_action('save_post','mep_event_meta_save');
function mep_event_meta_save($post_id){
add_action('save_post','mep_events_meta_save');
function mep_events_meta_save($post_id){
global $post;
if($post){
$pid = $post->ID;
if ($post->post_type != 'mep_events'){
if ( ! isset( $_POST['mep_event_ricn_text_nonce'] ) || ! wp_verify_nonce( $_POST['mep_event_ricn_text_nonce'], 'mep_event_ricn_text_nonce' ) )
return;
}
}else{
$pid='';
}
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return;
if (!current_user_can('edit_post', $post_id))
return;
/**
* If the saving post is event then go on
*/
if (get_post_type($post_id) == 'mep_events') {
$pid = $post_id;
$oldm = get_post_meta($post_id, 'mep_event_more_date', true);
@ -1484,21 +1442,10 @@ $mcount = count( $more_start_date );
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 );
//if you get here then it's your post type so do your thing....
if(isset($_POST['mep_total_seat'])){
$event_rt_status = $_POST['mep_rt_event_status'];
$event_rt_atdnce_mode = $_POST['mep_rt_event_attandence_mode'];
$event_rt_prv_date = $_POST['mep_rt_event_prvdate'];
$seat = isset( $_POST['mep_total_seat'] ) ? strip_tags( $_POST['mep_total_seat'] ) : "";
$rsvs = isset( $_POST['mep_rsv_seat'] ) ? strip_tags( $_POST['mep_rsv_seat'] ) : "";
@ -1543,25 +1490,9 @@ $mep_event_template = isset($_POST['mep_event_template']) ? strip_ta
$update_reg_name = update_post_meta( $pid, 'mep_full_name', $mep_full_name);
$update_reg_email = update_post_meta( $pid, 'mep_reg_email', $mep_reg_email);
$update_reg_phone = update_post_meta( $pid, 'mep_reg_phone', $mep_reg_phone);
$update_reg_address = update_post_meta( $pid, 'mep_reg_address', $mep_reg_address);
$update_reg_desg = update_post_meta( $pid, 'mep_reg_designation', $mep_reg_designation);
$update_reg_web = update_post_meta( $pid, 'mep_reg_website', $mep_reg_website);
$update_reg_veg = update_post_meta( $pid, 'mep_reg_veg', $mep_reg_veg);
$update_reg_comapny = update_post_meta( $pid, 'mep_reg_company', $mep_reg_company);
$update_reg_gender = update_post_meta( $pid, 'mep_reg_gender', $mep_reg_gender);
$update_tshirtsize = update_post_meta( $pid, 'mep_reg_tshirtsize', $mep_reg_tshirtsize);
$mep_reg_tshirtsize_list = update_post_meta( $pid, 'mep_reg_tshirtsize_list', $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));
$md = sizeof($mdate)>0 ? end($mdate) : array();
$event_expire_datetime = sizeof($md) > 0 ? date('Y-m-d H:i:s',strtotime($md['event_more_end_date'].' '.$md['event_more_end_time'])) : $event_end_datetime;
@ -1569,10 +1500,23 @@ $event_expire_datetime = sizeof($md) > 0 ? date('Y-m-d H:i:s',strtotime($md['ev
update_post_meta( $post_id, 'mep_rt_event_status', $event_rt_status);
update_post_meta( $post_id, 'mep_rt_event_attandence_mode', $event_rt_atdnce_mode);
update_post_meta( $post_id, 'mep_rt_event_prvdate', $event_rt_prv_date);
update_post_meta( $pid, 'mep_full_name', $mep_full_name);
update_post_meta( $pid, 'mep_reg_email', $mep_reg_email);
update_post_meta( $pid, 'mep_reg_phone', $mep_reg_phone);
update_post_meta( $pid, 'mep_reg_address', $mep_reg_address);
update_post_meta( $pid, 'mep_reg_designation', $mep_reg_designation);
update_post_meta( $pid, 'mep_reg_website', $mep_reg_website);
update_post_meta( $pid, 'mep_reg_veg', $mep_reg_veg);
update_post_meta( $pid, 'mep_reg_company', $mep_reg_company);
update_post_meta( $pid, 'mep_reg_gender', $mep_reg_gender);
update_post_meta( $pid, 'mep_reg_tshirtsize', $mep_reg_tshirtsize);
update_post_meta( $pid, 'mep_reg_tshirtsize_list', $mep_reg_tshirtsize_list);
update_post_meta( $pid, 'mep_event_template', $mep_event_template);
update_post_meta( $pid, 'mep_org_address', $mep_org_address);
update_post_meta( $pid, 'event_start_date', $event_start_date);
update_post_meta( $pid, 'event_start_time', $event_start_time);
@ -1581,60 +1525,34 @@ 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 );
update_post_meta( $post_id, 'event_expire_datetime', $event_expire_datetime );
update_post_meta( $pid, '_manage_stock', $st_msg);
update_post_meta( $pid, '_stock', $seat);
update_post_meta( $pid, '_stock_msg', 'new');
update_post_meta( $pid, 'longitude', $longitude);
update_post_meta( $pid, 'latitude', $latitude);
update_post_meta( $pid, 'location_name', $location_name);
update_post_meta( $pid, 'mep_location_venue', $mep_location_venue);
update_post_meta( $pid, 'mep_street', $mep_street);
update_post_meta( $pid, '_sold_individually', 'no');
update_post_meta( $pid, 'mep_city', $mep_city);
update_post_meta( $pid, 'mep_state', $mep_state);
update_post_meta( $pid, 'mep_postcode', $mep_postcode);
update_post_meta( $pid, 'mep_country', $mep_country);
update_post_meta( $pid, 'mep_sqi', $mep_sqi);
update_post_meta( $pid, 'qty_box_type', $qty_box_type);
update_post_meta( $pid, 'mep_sgm', $mep_sgm);
update_post_meta( $pid, 'mep_price_label', $mep_price_label);
update_post_meta( $pid, '_price', $_price);
update_post_meta( $pid, '_virtual', 'yes');
update_post_meta( $pid, 'mep_event_cc_email_text', $mep_event_cc_email_text);
update_post_meta( $pid, '_sku', $pid);
$mep_event_ticket_type = get_post_meta($pid, 'mep_event_ticket_type', true);
if($mep_event_ticket_type){
$st_msg = 'no';
$seat = "";
$_price =0;
$rsvs =0;
}else{
$st_msg = 'yes';
$_price = $_price;
$seat = $seat;
$rsvs = $rsvs;
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 );
}
$update_seat = update_post_meta( $pid, 'mep_total_seat', $seat);
$update_seat = update_post_meta( $pid, 'mep_rsv_seat', $rsvs);
$update_seat_stock_status = update_post_meta( $pid, '_manage_stock', $st_msg);
$update_seat_stock = update_post_meta( $pid, '_stock', $seat);
$sts_msg = update_post_meta( $pid, '_stock_msg', 'new');
// $ttl_booking = update_post_meta( $pid, 'total_booking', '0');
$longitude = update_post_meta( $pid, 'longitude', $longitude);
$latitude = update_post_meta( $pid, 'latitude', $latitude);
$location_name = update_post_meta( $pid, 'location_name', $location_name);
$update_location = update_post_meta( $pid, 'mep_location_venue', $mep_location_venue);
$update_mep_street = update_post_meta( $pid, 'mep_street', $mep_street);
$update_seat_stock_status = update_post_meta( $pid, '_sold_individually', 'no');
$update_city = update_post_meta( $pid, 'mep_city', $mep_city);
$update_mep_state = update_post_meta( $pid, 'mep_state', $mep_state);
$update_postcode = update_post_meta( $pid, 'mep_postcode', $mep_postcode);
$update_conuntry = update_post_meta( $pid, 'mep_country', $mep_country);
$update_sqi = update_post_meta( $pid, 'mep_sqi', $mep_sqi);
$qty_box_type = update_post_meta( $pid, 'qty_box_type', $qty_box_type);
$update_mep_sgm = update_post_meta( $pid, 'mep_sgm', $mep_sgm);
$update_price_label = update_post_meta( $pid, 'mep_price_label', $mep_price_label);
$update_price = update_post_meta( $pid, '_price', $_price);
// $update_start = update_post_meta( $pid, 'mep_event_start_date', $mep_event_start_date);
$update_virtual = update_post_meta( $pid, '_virtual', 'yes');
// $update_end = update_post_meta( $pid, 'mep_event_end_date', $mep_event_end_date);
$mep_event_cc_email_text = update_post_meta( $pid, 'mep_event_cc_email_text', $mep_event_cc_email_text);
$mep_event_sku = update_post_meta( $pid, '_sku', $pid);
}
}
}

View File

@ -30,6 +30,7 @@ function mep_add_custom_fields_text_to_cart_item($cart_item_data, $product_id, $
$user = $form_position == 'details_page' ? mep_save_attendee_info_into_cart($product_id) : array();
$validate = mep_cart_ticket_type('validation_data', $total_price,$product_id);
/**
* Now Store the datas into Cart Session
*/
@ -85,6 +86,8 @@ function mep_display_custom_fields_text_cart($item_data, $cart_item)
$eid = array_key_exists('event_id', $cart_item) ? $cart_item['event_id'] : 0; //$cart_item['event_id'];
if (get_post_type($eid) == 'mep_events') {
$hide_location_status = mep_get_option('mep_hide_location_from_order_page', 'general_setting_sec', 'no');
$hide_date_status = mep_get_option('mep_hide_date_from_order_page', 'general_setting_sec', 'no');
$user_info = $cart_item['event_user_info'];
$ticket_type_arr = $cart_item['event_ticket_info'];
$event_extra_service = $cart_item['event_extra_service'];
@ -98,11 +101,13 @@ function mep_display_custom_fields_text_cart($item_data, $cart_item)
if ($recurring == 'yes') {
if (is_array($ticket_type_arr) && sizeof($ticket_type_arr) > 0 && sizeof($user_info) == 0) {
foreach ($ticket_type_arr as $_event_recurring_date) {
if($hide_date_status == 'no'){
?>
<li><?php _e('Event Date', 'mage-eventpress'); ?>: <?php echo $cart_item['event_cart_date']; ?></li>
<?php
}
}
}
if (is_array($user_info) && sizeof($user_info) > 0) {
echo '<li>';
@ -119,15 +124,19 @@ function mep_display_custom_fields_text_cart($item_data, $cart_item)
<?php
echo '</li>';
} else {
if($hide_date_status == 'no'){
?>
<li><?php _e('Event Date', 'mage-eventpress'); ?>: <?php echo get_mep_datetime($cart_item['event_cart_display_date'],'date-time-text'); ?></li>
<?php
}
}
}
if($hide_location_status == 'no'){
?>
<li><?php _e('Event Location', 'mage-eventpress'); ?>: <?php echo $cart_item['event_cart_location']; ?></li>
<?php
}
if (is_array($ticket_type_arr) && sizeof($ticket_type_arr) > 0) {
foreach ($ticket_type_arr as $ticket) {
echo '<li>' . $ticket['ticket_name'] . " - " . wc_price($ticket['ticket_price']) . ' x ' . $ticket['ticket_qty'] . ' = ' . wc_price($ticket['ticket_price'] * $ticket['ticket_qty']) . '</li>';

View File

@ -847,15 +847,9 @@ add_filter('template_include', 'mep_city_template_chooser');
// Getting event exprie date & time
function mep_get_event_status($startdatetime){
// $default_timezone_val = wp_timezone_string();
// date_default_timezone_set($default_timezone_val);
$current = current_time('Y-m-d H:i:s');
$newformat = date('Y-m-d H:i:s',strtotime($startdatetime));
// date_default_timezone_set(get_option('timezone_string'));
$datetime1 = new DateTime($newformat);
$datetime2 = new DateTime($current);
@ -876,7 +870,13 @@ add_filter('template_include', 'mep_city_template_chooser');
}
function mep_merge_saved_array($arr1,$arr2){
$output = [];
for ($i=0; $i<count($arr1); $i++) {
$output[$i] = array_merge($arr1[$i], $arr2[$i]);
}
return $output;
}
// Redirect to Checkout after successfuly event registration
@ -2754,10 +2754,10 @@ function mep_single_page_js_script($event_id){
// price.closest('tr').find('.cart_total_price').html(sum + "â‚´");
});
jQuery('#usertotal').html("<?php if ($currency_pos == "left") {
jQuery('#usertotal').html("<?php if ($currency_pos == "left" || $currency_pos == 'left_space') {
echo get_woocommerce_currency_symbol();
} ?>" + total + "<?php if ($currency_pos == "right" || $currency_pos == 'right_space') {
echo get_woocommerce_currency_symbol();
} ?>" + total + "<?php if ($currency_pos == "right") {
get_woocommerce_currency_symbol();
} ?>");
jQuery('#rowtotal').val(total);
}).change(); //trigger change event on page load
@ -2781,6 +2781,7 @@ function mep_single_page_js_script($event_id){
foreach ($event_multi_date as $event_date) {
$start_date = $recurring == 'yes' ? date('Y-m-d H:i:s', strtotime($event_date['event_more_start_date'] . ' ' . $event_date['event_more_start_time'])) : date('Y-m-d H:i:s', strtotime(mep_get_event_expire_date($event_id)));
$event_start_date = $recurring == 'yes' ? date('Y-m-d H:i:s', strtotime($event_date['event_more_start_date'] . ' ' . $event_date['event_more_start_time'])) : get_post_meta($event_id,'event_start_datetime',true);
if (strtotime(current_time('Y-m-d H:i:s')) < strtotime($start_date)) {
foreach ($mep_event_ticket_type as $field) {
@ -2801,7 +2802,7 @@ function mep_single_page_js_script($event_id){
jQuery('#dadainfo_<?php echo $count; ?>').append(
jQuery('<div/>')
.attr("id", "newDiv" + i)
.html("<?php do_action('mep_reg_fields', $start_date, $event_id, $ticket_type); ?>")
.html("<?php do_action('mep_reg_fields', $event_start_date, $event_id, $ticket_type); ?>")
);
}
jQuery('#eventpxtp_<?php echo $count; ?>').on('change', function() {
@ -2823,7 +2824,7 @@ function mep_single_page_js_script($event_id){
jQuery('#dadainfo_<?php echo $count; ?>').append(
jQuery('<div/>')
.attr("id", "newDiv" + i)
.html("<?php do_action('mep_reg_fields', $start_date, $event_id, $ticket_type); ?>")
.html("<?php do_action('mep_reg_fields', $event_start_date, $event_id, $ticket_type); ?>")
);
}
});

View File

@ -9,9 +9,20 @@ ob_start();
if($location_sts){
$org_arr = get_the_terms( $event_id, 'mep_org' );
$org_id = $org_arr[0]->term_id;
echo get_term_meta( $org_id, 'org_location', true ); ?>,<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><?php echo get_term_meta( $org_id, 'org_street', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_city', true )){ ?> <?php echo get_term_meta( $org_id, 'org_city', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_state', true )){ echo get_term_meta( $org_id, 'org_state', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_postcode', true )){ ?> <?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>, <?php } if(get_term_meta( $org_id, 'org_country', true )){ ?> <?php echo get_term_meta( $org_id, 'org_country', true ); ?> <?php }
echo get_term_meta( $org_id, 'org_location', true ); ?>,<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><?php echo get_term_meta( $org_id, 'org_street', true ); ?>,
<?php } if(get_term_meta( $org_id, 'org_city', true )){ ?> <?php echo get_term_meta( $org_id, 'org_city', true ); ?>,
<?php } if(get_term_meta( $org_id, 'org_state', true )){ echo get_term_meta( $org_id, 'org_state', true ); ?>,
<?php } if(get_term_meta( $org_id, 'org_postcode', true )){ ?>
<?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>,
<?php } if(get_term_meta( $org_id, 'org_country', true )){ ?>
<?php echo get_term_meta( $org_id, 'org_country', true ); ?> <?php }
}else{
echo $event_meta['mep_location_venue'][0]; ?>, <?php if($event_meta['mep_street'][0]){ ?><?php echo $event_meta['mep_street'][0]; ?>, <?php } if($event_meta['mep_city'][0]){ ?> <?php echo $event_meta['mep_city'][0]; ?>, <?php } if($event_meta['mep_state'][0]){ ?> <?php echo $event_meta['mep_state'][0]; ?>, <?php } if($event_meta['mep_postcode'][0]){ ?> <?php echo $event_meta['mep_postcode'][0]; ?>, <?php } if($event_meta['mep_country'][0]){ ?> <?php echo $event_meta['mep_country'][0]; ?> <?php }
echo $event_meta['mep_location_venue'][0]; ?>,
<?php if($event_meta['mep_street'][0]){ ?><?php echo $event_meta['mep_street'][0]; ?>,
<?php } if($event_meta['mep_city'][0]){ ?> <?php echo $event_meta['mep_city'][0]; ?>,
<?php } if($event_meta['mep_state'][0]){ ?> <?php echo $event_meta['mep_state'][0]; ?>,
<?php } if($event_meta['mep_postcode'][0]){ ?> <?php echo $event_meta['mep_postcode'][0]; ?>,
<?php } if($event_meta['mep_country'][0]){ ?> <?php echo $event_meta['mep_country'][0]; ?> <?php }
}
@ -30,10 +41,14 @@ $org_arr = get_the_terms( $event_id, 'mep_org' );
$org_id = $org_arr[0]->term_id;
?>
<?php echo get_term_meta( $org_id, 'org_location', true ); ?>,
<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><?php echo get_term_meta( $org_id, 'org_street', true ); ?>, <?php } ?>
<?php if(get_term_meta( $org_id, 'org_city', true )){ ?> <?php echo get_term_meta( $org_id, 'org_city', true ); ?>, <?php } ?>
<?php if(get_term_meta( $org_id, 'org_state', true )){ ?> <?php echo get_term_meta( $org_id, 'org_state', true ); ?>, <?php } ?>
<?php if(get_term_meta( $org_id, 'org_postcode', true )){ ?> <?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>, <?php } ?>
<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><?php echo get_term_meta( $org_id, 'org_street', true ); ?>,
<?php } ?>
<?php if(get_term_meta( $org_id, 'org_city', true )){ ?> <?php echo get_term_meta( $org_id, 'org_city', true ); ?>,
<?php } ?>
<?php if(get_term_meta( $org_id, 'org_state', true )){ ?> <?php echo get_term_meta( $org_id, 'org_state', true ); ?>,
<?php } ?>
<?php if(get_term_meta( $org_id, 'org_postcode', true )){ ?>
<?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>, <?php } ?>
<?php if(get_term_meta( $org_id, 'org_country', true )){ ?> <?php echo get_term_meta( $org_id, 'org_country', true ); ?> <?php }
}else{
?>
@ -59,11 +74,16 @@ $org_arr = get_the_terms( $post->ID, 'mep_org' );
$org_id = $org_arr[0]->term_id;
?>
<p><?php echo get_term_meta( $org_id, 'org_location', true ); ?>,</p>
<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><p><?php echo get_term_meta( $org_id, 'org_street', true ); ?>,</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_city', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_city', true ); ?>,</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_state', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_state', true ); ?>,</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_postcode', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>,</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_country', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_country', true ); ?></p> <?php }
<?php if(get_term_meta( $org_id, 'org_street', true )){ ?><p>
<?php echo get_term_meta( $org_id, 'org_street', true ); ?>,</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_city', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_city', true ); ?>,
</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_state', true )){ ?> <p><?php echo get_term_meta( $org_id, 'org_state', true ); ?>,
</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_postcode', true )){ ?> <p>
<?php echo get_term_meta( $org_id, 'org_postcode', true ); ?>,</p> <?php } ?>
<?php if(get_term_meta( $org_id, 'org_country', true )){ ?> <p>
<?php echo get_term_meta( $org_id, 'org_country', true ); ?></p> <?php }
}else{
?>
<p><?php echo $event_meta['mep_location_venue'][0]; ?>,</p>
@ -254,3 +274,33 @@ $org_id = $org_arr[0]->term_id;
<?php
}
}
add_action('mep_event_address_list_sidebar','mep_event_address_list_sidebar_html');
function mep_event_address_list_sidebar_html($event_id){
$location_sts = get_post_meta($event_id,'mep_org_address',true);
$org_arr = get_the_terms( $event_id, 'mep_org' );
$org_id = $org_arr[0]->term_id;
$venue = !empty($location_sts) ? get_term_meta( $org_id, 'org_location', true ) : get_post_meta($event_id,'mep_location_venue',true);
$street = !empty($location_sts) ? get_term_meta( $org_id, 'org_street', true ) : get_post_meta($event_id,'mep_street',true);
$city = !empty($location_sts) ? get_term_meta( $org_id, 'org_city', true ) : get_post_meta($event_id,'mep_city',true);
$state = !empty($location_sts) ? get_term_meta( $org_id, 'org_state', true ) : get_post_meta($event_id,'mep_state',true);
$country = !empty($location_sts) ? get_term_meta( $org_id, 'org_country', true ) : get_post_meta($event_id,'mep_country',true);
ob_start();
?>
<ul>
<?php if($venue){ ?> <li><i class="fa fa-arrow-circle-right"></i> <?php do_action('mep_event_location_venue'); ?>
</li> <?php } ?>
<?php if($street){ ?><li><i class="fa fa-arrow-circle-right"></i> <?php do_action('mep_event_location_street'); ?>
</li><?php } ?>
<?php if($city){ ?><li><i class="fa fa-arrow-circle-right"></i> <?php do_action('mep_event_location_city'); ?></li>
<?php } ?>
<?php if($state){ ?><li><i class="fa fa-arrow-circle-right"></i> <?php do_action('mep_event_location_state'); ?>
</li><?php } ?>
<?php if($country){ ?><li><i class="fa fa-arrow-circle-right"></i>
<?php do_action('mep_event_location_country'); ?><?php } ?>
</li>
</ul>
<?php
echo ob_get_clean();
}

View File

@ -10,82 +10,8 @@ function mep_ev_ticket_type($post_id){
if($mep_event_ticket_type){
?>
<?php echo "<h3 class='ex-sec-title'>".mep_get_label($post_id,'mep_event_ticket_type_text','Ticket Type:')."</h3>"; ?>
<table>
<?php
$count =1;
foreach ( $mep_event_ticket_type as $field ) {
$qty_t_type = $field['option_qty_t_type'];
$total_quantity = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0;
$default_qty = isset($field['option_default_qty_t']) && $field['option_default_qty_t'] > 0 ? $field['option_default_qty_t'] : 0;
$total_resv_quantity = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0;
$event_date = get_post_meta($post_id, 'event_start_date', true).' '.get_post_meta($post_id, 'event_start_time', true);
$total_sold = (int) mep_ticket_type_sold($post_id,$field['option_name_t'],$event_date);
$total_tickets = (int) $total_quantity - ((int) $total_sold + (int) $total_resv_quantity);
$total_seats = apply_filters('mep_total_ticket_of_type',$total_tickets,$post_id,$field);
$total_min_seat = apply_filters('mep_ticket_min_qty',0,$post_id,$field);
$default_quantity = apply_filters('mep_ticket_default_qty',$default_qty,$post_id,$field);
$total_left = apply_filters('mep_total_ticket_of_type',$total_tickets,$post_id,$field);
$passed = apply_filters('mep_ticket_type_validation',true);
?>
<tr>
<td align="Left"><?php echo $field['option_name_t']; ?>
<input type="hidden" name='mep_event_start_date[]' value="<?php echo get_post_meta($post_id, 'event_start_datetime', true); ?>">
<?php if($mep_available_seat=='on'){ ?><div class="xtra-item-left"><?php echo max($total_left,0); ?>
<?php echo mep_get_option('mep_left_text', 'label_setting_sec') ? mep_get_option('mep_left_text', 'label_setting_sec') : _e('Left:','mage-eventpress'); ?>
</div> <?php } ?>
</td>
<td class="ticket-qty">
<span class="tkt-qty">
<?php echo mep_get_option('mep_ticket_qty_text', 'label_setting_sec') ? mep_get_option('mep_ticket_qty_text', 'label_setting_sec') : _e('Ticket Qty:','mage-eventpress'); ?>
</span>
<?php
if($total_left>0){
if($qty_t_type=='dropdown'){ ?>
<select name="option_qty[]" id="eventpxtp_<?php echo $count; ?>" <?php if($total_left<=0){ ?> style='display: none!important;' <?php } ?> class='extra-qty-box etp'>
<?php
for ($i = $total_min_seat; $i <= $total_left; $i++) { ?>
<option value="<?php echo $i; ?>" <?php if($i == $default_quantity){ echo 'Selected'; } ?>><?php echo $i; ?>
<?php echo mep_get_option('mep_ticket_text', 'label_setting_sec') ? mep_get_option('mep_ticket_text', 'label_setting_sec') : _e('Ticket:','mage-eventpress'); ?>
</option>
<?php } ?>
</select>
<?php }else{ ?>
<div class="mage_input_group">
<span class="fa fa-minus qty_dec"></span>
<!--input id="eventpxtp_<?php echo $count; ?>" <?php //if($ext_left<=0){ echo "disabled"; } ?> type="text" class='extra-qty-box etp' name='option_qty[]' data-price='<?php echo $field['option_price_t']; ?>' value='<?php echo $default_quantity; ?>' min="<?php echo $default_quantity; ?>" max="<?php echo max($total_left,0); ?>"-->
<input id="eventpxtp_<?php echo $count; ?>" <?php //if($ext_left<=0){ echo "disabled"; } ?> type="text" class='extra-qty-box etp' name='option_qty[]' data-price='<?php echo $field['option_price_t']; ?>' value='<?php echo $default_quantity; ?>' min="<?php echo $total_min_seat; ?>" max="<?php echo max($total_seats,0); ?>">
<span class="fa fa-plus qty_inc"></span>
</div>
<?php } }else{ _e('No Seat Available','mage-eventpress'); }
$ticket_name = $field['option_name_t'];
do_action('mep_after_ticket_type_qty',$post_id,$ticket_name,$field,$default_quantity);
?>
</td>
<td class="ticket-price"><span class="tkt-pric">
<?php echo mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') ? mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') : _e('Per Ticket Price:','mage-eventpress'); ?>
</span> <strong><?php echo wc_price($field['option_price_t']); ?></strong>
<?php if($total_left>0){ ?>
<p style="display: none;" class="price_jq"><?php echo $field['option_price_t']; ?></p>
<input type="hidden" name='option_name[]' value='<?php echo $field['option_name_t']; ?>'>
<input type="hidden" name='option_price[]' value='<?php echo $field['option_price_t']; ?>'>
<input type="hidden" name='max_qty[]' value='<?php echo $field['option_max_qty']; ?>'>
<?php } ?>
</td>
</tr>
<tr>
<td colspan="3" class='user-innnf'> <div class="user-info-sec">
<div id="dadainfo_<?php echo $count; ?>" class="dada-info"></div></div>
</td>
</tr>
<?php $count++; } ?>
<?php do_action('mep_event_ticket_type_loop_list',$post_id); ?>
</table>
<?php
}

View File

@ -0,0 +1,96 @@
<?php
add_action('mep_event_ticket_type_loop_list', 'mep_event_ticket_type_loop_list_html');
function mep_event_ticket_type_loop_list_html($post_id)
{
$mep_available_seat = get_post_meta($post_id, 'mep_available_seat', true) ? get_post_meta($post_id, 'mep_available_seat', true) : 'on';
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
ob_start();
?>
<?php
$count = 1;
foreach ($mep_event_ticket_type as $field) {
$qty_t_type = $field['option_qty_t_type'];
$total_quantity = isset($field['option_qty_t']) ? $field['option_qty_t'] : 0;
$default_qty = isset($field['option_default_qty_t']) && $field['option_default_qty_t'] > 0 ? $field['option_default_qty_t'] : 0;
$total_resv_quantity = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0;
$event_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true);
$total_sold = (int) mep_ticket_type_sold($post_id, $field['option_name_t'], $event_date);
$total_tickets = (int) $total_quantity - ((int) $total_sold + (int) $total_resv_quantity);
$total_seats = apply_filters('mep_total_ticket_of_type', $total_tickets, $post_id, $field);
$total_min_seat = apply_filters('mep_ticket_min_qty', 0, $post_id, $field);
$default_quantity = apply_filters('mep_ticket_default_qty', $default_qty, $post_id, $field);
$total_left = apply_filters('mep_total_ticket_of_type', $total_tickets, $post_id, $field);
$ticket_price = apply_filters('mep_ticket_type_price', $field['option_price_t'], $field['option_name_t'], $post_id, $field);
$passed = apply_filters('mep_ticket_type_validation', true);
?>
<tr>
<td align="Left"><?php echo $field['option_name_t']; ?>
<input type="hidden" name='mep_event_start_date[]' value="<?php echo get_post_meta($post_id, 'event_start_datetime', true); ?>">
<?php if ($mep_available_seat == 'on') { ?><div class="xtra-item-left"><?php echo max($total_left, 0); ?>
<?php echo mep_get_option('mep_left_text', 'label_setting_sec') ? mep_get_option('mep_left_text', 'label_setting_sec') : _e('Left:', 'mage-eventpress'); ?>
</div> <?php } ?>
</td>
<td class="ticket-qty">
<span class="tkt-qty">
<?php echo mep_get_option('mep_ticket_qty_text', 'label_setting_sec') ? mep_get_option('mep_ticket_qty_text', 'label_setting_sec') : _e('Ticket Qty:', 'mage-eventpress'); ?>
</span>
<?php
if ($total_left > 0) {
if ($qty_t_type == 'dropdown') { ?>
<select name="option_qty[]" id="eventpxtp_<?php echo $count; ?>" <?php if ($total_left <= 0) { ?> style='display: none!important;' <?php } ?> class='extra-qty-box etp'>
<?php
for ($i = $total_min_seat; $i <= $total_left; $i++) { ?>
<option value="<?php echo $i; ?>" <?php if ($i == $default_quantity) {
echo 'Selected';
} ?>><?php echo $i; ?>
<?php echo mep_get_option('mep_ticket_text', 'label_setting_sec') ? mep_get_option('mep_ticket_text', 'label_setting_sec') : _e('Ticket:', 'mage-eventpress'); ?>
</option>
<?php } ?>
</select>
<?php } else { ?>
<div class="mage_input_group">
<span class="fa fa-minus qty_dec"></span>
<input id="eventpxtp_<?php echo $count; ?>" type="text" class='extra-qty-box etp' name='option_qty[]' data-price='<?php echo $ticket_price; ?>' value='<?php echo $default_quantity; ?>' min="<?php echo $total_min_seat; ?>" max="<?php echo max($total_seats, 0); ?>">
<span class="fa fa-plus qty_inc"></span>
</div>
<?php }
} else {
_e('No Seat Available', 'mage-eventpress');
}
$ticket_name = $field['option_name_t'];
do_action('mep_after_ticket_type_qty', $post_id, $ticket_name, $field, $default_quantity);
?>
</td>
<td class="ticket-price"><span class="tkt-pric">
<?php echo mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') ? mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') : _e('Per Ticket Price:', 'mage-eventpress'); ?>
</span> <strong><?php echo wc_price($ticket_price); ?></strong>
<?php if ($total_left > 0) { ?>
<p style="display: none;" class="price_jq"><?php echo $ticket_price; ?></p>
<input type="hidden" name='option_name[]' value='<?php echo $field['option_name_t']; ?>'>
<input type="hidden" name='option_price[]' value='<?php echo $ticket_price; ?>'>
<input type="hidden" name='max_qty[]' value='<?php echo $field['option_max_qty']; ?>'>
<?php } ?>
</td>
</tr>
<tr>
<td colspan="3" class='user-innnf'>
<div class="user-info-sec">
<div id="dadainfo_<?php echo $count; ?>" class="dada-info"></div>
</div>
</td>
</tr>
<?php $count++;
} ?>
<?php
$loop_list = ob_get_clean();
echo apply_filters('mep_event_ticket_type_loop', $loop_list, $post_id);
}

View File

@ -25,3 +25,4 @@ require_once(dirname(__FILE__) . "/event_loop_title.php");
require_once(dirname(__FILE__) . "/event_speakers_list.php");
require_once(dirname(__FILE__) . "/shortcode_add_cart_section.php");
require_once(dirname(__FILE__) . "/shortcode_speaker_list.php");
require_once(dirname(__FILE__) . "/event_ticket_type_loop_list.php");

View File

@ -535,4 +535,15 @@ Custom CSS Code section added into Event Settings
Event Settings Page Design Improved
Event Location & Date Show/Hide from Order Details and Email Body option added into the event settings
Multi Date Expand/Collapse option added into Event Details Page.
28 April 2020*
= 3.2.5 =
* Update Release:
Code Optimized & Improved
Fix Event Start Date Time Wrong Display issue
New Feature: You can hide Event Date & location from the cart section display
New Filter & Action hooks added
08 May 2020*

View File

@ -71,12 +71,14 @@ $speaker_status = mep_get_option('mep_enable_speaker_list', 'general
</div>
<div class="mep-default-sidebar">
<?php if ($hide_location_details == 'no') { ?>
<div class="mep-default-sidrbar-map">
<h3>
<?php echo mep_get_option('mep_event_location_text', 'label_setting_sec') ? mep_get_option('mep_event_location_text', 'label_setting_sec') : _e('Event Location:', 'mage-eventpress'); ?>
</h3>
<?php do_action('mep_event_map',get_the_id()); ?>
</div>
<?php } ?>
<div class="df-sidebar-part">
<?php if ($hide_total_seat_details == 'no') { ?>
<div class="mep-default-sidrbar-price-seat">
@ -91,14 +93,7 @@ $speaker_status = mep_get_option('mep_enable_speaker_list', 'general
if ($hide_address_details == 'no') { ?>
<div class="mep-default-sidrbar-address">
<ul>
<li><i class="fa fa-arrow-circle-right"></i> <?php do_action('mep_event_location_venue'); ?></li>
<li><i class="fa fa-arrow-circle-right"></i> <?php do_action('mep_event_location_street'); ?></li>
<li><i class="fa fa-arrow-circle-right"></i> <?php do_action('mep_event_location_city'); ?></li>
<li><i class="fa fa-arrow-circle-right"></i> <?php do_action('mep_event_location_state'); ?></li>
<li><i class="fa fa-arrow-circle-right"></i> <?php do_action('mep_event_location_country'); ?>
</li>
</ul>
<?php do_action('mep_event_address_list_sidebar',get_the_id()); ?>
</div>
<?php }
if ($hide_schedule_details == 'no') { ?>

View File

@ -3,7 +3,7 @@
* Plugin Name: Woocommerce Events Manager
* Plugin URI: http://mage-people.com
* Description: A Complete Event Solution for WordPress by MagePeople..
* Version: 3.2.4
* Version: 3.2.5
* Author: MagePeople Team
* Author URI: http://www.mage-people.com/
* Text Domain: mage-eventpress