version 3.9.4 release

This commit is contained in:
magepeopleteam 2023-05-30 07:03:29 +00:00
parent bd0ce6ef2e
commit 73872bf91b
5 changed files with 69 additions and 94 deletions

View File

@ -2521,8 +2521,8 @@ if (!function_exists('mep_mep_events_column')) {
if ($recurring == 'yes') {
$more_date = get_post_meta($post_id, 'mep_event_more_date', true) ? get_post_meta($post_id, 'mep_event_more_date', true) : array();
$event_more_dates = is_array($more_date) && sizeof($more_date) > 0 ? count($more_date) + 1 : '';
echo mep_get_event_total_seat($post_id, $event_more_dates, 'multi');
echo apply_filters( 'mep_attendee_stat_recurring', mep_get_event_total_seat($post_id, $event_more_dates, 'multi'),$post_id);
} else {
echo mep_get_event_total_seat($post_id);
}
@ -3015,26 +3015,24 @@ if (!function_exists('mep_wc_link_product_on_save')) {
add_action('admin_head', 'mep_hide_date_from_order_page');
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
);
$qr = new WP_Query($args);
foreach ($qr->posts as $result) {
$post_id = $result->ID;
$product_id[] = get_post_meta($post_id, 'link_wc_product', true) ? '.woocommerce-page .post-' . get_post_meta($post_id, 'link_wc_product', true) . '.type-product' : '';
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
);
$qr = new WP_Query($args);
foreach ($qr->posts as $result) {
$post_id = $result->ID;
$product_id[] = get_post_meta($post_id, 'link_wc_product', true) ? '.woocommerce-page .post-' . get_post_meta($post_id, 'link_wc_product', true) . '.type-product' : '';
}
$product_id = array_filter($product_id);
$parr = implode(', ', $product_id);
if($hide_wc == 'no'){
echo '<style> ' . esc_html($parr) . '{display:none!important}' . ' </style>';
}
}
$product_id = array_filter($product_id);
$parr = implode(', ', $product_id);
if($hide_wc == 'no'){
echo '<style> ' . esc_html($parr) . '{display:none!important}' . ' </style>';
}
}
}
add_action('init','mep_get_all_hidden_product_id_array');
@ -3052,15 +3050,10 @@ function mep_get_all_hidden_product_id_array() {
$product_id = array_filter($product_id);
return $product_id;
}
add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', 'mep_get_all_hidden_product_id_array' );
// add_action('parse_query', 'mep_product_tags_sorting_query');
if (!function_exists('mep_product_tags_sorting_query')) {
function mep_product_tags_sorting_query($query) {
@ -4722,86 +4715,73 @@ function mep_location_existis($meta_name, $event_id) {
* Functions Dev by @Ariful
**************************/
if (!function_exists('mep_elementor_get_events')) {
function mep_elementor_get_events($default) {
$args = array('post_type' => 'mep_events',);
$list = array('0' => $default);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) {
while ($the_query->have_posts()) {
$the_query->the_post();
$list[get_the_id()] = get_the_title();
function mep_elementor_get_events($default) {
$args = array('post_type' => 'mep_events',);
$list = array('0' => $default);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) {
while ($the_query->have_posts()) {
$the_query->the_post();
$list[get_the_id()] = get_the_title();
}
}
wp_reset_postdata();
return $list;
}
wp_reset_postdata();
return $list;
}
}
if (!function_exists('mep_get_list_thumbnail_src')) {
function mep_get_list_thumbnail_src($event_id,$size='full') {
function mep_get_list_thumbnail_src($event_id,$size='full') {
$thumbnail_id = get_post_meta($event_id, 'mep_list_thumbnail', true) ? get_post_meta($event_id, 'mep_list_thumbnail', true) : 0;
$thumbnail_id = get_post_meta($event_id, 'mep_list_thumbnail', true) ? get_post_meta($event_id, 'mep_list_thumbnail', true) : 0;
if ($thumbnail_id > 0) {
$thumbnail = wp_get_attachment_image_src($thumbnail_id, $size);
echo esc_attr(is_array($thumbnail) && sizeof($thumbnail) > 0 ? $thumbnail[0] : '');
} else {
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($event_id), $size);
echo esc_attr(is_array($thumbnail) && sizeof($thumbnail) > 0 ? $thumbnail[0] : '');
if ($thumbnail_id > 0) {
$thumbnail = wp_get_attachment_image_src($thumbnail_id, $size);
echo esc_attr(is_array($thumbnail) && sizeof($thumbnail) > 0 ? $thumbnail[0] : '');
} else {
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($event_id), $size);
echo esc_attr(is_array($thumbnail) && sizeof($thumbnail) > 0 ? $thumbnail[0] : '');
}
}
}
}
add_filter('mep_check_product_into_cart', 'mep_disable_add_to_cart_if_product_is_in_cart', 10, 2);
if (!function_exists('mep_disable_add_to_cart_if_product_is_in_cart')) {
function mep_disable_add_to_cart_if_product_is_in_cart($is_purchasable, $product) {
// Loop through cart items checking if the product is already in cart
if (isset(WC()->cart) && !is_admin() && !empty(WC()->cart->get_cart())) {
foreach (WC()->cart->get_cart() as $cart_item) {
if ($cart_item['data']->get_id() == $product) {
return false;
function mep_disable_add_to_cart_if_product_is_in_cart($is_purchasable, $product) {
// Loop through cart items checking if the product is already in cart
if (isset(WC()->cart) && !is_admin() && !empty(WC()->cart->get_cart())) {
foreach (WC()->cart->get_cart() as $cart_item) {
if ($cart_item['data']->get_id() == $product) {
return false;
}
}
}
return $is_purchasable;
}
return $is_purchasable;
}
}
if (!function_exists('mep_get_default_lang_event_id')) {
function mep_get_default_lang_event_id($event_id) {
global $sitepress;
$multi_lang_plugin = mep_get_option('mep_multi_lang_plugin', 'general_setting_sec', 'none');
function mep_get_default_lang_event_id($event_id) {
global $sitepress;
$multi_lang_plugin = mep_get_option('mep_multi_lang_plugin', 'general_setting_sec', 'none');
if ($multi_lang_plugin == 'polylang') {
// Get PolyLang ID
$defaultLanguage = function_exists('pll_default_language') ? pll_default_language() : get_locale();
$translations = function_exists('pll_get_post_translations') ? pll_get_post_translations($event_id) : [];
$event_id = sizeof($translations) > 0 ? $translations[$defaultLanguage] : $event_id;
if ($multi_lang_plugin == 'polylang') {
// Get PolyLang ID
$defaultLanguage = function_exists('pll_default_language') ? pll_default_language() : get_locale();
$translations = function_exists('pll_get_post_translations') ? pll_get_post_translations($event_id) : [];
$event_id = sizeof($translations) > 0 ? $translations[$defaultLanguage] : $event_id;
} elseif ($multi_lang_plugin == 'wpml') {
// WPML
$default_language = function_exists('wpml_loaded') ? $sitepress->get_default_language() : get_locale(); // will return 'en'
$event_id = apply_filters('wpml_object_id', $event_id, 'mep_events', TRUE, $default_language);
} else {
$event_id = $event_id;
} elseif ($multi_lang_plugin == 'wpml') {
// WPML
$default_language = function_exists('wpml_loaded') ? $sitepress->get_default_language() : get_locale(); // will return 'en'
$event_id = apply_filters('wpml_object_id', $event_id, 'mep_events', TRUE, $default_language);
} else {
$event_id = $event_id;
}
return $event_id;
}
return $event_id;
}
}
/**

View File

@ -10,7 +10,7 @@ if (!function_exists('mep_get_event_reg_btn')) {
{
global $post, $event_meta;
$event_id = mep_get_default_lang_event_id($event_id);
$new_registration_system_sp = get_post_meta($event_id, 'mpwemasp_seat_plan_system', true) ? get_post_meta($event_id, 'mpwemasp_seat_plan_system', true) : 'off';
$new_registration_system_sp = get_post_meta($event_id, 'mpwemasp_seat_plan_system', true) ? get_post_meta($event_id, 'mpwemasp_seat_plan_system', true) : 'off';
$seat_plan = get_post_meta($event_id, 'mepsp_event_seat_plan_info', true) ? get_post_meta($event_id, 'mepsp_event_seat_plan_info', true) : [];
$seat_plan_visible = get_post_meta($event_id, 'mp_event_seat_plan_visible', true) ? get_post_meta($event_id, 'mp_event_seat_plan_visible', true) : '1';
// if(class_exists('MP_ESP_Frontend') && sizeof($seat_plan) > 0 && $seat_plan_visible ==2 &&$new_registration_system_sp=='on'){
@ -175,7 +175,7 @@ if (!function_exists('mep_get_event_reg_btn')) {
<?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{ ?>
<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>
<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 have 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); ?>
</td>

View File

@ -196,7 +196,8 @@ if (!function_exists('mep_ev_date')) {
}
} else {
?>
<p><?php echo apply_filters('mep_display_date_only',get_mep_datetime($start_datetime, 'date-text'),$event_id); ?></p>
<p><?php
echo apply_filters('mep_display_date_only',get_mep_datetime($start_datetime, 'date-text'),$event_id); ?></p>
<?php
}
}

View File

@ -12,7 +12,6 @@ if (!function_exists('mep_event_ticket_type_loop_list_html')) {
$event_order_by = mep_get_option('mep_event_list_order_by', 'general_setting_sec', 'meta_value');
$event_expire_on = $event_expire_on_old == 'event_end_datetime' ? 'event_expire_datetime' : $event_expire_on_old;
$mep_available_seat = get_post_meta($post_id, 'mep_available_seat', true) ? get_post_meta($post_id, 'mep_available_seat', true) : 'on';
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
ob_start();
@ -48,18 +47,13 @@ if (!function_exists('mep_event_ticket_type_loop_list_html')) {
$total_resv_quantity = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0;
$event_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true);
$event_start_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true);
// $total_sold = (int) mep_ticket_type_sold($post_id, $ticket_type_name, $event_date);
$total_sold = mep_get_ticket_type_seat_count($post_id,$ticket_type_name,$event_date,$total_quantity,$total_resv_quantity);
$total_tickets = (int) $total_quantity - ((int) $total_sold + (int) $total_resv_quantity);
// $total_tickets = mep_get_ticket_type_seat_count($post_id,$ticket_type_name,$event_date,$total_quantity,$total_resv_quantity);
$total_seats = apply_filters('mep_total_ticket_of_type', $total_tickets, $post_id, $field, $event_date);
$total_min_seat = apply_filters('mep_ticket_min_qty', 0, $post_id, $field);
$default_quantity = apply_filters('mep_ticket_default_qty', $default_qty, $post_id, $field);

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