From f5e86da4245efd7a78aec90f0264056726bd4ecf Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Wed, 21 Sep 2022 06:49:00 +0000 Subject: [PATCH] file update --- inc/admin_setting_panel.php | 24 +++++++- inc/mep_enque.php | 3 + inc/mep_functions.php | 81 ++++++++++++++++++++------- inc/template-prts/event_loop_list.php | 6 +- templates/themes/default-theme.php | 3 +- 5 files changed, 91 insertions(+), 26 deletions(-) diff --git a/inc/admin_setting_panel.php b/inc/admin_setting_panel.php index fb5985a..1199cbf 100644 --- a/inc/admin_setting_panel.php +++ b/inc/admin_setting_panel.php @@ -259,7 +259,29 @@ if (!class_exists('MAGE_Events_Setting_Controls')) : 'type' => 'text', 'default' => '0', 'placeholder' => '15' - ), + ), + array( + 'name' => 'mep_load_fontawesome_from_theme', + 'label' => __('Load Font Awesome From Theme?', 'mage-eventpress'), + 'desc' => __('It the icons are not working, and you want to remove Font Awesome load from the plugin select Yes', 'mage-eventpress'), + 'type' => 'select', + 'default' => 'no', + 'options' => array( + 'yes' => 'Yes', + 'no' => 'No' + ) + ), + array( + 'name' => 'mep_speed_up_list_page', + 'label' => __('Speed up the Event List Page Loading?', 'mage-eventpress'), + 'desc' => __('If your event list page is loading slow, you can select this as Yes. WHen its set as Yes, the Waitlist and Seat count base Ribon will not work on the list page. ', 'mage-eventpress'), + 'type' => 'select', + 'default' => 'no', + 'options' => array( + 'yes' => 'Yes', + 'no' => 'No' + ) + ), ) ), 'event_list_setting_sec' => apply_filters('mep_settings_event_list_arr', array( diff --git a/inc/mep_enque.php b/inc/mep_enque.php index e0bd511..1a70adc 100644 --- a/inc/mep_enque.php +++ b/inc/mep_enque.php @@ -97,6 +97,7 @@ add_action('wp_enqueue_scripts', 'mep_event_enqueue_scripts', 90); function mep_event_enqueue_scripts() { $owlThemeLoad = mep_get_option('mep_load_carousal_from_theme', 'carousel_setting_sec', 'no'); + $fontAwesoneLoad = mep_get_option('mep_load_fontawesome_from_theme', 'general_setting_sec', 'no'); wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-datepicker'); @@ -106,8 +107,10 @@ function mep_event_enqueue_scripts() wp_enqueue_style('mep-event-style', plugin_dir_url(__DIR__) . 'css/style.css', array(),time()); wp_enqueue_style('filter_pagination', plugin_dir_url(__DIR__) . 'css/filter_pagination.css', array()); wp_enqueue_style('mep-event-timeline-min-style', plugin_dir_url(__DIR__) . 'css/timeline.min.css', array('mep-event-style')); + if($fontAwesoneLoad == 'no'){ 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()); wp_enqueue_script('mep-calendar-scripts', plugin_dir_url(__DIR__) . 'js/calendar.min.js', array('jquery', 'mep-moment-js'), 1, false); diff --git a/inc/mep_functions.php b/inc/mep_functions.php index 3425dd2..32a0df3 100755 --- a/inc/mep_functions.php +++ b/inc/mep_functions.php @@ -737,9 +737,11 @@ function mep_check_attendee_exist_before_create($order_id, $event_id, $date ='') } } do_action('mep_after_event_booking',$order_id,$order->get_status()); - if(!class_exists('WC_Xendit_CC')){ - $woocommerce->cart->empty_cart(); - } + if(!class_exists('WC_Xendit_CC')){ + if(!class_exists( 'PaysonCheckout_For_WooCommerce' )){ + $woocommerce->cart->empty_cart(); + } + } } } } @@ -1873,10 +1875,15 @@ if (!function_exists('mep_get_event_city')) { if (!function_exists('mep_get_total_available_seat')) { function mep_get_total_available_seat($event_id, $event_meta) { - $total_seat_left = get_post_meta($event_id,'mep_total_seat_left',true) ? get_post_meta($event_id,'mep_total_seat_left',true) : mep_count_total_available_seat($event_id); + $availabele_check = mep_get_option('mep_speed_up_list_page', 'general_setting_sec', 'no'); + if($availabele_check == 'no'){ + $total_seat_left = get_post_meta($event_id,'mep_total_seat_left',true) ? get_post_meta($event_id,'mep_total_seat_left',true) : mep_count_total_available_seat($event_id); + }else{ + $total_seat_left = get_post_meta($event_id,'mep_total_seat_left',true) ? get_post_meta($event_id,'mep_total_seat_left',true) : 1; + } return esc_html($total_seat_left); } - } +} if (!function_exists('mep_count_total_available_seat')) { @@ -2507,10 +2514,23 @@ if (!function_exists('mep_event_total_seat')) { if (!function_exists('get_mep_datetime')) { function get_mep_datetime($date, $type) { $event_id = get_the_id() ? get_the_id() : 0; - // $date_format = get_option('date_format'); - $date_format = mep_get_datetime_format($event_id,'date'); + // $date_format = get_option('date_format'); + // $time_format = get_option('time_format'); + + + + + + + + + + + + + $date_format = mep_get_datetime_format($event_id,'date'); $date_format_timezone = mep_get_datetime_format($event_id,'date_timezone'); - // $time_format = get_option('time_format'); + $time_format = mep_get_datetime_format($event_id,'time'); $time_format_timezone = mep_get_datetime_format($event_id,'time_timezone'); @@ -2688,6 +2708,7 @@ if (!function_exists('mep_on_post_publish')) { update_post_meta($pid, 'link_mep_event', $post_id); update_post_meta($pid, '_price', 0.01); update_post_meta($pid, '_sold_individually', 'yes'); + update_post_meta($pid, '_downloadable', $product_type); update_post_meta($pid, '_virtual', $product_type); $terms = array('exclude-from-catalog', 'exclude-from-search'); wp_set_object_terms($pid, $terms, 'product_visibility'); @@ -2754,21 +2775,24 @@ if (!function_exists('mep_wc_link_product_on_save')) { update_post_meta($product_id, '_sku', $sku); - $update__tax_status = update_post_meta($product_id, '_tax_status', $_tax_status); - $update__tax_class = update_post_meta($product_id, '_tax_class', $_tax_class); - $update__tax_class = update_post_meta($product_id, '_stock_status', 'instock'); - $update__tax_class = update_post_meta($product_id, '_manage_stock', 'no'); - $update__tax_class = update_post_meta($product_id, '_virtual', $product_type); - $update__tax_class = update_post_meta($product_id, '_sold_individually', 'yes'); + update_post_meta($product_id, '_tax_status', $_tax_status); + update_post_meta($product_id, '_tax_class', $_tax_class); + update_post_meta($product_id, '_stock_status', 'instock'); + update_post_meta($product_id, '_manage_stock', 'no'); + update_post_meta($product_id, '_virtual', $product_type); + update_post_meta($product_id, '_sold_individually', 'yes'); + update_post_meta($product_id, '_downloadable', $product_type); + + wp_set_post_terms($product_id, $product_cat_ids, 'product_cat'); $terms = array('exclude-from-catalog', 'exclude-from-search'); wp_set_object_terms($product_id, $terms, 'product_visibility'); // Update post $my_post = array( - 'ID' => $product_id, - 'post_title' => $event_name, // new title - 'post_name' => uniqid()// do your thing here + 'ID' => $product_id, + 'post_title' => $event_name, // new title + 'post_name' => uniqid()// do your thing here ); // unhook this function so it doesn't loop infinitely @@ -4870,6 +4894,8 @@ function mep_event_pro_purchase_notice(){ function mep_get_datetime_format($event_id=0,$type='date'){ + $custom_format = get_post_meta($event_id,'mep_enable_custom_dt_format',true) ? get_post_meta($event_id,'mep_enable_custom_dt_format',true) : 'off'; + $date_format = get_option('date_format'); $time_format = get_option('time_format'); @@ -4880,10 +4906,12 @@ function mep_get_datetime_format($event_id=0,$type='date'){ $current_global_timezone_display = mep_get_option('mep_global_timezone_display','datetime_setting_sec','no'); - $saved_date_format = get_post_meta($event_id,'mep_event_date_format',true) ? get_post_meta($event_id,'mep_event_date_format',true) : $current_date_format; - $saved_custom_date_format = get_post_meta($event_id,'mep_event_custom_date_format',true) ? get_post_meta($event_id,'mep_event_custom_date_format',true) : $current_global_custom_date_format; - $saved_time_format = get_post_meta($event_id,'mep_event_time_format',true) ? get_post_meta($event_id,'mep_event_time_format',true) : $current_time_format; - $saved_custom_time_format = get_post_meta($event_id,'mep_custom_event_time_format',true) ? get_post_meta($event_id,'mep_custom_event_time_format',true) : $current_global_custom_time_format; + $saved_date_format = $custom_format == 'on' && get_post_meta($event_id,'mep_event_date_format',true) ? get_post_meta($event_id,'mep_event_date_format',true) : $current_date_format; + + + $saved_custom_date_format = $custom_format == 'on' && get_post_meta($event_id,'mep_event_custom_date_format',true) ? get_post_meta($event_id,'mep_event_custom_date_format',true) : $current_global_custom_date_format; + $saved_time_format = $custom_format == 'on' && get_post_meta($event_id,'mep_event_time_format',true) ? get_post_meta($event_id,'mep_event_time_format',true) : $current_time_format; + $saved_custom_time_format = $custom_format == 'on' && get_post_meta($event_id,'mep_custom_event_time_format',true) ? get_post_meta($event_id,'mep_custom_event_time_format',true) : $current_global_custom_time_format; $saved_time_zone_display = get_post_meta($event_id,'mep_time_zone_display',true) ? get_post_meta($event_id,'mep_time_zone_display',true) : $current_global_timezone_display; @@ -5146,6 +5174,17 @@ jQuery(document).on('change', '.mep_global_time_format', function () { return false; }); + - \ No newline at end of file + +