version 2.2.0 released with some bug fix and a new feature

This commit is contained in:
magepeopleteam 2018-11-29 07:08:43 +00:00
parent 1e18ab2704
commit 41db5d7601
6 changed files with 52 additions and 25 deletions

View File

@ -24,6 +24,8 @@ function mep_event_meta_box_add(){
add_meta_box( 'mep-event-reg-on-off', 'Registration Status', 'mep_event_change_reg_status_cb', 'mep_events', 'side', 'low' );
add_meta_box( 'mep-event-available-set-on-off', 'Show Available Seat Count?', 'mep_event_available_seat_cb', 'mep_events', 'side', 'low' );
}
function mep_event_change_reg_status_cb($post){
@ -40,20 +42,41 @@ function mep_event_change_reg_status_cb($post){
<?php
}
function mep_event_available_seat_cb($post){
$values = get_post_custom( $post->ID );
?>
<div class='sec'>
<label for="mep_ev_209882"> <?php _e('Show Available Seat?','mage-eventpress'); echo $values['mep_available_seat'][0]; ?>
<label class="switch">
<input type="checkbox" id="mep_ev_209882" name='mep_available_seat' <?php if(array_key_exists('mep_available_seat', $values)){ if($values['mep_available_seat'][0]=='on'){ echo 'checked'; } }else{ echo 'Checked'; } ?>/>
<span class="slider round"></span>
</label>
</label>
</div>
<?php
}
add_action('save_post','mep_reg_status_meta_save');
function mep_reg_status_meta_save($post_id){
if($_POST['mep_reg_status']){
$mep_reg_status = strip_tags($_POST['mep_reg_status']);
}else{
$mep_reg_status = 'off';
}
if($_POST['mep_available_seat']){
$mep_available_seat = strip_tags($_POST['mep_available_seat']);
}else{
$mep_available_seat = 'off';
}
$update_seat = update_post_meta( $post_id, 'mep_reg_status', $mep_reg_status);
$update_ava_seat = update_post_meta( $post_id, 'mep_available_seat', $mep_available_seat);
$update_seat = update_post_meta( $post_id, 'mep_reg_status', $mep_reg_status);
}

View File

@ -243,4 +243,7 @@ You can display the event list on any page by using the ShortCode. Just use this
*Update Release, Event Expired Listing Query Issue has been fixed in this version.. 06 Nov 2018*
*= 2.1.9 =
*Update Release, Custom email sending issue has been fixed. 28 Nov 2018*
*Update Release, Custom email sending issue has been fixed. 28 Nov 2018*
*= 2.2.0 =
*Update Release, Fixed no numeric error, and add feature to hide available seat count. 29 Nov 2018*

View File

@ -41,7 +41,7 @@ foreach ($mep_event_ticket_type as $field ) {
$tesqn = $post_id.str_replace(' ', '', $qm);
$tesq = get_post_meta($post_id,"mep_xtra_$tesqn",true);
$stc = $stc+$field['option_qty_t'];
$llft = ($field['option_qty_t'] - $tesq);
$llft = ($field['option_qty_t'] - (int)$tesq);
$leftt = $leftt+$llft;
}
}else{$qm='';}
@ -78,7 +78,6 @@ if(array_key_exists('mep_reg_status', $event_meta)){
}
// echo $reg_status;

View File

@ -3,10 +3,15 @@
add_action('mep_event_ticket_types','mep_ev_ticket_type');
function mep_ev_ticket_type(){
global $post, $product;
global $post, $product,$event_meta;
$pid = $post->ID;
$count=1;
if(array_key_exists('mep_available_seat', $event_meta)){
$mep_available_seat = $event_meta['mep_available_seat'][0];
}else{
$mep_available_seat = 'on';
}
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true);
if($mep_event_ticket_type){
@ -20,12 +25,12 @@ foreach ( $mep_event_ticket_type as $field ) {
$qm = $field['option_name_t'];
$tesqn = $pid.str_replace(' ', '', $qm);
$tesq = get_post_meta($pid,"mep_xtra_$tesqn",true);
$llft = ($field['option_qty_t'] - $tesq);
$llft = ($field['option_qty_t'] - (int)$tesq);
$qty_t_type = $field['option_qty_t_type'];
?>
<tr>
<td align="Left"><?php echo $field['option_name_t']; ?>
<div class="xtra-item-left"><?php echo $llft; ?> <?php _e('Left','mage-eventpress'); ?></div>
<?php if($mep_available_seat=='on'){ ?><div class="xtra-item-left"><?php echo $llft; ?> <?php _e('Left','mage-eventpress'); ?></div> <?php } ?>
</td>
<td class="ticket-qty">
<span class="tkt-qty"> <?php _e('Ticket Qty:','mage-eventpress'); ?> </span>

View File

@ -7,6 +7,12 @@ function mep_ev_seat(){
$mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true);
// echo "Hello";
// print_r($mep_event_ticket_type);
if(array_key_exists('mep_available_seat', $event_meta)){
$mep_available_seat = $event_meta['mep_available_seat'][0];
}else{
$mep_available_seat = 'on';
}
if($mep_event_ticket_type){
$stc = 0;
@ -22,28 +28,19 @@ $tesq = get_post_meta($post->ID,"mep_xtra_$tesqn",true);
$stc = $stc+$field['option_qty_t'];
$llft = ($field['option_qty_t'] - $tesq);
$llft = ($field['option_qty_t'] - (int)$tesq);
$leftt = $leftt+$llft;
}
?>
<h5><strong><?php _e('Total Seat:','mage-eventpress'); ?></strong> <?php echo $stc; ?> (<strong><?php echo $leftt; ?></strong> Left)</h5>
<h5><strong><?php _e('Total Seat:','mage-eventpress'); ?></strong> <?php echo $stc; if($mep_available_seat=='on'){ ?> (<strong><?php echo $leftt; ?></strong> Left)<?php } ?></h5>
<?php
}else{
if($event_meta['mep_total_seat'][0]){ ?>
<h5><strong><?php _e('Total Seat:','mage-eventpress'); ?></strong> <?php echo $event_meta['mep_total_seat'][0]; ?> (<strong><?php echo ($event_meta['mep_total_seat'][0]- $total_book); ?></strong> Left)</h5>
<h5><strong><?php _e('Total Seat:','mage-eventpress'); ?></strong> <?php echo $event_meta['mep_total_seat'][0]; if($mep_available_seat=='on'){ ?> (<strong><?php echo ($event_meta['mep_total_seat'][0]- $total_book); ?></strong> Left) <?php } ?></h5>
<?php }
}
}
}

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: 2.1.9
* Version: 2.2.0
* Author: MagePeople Team
* Author URI: http://www.mage-people.com/
* Text Domain: mage-eventpress