file update

This commit is contained in:
magepeopleteam 2022-09-21 06:49:00 +00:00
parent 1f14202b81
commit f5e86da424
5 changed files with 91 additions and 26 deletions

View File

@ -260,6 +260,28 @@ if (!class_exists('MAGE_Events_Setting_Controls')) :
'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(

View File

@ -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);

View File

@ -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) {
$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;
});
</script>
<?php
}
add_filter('mep_event_loop_list_available_seat', 'mep_speed_up_list_page',5,2);
if (!function_exists('mep_speed_up_list_page')) {
function mep_speed_up_list_page($available,$event_id) {
$availabele_check = mep_get_option('mep_speed_up_list_page', 'general_setting_sec', 'no');
$available = $availabele_check == 'yes' ? 1 : $available;
return 1;
}
}

View File

@ -22,8 +22,8 @@ if (!function_exists('mep_display_event_loop_list')) {
$org_class = mep_get_term_as_class($event_id, 'mep_org',$unq_id);
$cat_class = mep_get_term_as_class($event_id, 'mep_cat',$unq_id);
$event_multidate = array_key_exists('mep_event_more_date', $event_meta) ? maybe_unserialize($event_meta['mep_event_more_date'][0]) : array();
$available_seat = mep_get_total_available_seat($event_id, $event_meta);
// $available_seat = 1;
$available_seat = apply_filters('mep_event_loop_list_available_seat', mep_get_total_available_seat($event_id, $event_meta), $event_id);
// $available_seat = 1;
$hide_org_list = mep_get_option('mep_event_hide_organizer_list', 'event_list_setting_sec', 'no');
$hide_location_list = mep_get_option('mep_event_hide_location_list', 'event_list_setting_sec', 'no');
$hide_time_list = mep_get_option('mep_event_hide_time_list', 'event_list_setting_sec', 'no');
@ -31,7 +31,7 @@ if (!function_exists('mep_display_event_loop_list')) {
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$event_type = get_post_meta(get_the_id(), 'mep_event_type', true) ? get_post_meta(get_the_id(), 'mep_event_type', true) : 'offline';
ob_start();
require(mep_template_file_path('list/default.php'));
require(mep_template_file_path('list/default.php'));
do_action('mep_event_list_loop_end', $event_id); ?>
</div>
<?php

View File

@ -127,3 +127,4 @@ $event_organizer_icon = mep_get_option('mep_event_organizer_icon', 'icon_s
</div>
</div>
</div>