From e7737b49eddcf98f70be2cfc5100bca824b5eeef Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Wed, 12 Apr 2023 07:11:24 +0000 Subject: [PATCH] v 3.9.1 release --- inc/mep_functions.php | 43 +++++++++++++++++++++++++++++-------- woocommerce-event-press.php | 2 +- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/inc/mep_functions.php b/inc/mep_functions.php index ff2cc05..daf1d64 100755 --- a/inc/mep_functions.php +++ b/inc/mep_functions.php @@ -6,6 +6,13 @@ if (!defined('ABSPATH')) { appsero_init_tracker_mage_eventpress(); +function mep_add_event_into_feed_request($qv) { + if (isset($qv['feed']) && !isset($qv['post_type'])) + $qv['post_type'] = array('mep_events'); + return $qv; +} +add_filter('request', 'mep_add_event_into_feed_request'); + // Language Load add_action('init', 'mep_language_load'); if (!function_exists('mep_language_load')) { @@ -762,7 +769,9 @@ function mep_beta_disable_add_to_cart_if_product_is_in_cart($is_purchasable, $pr if(!class_exists( 'Afterpay_Plugin' )){ if(!class_exists( 'WC_Subscriptions' )){ if ( !is_plugin_active( 'woo-juno/main.php' )){ - $woocommerce->cart->empty_cart(); + if ( ! class_exists( 'WC_Saferpay' ) ) { + $woocommerce->cart->empty_cart(); + } } } } @@ -1930,8 +1939,7 @@ if (!function_exists('mep_event_list_price')) { $price_arr[] = array_key_exists('option_price_t',$ticket) ? $ticket['option_price_t'] : null; } } - - return $type == 'price' && sizeof($price_arr) > 0 ? wc_price(min($price_arr)) : count($price_arr); + return $type == 'price' && sizeof($price_arr) > 0 ? wc_price(mep_get_price_including_tax($pid,min($price_arr))) : count($price_arr); } } @@ -2540,6 +2548,9 @@ if (!function_exists('mep_get_term_as_class')) { + + + if (!function_exists('mep_ticket_type_sold')) { function mep_ticket_type_sold($event_id, $type = '', $date = '') { $type = !empty($type) ? $type : ''; @@ -2548,11 +2559,24 @@ if (!function_exists('mep_ticket_type_sold')) { $_order_status = !empty($_user_set_status) ? $_user_set_status : array('processing','completed'); $order_status = array_values($_order_status); - $order_status_filter = array( - 'key' => 'ea_order_status', - 'value' => $order_status, - 'compare' => 'OR' - ); + // $order_status_filter = array( + // 'key' => 'ea_order_status', + // 'value' => $order_status, + // 'compare' => 'OR' + // ); + + + if ( count( $order_status ) > 1 ) { // check if more then one tag + $order_status_filter['relation'] = 'OR'; + + foreach($order_status as $tag) { // create a LIKE-comparison for every single tag + $order_status_filter[] = array( 'key' => 'ea_order_status', 'value' => $tag, 'compare' => '=' ); + } + + } else { // if only one tag then proceed with simple query + $order_status_filter[] = array( 'key' => 'ea_order_status', 'value' => $order_status[0], 'compare' => '=' ); + } + $type_filter = !empty($type) ? array( 'key' => 'ea_ticket_type', @@ -2585,7 +2609,8 @@ if (!function_exists('mep_ticket_type_sold')) { ) ); $loop = new WP_Query($args); - + // echo '
'; print_r($loop); echo '
'; + // // die(); return $loop->post_count; } } diff --git a/woocommerce-event-press.php b/woocommerce-event-press.php index 19775f4..a9e3008 100644 --- a/woocommerce-event-press.php +++ b/woocommerce-event-press.php @@ -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.0 + * Version: 3.9.1 * Author: MagePeople Team * Author URI: http://www.mage-people.com/ * Text Domain: mage-eventpress