ver 2.6.4 released

This commit is contained in:
magepeopleteam 2019-06-19 12:17:19 +00:00
parent 81cfef40c0
commit 76fb94c81c
3 changed files with 99 additions and 8 deletions

View File

@ -23,14 +23,39 @@ function mep_event_meta_box_add(){
add_meta_box( 'mep-event-available-set-on-off', __('Show Available Seat Count?','mage-eventpress'), 'mep_event_available_seat_cb', 'mep_events', 'side', 'low' ); add_meta_box( 'mep-event-available-set-on-off', __('Show Available Seat Count?','mage-eventpress'), 'mep_event_available_seat_cb', 'mep_events', 'side', 'low' );
add_meta_box( 'mep-event-day-details', __('Event Daywise Details','mage-eventpress'), 'mep_event_day_details_cb', 'mep_events', 'normal', 'high' );
add_meta_box( 'mep-event-day-details', __('Event Daywise Details','mage-eventpress'), 'mep_event_day_details_cb', 'mep_events', 'normal', 'high' ); add_meta_box( 'mep-event-day-details', __('Event Daywise Details','mage-eventpress'), 'mep_event_day_details_cb', 'mep_events', 'normal', 'high' );
if(get_option( 'woocommerce_calc_taxes' )=='yes'){ if(get_option( 'woocommerce_calc_taxes' )=='yes'){
add_meta_box( 'mep-event-tax-sec', __('Event Tax','mage-eventpress'), 'mep_event_tax_cb', 'mep_events', 'side', 'low' ); add_meta_box( 'mep-event-tax-sec', __('Event Tax','mage-eventpress'), 'mep_event_tax_cb', 'mep_events', 'side', 'low' );
}
}
add_meta_box( 'mep-event-rest-count-sec', __('Event Reset Booking Count','mage-eventpress'), 'mep_event_reset_booking_count', 'mep_events', 'side', 'low' );
} }
function mep_event_reset_booking_count($post){
$values = get_post_custom( $post->ID );
wp_nonce_field( 'mep_event_reset_btn_nonce', 'mep_event_reset_btn_nonce' );
?>
<div class='sec'>
<h6><? _e('Current Status','mage-eventpress'); echo mep_get_event_total_seat($post->ID); ?></h6>
<p style="color: red;"><?php _e('If you reset this count, All booking information will be removed including attendee list & its impossible to undo','mage-eventpress'); ?></p>
<label for="mep_ev_20988999"> <?php _e('Reset Booking Count :','mage-eventpress'); ?>
<label class="switch">
<input type="checkbox" id="mep_ev_20988999" name='mep_reset_status'/>
<span class="slider round"></span>
</label>
</label>
</div>
<?php
}
function mep_event_change_reg_status_cb($post){ function mep_event_change_reg_status_cb($post){
$values = get_post_custom( $post->ID ); $values = get_post_custom( $post->ID );
wp_nonce_field( 'mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce' ); wp_nonce_field( 'mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce' );
@ -47,6 +72,11 @@ function mep_event_change_reg_status_cb($post){
} }
function mep_event_tax_cb($post){ function mep_event_tax_cb($post){
$values = get_post_custom( $post->ID ); $values = get_post_custom( $post->ID );
wp_nonce_field( 'mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce' ); wp_nonce_field( 'mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce' );
@ -131,12 +161,28 @@ if(isset($_POST['mep_reg_status'])){
} }
if(isset($_POST['mep_reset_status'])){
$mep_reset_status = strip_tags($_POST['mep_reset_status']);
}else{
$mep_reset_status = 'off';
}
if(isset($_POST['mep_available_seat'])){ if(isset($_POST['mep_available_seat'])){
$mep_available_seat = strip_tags($_POST['mep_available_seat']); $mep_available_seat = strip_tags($_POST['mep_available_seat']);
}else{ }else{
$mep_available_seat = 'off'; $mep_available_seat = 'off';
} }
if($mep_reset_status=='on'){
mep_reset_event_booking($post_id);
}
if(isset($_POST['_tax_status'])){ if(isset($_POST['_tax_status'])){
$_tax_status = strip_tags($_POST['_tax_status']); $_tax_status = strip_tags($_POST['_tax_status']);
}else{ }else{

View File

@ -341,3 +341,10 @@ A. you can create support ticket here with problem details with possible screens
==> Add Ticket Number into CSV File ==> Add Ticket Number into CSV File
==> Dynamic Column feature in CSV file ==> Dynamic Column feature in CSV file
11 June 2019* 11 June 2019*
*= 2.6.4 =
*Update Release:
==> Booking counting duplicating issue fixed in free event.
==> Add new feature Reset Booking count option.
19 June 2019*

View File

@ -3,7 +3,7 @@
* Plugin Name: Woocommerce Events Manager * Plugin Name: Woocommerce Events Manager
* Plugin URI: http://mage-people.com * Plugin URI: http://mage-people.com
* Description: A Complete Event Solution for WordPress by MagePeople.. * Description: A Complete Event Solution for WordPress by MagePeople..
* Version: 2.6.3 * Version: 2.6.4
* Author: MagePeople Team * Author: MagePeople Team
* Author URI: http://www.mage-people.com/ * Author URI: http://www.mage-people.com/
* Text Domain: mage-eventpress * Text Domain: mage-eventpress
@ -250,7 +250,7 @@ if (get_post_type($event_id) == 'mep_events') {
add_action('woocommerce_order_status_changed', 'your_function', 10, 4); // add_action('woocommerce_order_status_changed', 'your_function', 10, 4);
add_action('woocommerce_order_status_changed', 'mep_event_seat_management', 10, 4); add_action('woocommerce_order_status_changed', 'mep_event_seat_management', 10, 4);
function mep_event_seat_management( $order_id, $from_status, $to_status, $order ) { function mep_event_seat_management( $order_id, $from_status, $to_status, $order ) {
global $wpdb; global $wpdb;
@ -382,6 +382,7 @@ update_post_meta( $event_id, $mep_atnd, "a2");
update_post_meta( $event_id, $order_meta_text, $order_completed); update_post_meta( $event_id, $order_meta_text, $order_completed);
}elseif($mep_stock_msg=='pending'){ }elseif($mep_stock_msg=='pending'){
if($ordr_total>0){
update_post_meta( $event_id, 'total_booking', ($mep_total_booking+$item_quantity)); update_post_meta( $event_id, 'total_booking', ($mep_total_booking+$item_quantity));
update_post_meta( $event_id, $order_meta_text, $order_completed); update_post_meta( $event_id, $order_meta_text, $order_completed);
@ -394,9 +395,7 @@ update_post_meta( $event_id, $mep_atnd, "a2");
update_post_meta( $event_id, "mep_xtra_$order_option_name",$ntes); update_post_meta( $event_id, "mep_xtra_$order_option_name",$ntes);
} }
} }
}
} }
else{ else{
@ -1360,6 +1359,45 @@ function mep_get_event_total_seat($event_id){
function mep_reset_event_booking($event_id){
$mep_event_ticket_type = get_post_meta($event_id, 'mep_event_ticket_type', true);
if($mep_event_ticket_type){
foreach ( $mep_event_ticket_type as $field ) {
$qm = $field['option_name_t'];
$tesqn = $event_id.str_replace(' ', '', $qm);
$reset = update_post_meta($event_id,"mep_xtra_$tesqn",0);
}
// if($reset){ return 'Reset Done!'; }
}else{
$reset = update_post_meta($event_id,"total_booking",0);
// if($reset){ return 'Reset Done!'; }
}
$args_search_qqq = array (
'post_type' => array( 'mep_events_attendees' ),
'posts_per_page' => -1,
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => 'ea_event_id',
'value' => $event_id,
'compare' => '='
)
)
);
$loop = new WP_Query($args_search_qqq);
while ($loop->have_posts()) {
$loop->the_post();
$post_id = get_the_id(); // change this to your post ID
$status = 'trash';
$current_post = get_post( $post_id, 'ARRAY_A' );
$current_post['post_status'] = $status;
wp_update_post($current_post);
}
}
// Add the custom columns to the book post type: // Add the custom columns to the book post type:
add_filter( 'manage_mep_events_posts_columns', 'mep_set_custom_mep_events_columns' ); add_filter( 'manage_mep_events_posts_columns', 'mep_set_custom_mep_events_columns' );
function mep_set_custom_mep_events_columns($columns) { function mep_set_custom_mep_events_columns($columns) {