version 3.9.4 release
This commit is contained in:
parent
bd0ce6ef2e
commit
73872bf91b
|
@ -2521,8 +2521,8 @@ if (!function_exists('mep_mep_events_column')) {
|
||||||
if ($recurring == 'yes') {
|
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();
|
$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 : '';
|
$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 {
|
} else {
|
||||||
echo mep_get_event_total_seat($post_id);
|
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');
|
add_action('admin_head', 'mep_hide_date_from_order_page');
|
||||||
if (!function_exists('mep_hide_date_from_order_page')) {
|
if (!function_exists('mep_hide_date_from_order_page')) {
|
||||||
|
function mep_hide_date_from_order_page() {
|
||||||
function mep_hide_date_from_order_page() {
|
$product_id = [];
|
||||||
$product_id = [];
|
$hide_wc = mep_get_option('mep_show_hidden_wc_product', 'general_setting_sec', 'no');
|
||||||
$hide_wc = mep_get_option('mep_show_hidden_wc_product', 'general_setting_sec', 'no');
|
$args = array(
|
||||||
$args = array(
|
'post_type' => 'mep_events',
|
||||||
'post_type' => 'mep_events',
|
'posts_per_page' => -1
|
||||||
'posts_per_page' => -1
|
);
|
||||||
);
|
$qr = new WP_Query($args);
|
||||||
$qr = new WP_Query($args);
|
foreach ($qr->posts as $result) {
|
||||||
foreach ($qr->posts as $result) {
|
$post_id = $result->ID;
|
||||||
$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[] = 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');
|
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);
|
$product_id = array_filter($product_id);
|
||||||
return $product_id;
|
return $product_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', 'mep_get_all_hidden_product_id_array' );
|
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');
|
// add_action('parse_query', 'mep_product_tags_sorting_query');
|
||||||
if (!function_exists('mep_product_tags_sorting_query')) {
|
if (!function_exists('mep_product_tags_sorting_query')) {
|
||||||
function mep_product_tags_sorting_query($query) {
|
function mep_product_tags_sorting_query($query) {
|
||||||
|
@ -4722,86 +4715,73 @@ function mep_location_existis($meta_name, $event_id) {
|
||||||
* Functions Dev by @Ariful
|
* Functions Dev by @Ariful
|
||||||
**************************/
|
**************************/
|
||||||
if (!function_exists('mep_elementor_get_events')) {
|
if (!function_exists('mep_elementor_get_events')) {
|
||||||
function mep_elementor_get_events($default) {
|
function mep_elementor_get_events($default) {
|
||||||
$args = array('post_type' => 'mep_events',);
|
$args = array('post_type' => 'mep_events',);
|
||||||
$list = array('0' => $default);
|
$list = array('0' => $default);
|
||||||
|
$the_query = new WP_Query($args);
|
||||||
$the_query = new WP_Query($args);
|
if ($the_query->have_posts()) {
|
||||||
|
while ($the_query->have_posts()) {
|
||||||
|
$the_query->the_post();
|
||||||
if ($the_query->have_posts()) {
|
$list[get_the_id()] = get_the_title();
|
||||||
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')) {
|
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) {
|
if ($thumbnail_id > 0) {
|
||||||
$thumbnail = wp_get_attachment_image_src($thumbnail_id, $size);
|
$thumbnail = wp_get_attachment_image_src($thumbnail_id, $size);
|
||||||
echo esc_attr(is_array($thumbnail) && sizeof($thumbnail) > 0 ? $thumbnail[0] : '');
|
echo esc_attr(is_array($thumbnail) && sizeof($thumbnail) > 0 ? $thumbnail[0] : '');
|
||||||
} else {
|
} else {
|
||||||
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($event_id), $size);
|
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($event_id), $size);
|
||||||
echo esc_attr(is_array($thumbnail) && sizeof($thumbnail) > 0 ? $thumbnail[0] : '');
|
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);
|
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')) {
|
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) {
|
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())) {
|
||||||
// Loop through cart items checking if the product is already in cart
|
foreach (WC()->cart->get_cart() as $cart_item) {
|
||||||
if (isset(WC()->cart) && !is_admin() && !empty(WC()->cart->get_cart())) {
|
if ($cart_item['data']->get_id() == $product) {
|
||||||
foreach (WC()->cart->get_cart() as $cart_item) {
|
return false;
|
||||||
if ($cart_item['data']->get_id() == $product) {
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $is_purchasable;
|
||||||
}
|
}
|
||||||
return $is_purchasable;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mep_get_default_lang_event_id')) {
|
if (!function_exists('mep_get_default_lang_event_id')) {
|
||||||
function mep_get_default_lang_event_id($event_id) {
|
function mep_get_default_lang_event_id($event_id) {
|
||||||
global $sitepress;
|
global $sitepress;
|
||||||
$multi_lang_plugin = mep_get_option('mep_multi_lang_plugin', 'general_setting_sec', 'none');
|
$multi_lang_plugin = mep_get_option('mep_multi_lang_plugin', 'general_setting_sec', 'none');
|
||||||
|
|
||||||
if ($multi_lang_plugin == 'polylang') {
|
if ($multi_lang_plugin == 'polylang') {
|
||||||
// Get PolyLang ID
|
// Get PolyLang ID
|
||||||
$defaultLanguage = function_exists('pll_default_language') ? pll_default_language() : get_locale();
|
$defaultLanguage = function_exists('pll_default_language') ? pll_default_language() : get_locale();
|
||||||
$translations = function_exists('pll_get_post_translations') ? pll_get_post_translations($event_id) : [];
|
$translations = function_exists('pll_get_post_translations') ? pll_get_post_translations($event_id) : [];
|
||||||
$event_id = sizeof($translations) > 0 ? $translations[$defaultLanguage] : $event_id;
|
$event_id = sizeof($translations) > 0 ? $translations[$defaultLanguage] : $event_id;
|
||||||
|
|
||||||
} elseif ($multi_lang_plugin == 'wpml') {
|
} elseif ($multi_lang_plugin == 'wpml') {
|
||||||
// WPML
|
// WPML
|
||||||
$default_language = function_exists('wpml_loaded') ? $sitepress->get_default_language() : get_locale(); // will return 'en'
|
$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);
|
$event_id = apply_filters('wpml_object_id', $event_id, 'mep_events', TRUE, $default_language);
|
||||||
|
} else {
|
||||||
} else {
|
$event_id = $event_id;
|
||||||
|
}
|
||||||
$event_id = $event_id;
|
return $event_id;
|
||||||
|
|
||||||
}
|
}
|
||||||
return $event_id;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,7 +10,7 @@ if (!function_exists('mep_get_event_reg_btn')) {
|
||||||
{
|
{
|
||||||
global $post, $event_meta;
|
global $post, $event_meta;
|
||||||
$event_id = mep_get_default_lang_event_id($event_id);
|
$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 = 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';
|
$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'){
|
// 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){ ?>
|
<?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>
|
<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>
|
<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 } ?>
|
||||||
<?php do_action('mep_after_add_cart_btn',$post_id); ?>
|
<?php do_action('mep_after_add_cart_btn',$post_id); ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -196,7 +196,8 @@ if (!function_exists('mep_ev_date')) {
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_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;
|
$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_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();
|
$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();
|
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;
|
$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_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);
|
$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 = (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_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 = (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_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_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);
|
$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);
|
$default_quantity = apply_filters('mep_ticket_default_qty', $default_qty, $post_id, $field);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* Plugin Name: Event Manager and Tickets Selling Plugin for WooCommerce
|
* Plugin Name: Event Manager and Tickets Selling Plugin for WooCommerce
|
||||||
* 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: 3.9.3
|
* Version: 3.9.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
|
||||||
|
|
Loading…
Reference in New Issue