version 3.8.7 release

This commit is contained in:
magepeopleteam 2023-03-20 05:07:11 +00:00
parent db5ee65625
commit e31f0b7e29
5 changed files with 128 additions and 22 deletions

View File

@ -352,7 +352,62 @@ if (!class_exists('MAGE_Events_Setting_Controls')) :
'yes' => 'Yes',
'no' => 'No'
)
),
),
// array(
// 'name' => 'mep_allow_multiple_add_cart_event',
// 'label' => __('Allow multiple Add to Cart of a Single event?', 'mage-eventpress'),
// 'desc' => __('By Default adding to the cart of a single event is disabled. If you want to enable it select Yes', 'mage-eventpress'),
// 'type' => 'select',
// 'default' => 'no',
// 'options' => array(
// 'yes' => 'Yes',
// 'no' => 'No'
// )
// ),
array(
'name' => 'mep_show_hidden_wc_product',
'label' => __('Show Hidden Woocommerce Products?', 'mage-eventpress'),
'desc' => __('With every creation of an event there is a Woocommerce product is also created. By default its hidden in the Product list. If you want to show them in the list select Yes', 'mage-eventpress'),
'type' => 'select',
'default' => 'no',
'options' => array(
'yes' => 'Yes',
'no' => 'No'
)
),
array(
'name' => 'mep_google_map_zoom_level',
'label' => __('Set the Google Map Zoom Level', 'mage-eventpress'),
'desc' => __('Select the Google Map zoom level. By default is 17', 'mage-eventpress'),
'type' => 'select',
'default' => '17',
'options' => array(
'5' => '5',
'6' => '6',
'7' => '7',
'8' => '8',
'9' => '9',
'10' => '10',
'11' => '11',
'12' => '12',
'13' => '13',
'14' => '14',
'15' => '15',
'16' => '16',
'17' => '17',
'18' => '18',
'19' => '19',
'20' => '20',
'21' => '21',
'22' => '22',
'23' => '23',
'24' => '24',
'25' => '25'
)
),
)
),
'event_list_setting_sec' => apply_filters('mep_settings_event_list_arr', array(
@ -1247,10 +1302,10 @@ function mep_get_option($option, $section, $default = '') {
$options = get_option($section);
if (isset($options[$option])) {
return $options[$option];
return esc_html($options[$option]);
}
return $default;
return esc_html($default);
}

View File

@ -613,6 +613,19 @@ function mep_check_attendee_exist_before_create($order_id, $event_id, $date ='')
}
}
// add_filter('mep_check_product_into_cart', 'mep_beta_disable_add_to_cart_if_product_is_in_cart', 90, 2);
function mep_beta_disable_add_to_cart_if_product_is_in_cart($is_purchasable, $product){
$all_multiple_cart = mep_get_option('mep_allow_multiple_add_cart_event', 'general_setting_sec', 'no');
if($all_multiple_cart == 'yes'){
return true;
}
}
add_action('woocommerce_checkout_order_processed', 'mep_event_booking_management', 90);
add_action('__experimental_woocommerce_blocks_checkout_order_processed', 'mep_event_booking_management', 90);
// add_action('woocommerce_blocks_checkout_order_processed', 'mep_event_booking_management', 90);
@ -687,7 +700,10 @@ function mep_check_attendee_exist_before_create($order_id, $event_id, $date ='')
$item_quantity = 0;
$check_before_create = mep_check_attendee_exist_before_create($order_id,$event_id);
mep_attendee_extra_service_create($order_id,$event_id,$_event_extra_service);
mep_delete_attandee_of_an_order($order_id, $event_id);
foreach ( $event_ticket_info_arr as $field ) {
if($field['ticket_qty']>0){
$item_quantity = $item_quantity + $field['ticket_qty'];
@ -696,22 +712,44 @@ function mep_check_attendee_exist_before_create($order_id, $event_id, $date ='')
if(is_array($user_info_arr) & sizeof($user_info_arr) > 0){
foreach ($user_info_arr as $_user_info) {
$check_before_create_date = mep_check_attendee_exist_before_create($order_id,$event_id, $_user_info['user_event_date']);
// if($check_before_create < count($user_info_arr)){
// if($check_before_create_date == 0){
if(function_exists('mep_re_language_load')){
mep_attendee_create('user_form',$order_id,$event_id,$_user_info);
// }
// }
}else{
if($check_before_create < count($user_info_arr)){
if($check_before_create_date == 0){
mep_attendee_create('user_form',$order_id,$event_id,$_user_info);
}
}
}
}
}else{
foreach($event_ticket_info_arr as $tinfo){
for ($x = 1; $x <= $tinfo['ticket_qty']; $x++) {
$check_before_create_date = mep_check_attendee_exist_before_create($order_id,$event_id, $tinfo['event_date']);
// if($check_before_create < count($event_ticket_info_arr)){
// if($check_before_create_date == 0){
if(function_exists('mep_re_language_load')){
mep_attendee_create('billing',$order_id,$event_id,$tinfo);
// }
// }
}else{
if($check_before_create < count($event_ticket_info_arr)){
if($check_before_create_date == 0){
mep_attendee_create('billing',$order_id,$event_id,$tinfo);
}
}
}
}
}
@ -742,6 +780,15 @@ function mep_check_attendee_exist_before_create($order_id, $event_id, $date ='')
}
}
if (!function_exists('mep_diff_two_datetime')) {
function mep_diff_two_datetime($d1,$d2){
$timeFirst = strtotime($d1);
$timeSecond = strtotime($d2);
return $differenceInSeconds = $timeSecond - $timeFirst;
}
}
if (!function_exists('mep_delete_attandee_of_an_order')) {
function mep_delete_attandee_of_an_order($order_id, $event_id) {
@ -759,14 +806,9 @@ function mep_delete_attandee_of_an_order($order_id, $event_id) {
'value' => $event_id,
'compare' => '='
),
// array(
// 'key' => 'ea_flag',
// 'value' => 'checkout_processed',
// 'compare' => '='
// )
array(
'key' => 'ea_order_status',
'value' => 'pending',
'key' => 'ea_flag',
'value' => 'checkout_processed',
'compare' => '='
)
)
@ -774,11 +816,16 @@ function mep_delete_attandee_of_an_order($order_id, $event_id) {
$loop = new WP_Query($args);
foreach ($loop->posts as $ticket) {
$post_id = $ticket->ID;
wp_delete_post($post_id, true);
$post_date = get_the_date('Y-m-d H:i:s',$post_id);
$time_diff = mep_diff_two_datetime($post_date,current_time('Y-m-d H:i:s'));
if($time_diff > 15){
wp_delete_post($post_id, true);
}
}
}
}
if (!function_exists('change_attandee_order_status')) {
function change_attandee_order_status($order_id, $set_status, $post_status, $qr_status = null) {
add_filter('wpseo_public_post_statuses', 'mepfix_sitemap_exclude_post_type', 5);
@ -2944,6 +2991,7 @@ if (!function_exists('mep_hide_date_from_order_page')) {
function mep_hide_date_from_order_page() {
$product_id = [];
$hide_wc = mep_get_option('mep_show_hidden_wc_product', 'general_setting_sec', 'no');
$args = array(
'post_type' => 'mep_events',
'posts_per_page' => -1
@ -2955,8 +3003,10 @@ function mep_hide_date_from_order_page() {
}
$product_id = array_filter($product_id);
$parr = implode(', ', $product_id);
if($hide_wc == 'no'){
echo '<style> ' . esc_html($parr) . '{display:none!important}' . ' </style>';
}
}
}

View File

@ -174,7 +174,7 @@ if (!function_exists('mep_get_event_reg_btn')) {
<button type="submit" class="mpwemasp_get_sp"><?php esc_html_e("View Seat Plan","mage-eventpress"); ?></button>
<?php }if($not_in_the_cart){ ?>
<button type="submit" name="add-to-cart" value="<?php echo esc_attr($cart_product_id); ?>" class="button-default woocommerce button alt button alt btn-mep-event-cart"><?php do_action('mep_before_add_cart_button',$post_id); echo "<span class='mep-cart-btn-text'>".esc_html($cart_btn_label)."</span>"; do_action('mep_after_add_cart_button',$post_id); ?></button>
<?php }else{ ?>
<?php }else{ ?>
<a href="<?php echo wc_get_cart_url(); ?>" class="button-default woocommerce button alt button alt btn-mep-event-cart"><?php esc_html_e('You"ve already added this item to your cart! View your cart to continue shopping or checkout now.', 'mage-eventpress'); ?> </a>
<?php } ?>
<?php do_action('mep_after_add_cart_btn',$post_id); ?>

View File

@ -9,6 +9,7 @@ if (!function_exists('mep_event_google_map')) {
{
global $post, $event_meta, $user_api;
$map_type = mep_get_option('mep_google_map_type', 'general_setting_sec', 'iframe');
$map_zoom = mep_get_option('mep_google_map_zoom_level', 'general_setting_sec', '17');
$location_sts = get_post_meta($event_id, 'mep_org_address', true) ? get_post_meta($event_id, 'mep_org_address', true) : '';
$status = get_post_meta($event_id, 'mep_sgm', true) ? get_post_meta($event_id, 'mep_sgm', true) : '';
ob_start();
@ -43,7 +44,7 @@ if (!function_exists('mep_event_google_map')) {
lat: <?php echo esc_attr($lat); ?>,
lng: <?php echo esc_attr($lon); ?>
},
zoom: 17
zoom: <?php echo $map_zoom; ?>
});
marker = new google.maps.Marker({
map: map,

View File

@ -3,7 +3,7 @@
* Plugin Name: Event Manager and Tickets Selling Plugin for WooCommerce
* Plugin URI: http://mage-people.com
* Description: A Complete Event Solution for WordPress by MagePeople..
* Version: 3.8.6
* Version: 3.8.7
* Author: MagePeople Team
* Author URI: http://www.mage-people.com/
* Text Domain: mage-eventpress