function update

This commit is contained in:
magepeopleteam 2022-12-02 04:54:20 +00:00
parent 8676f992ee
commit 5d2695c047
1 changed files with 25 additions and 20 deletions

View File

@ -740,7 +740,9 @@ function mep_check_attendee_exist_before_create($order_id, $event_id, $date ='')
if(!class_exists( 'RP_SUB' )){ if(!class_exists( 'RP_SUB' )){
if(!class_exists( 'Afterpay_Plugin' )){ if(!class_exists( 'Afterpay_Plugin' )){
if(!class_exists( 'WC_Subscriptions' )){ if(!class_exists( 'WC_Subscriptions' )){
$woocommerce->cart->empty_cart(); if ( !is_plugin_active( 'woo-juno/main.php' )){
$woocommerce->cart->empty_cart();
}
} }
} }
} }
@ -2396,40 +2398,44 @@ if (!function_exists('mep_wc_price')) {
if (!function_exists('mep_get_event_total_seat')) { if (!function_exists('mep_get_event_total_seat')) {
function mep_get_event_total_seat($event_id, $m = null, $t = null) { function mep_get_event_total_seat($event_id, $m = null, $t = null) {
$upcoming_date = !empty($m) && !empty(mep_get_event_upcoming_date($event_id)) ? mep_get_event_upcoming_date($event_id) : ''; $upcoming_date = !empty($m) && !empty(mep_get_event_upcoming_date($event_id)) ? mep_get_event_upcoming_date($event_id) : '';
$total_seat = apply_filters('mep_event_total_seat_counts', mep_event_total_seat($event_id, 'total'), $event_id); $total_seat = apply_filters('mep_event_total_seat_counts', mep_event_total_seat($event_id, 'total'), $event_id);
$total_resv = apply_filters('mep_event_total_resv_seat_count', mep_event_total_seat($event_id, 'resv'), $event_id); $total_resv = apply_filters('mep_event_total_resv_seat_count', mep_event_total_seat($event_id, 'resv'), $event_id);
$total_sold = mep_get_event_total_seat_left($event_id, $upcoming_date); $total_sold = mep_get_event_total_seat_left($event_id, $upcoming_date);
//$total_sold = mep_ticket_type_sold($event_id); //$total_sold = mep_ticket_type_sold($event_id);
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$total_left = (int) $total_seat - ((int) $total_sold + (int) $total_resv); $total_left = (int) $total_seat - ((int) $total_sold + (int) $total_resv);
$event_date = date('Y-m-d H:i', strtotime(mep_get_event_upcoming_date($event_id))); $event_date = date('Y-m-d H:i', strtotime(mep_get_event_upcoming_date($event_id)));
ob_start(); ob_start();
if ($t == 'multi') { if ($recurring != 'no') {
$total = (int)$total_seat * (int)$m; $total = (int)$total_seat * (int)$m;
$sold = $total - ($total_sold + $total_resv); $sold = $total - ($total_sold + $total_resv);
$available = $total - $sold; $available = $total - $sold;
?> ?>
<span style="background: #dc3232;color: #fff;padding: 5px 10px;"> <span style="background: #dc3232;color: #fff;padding: 5px 10px; display:block">
<?php <span class="mep_seat_stat_info_<?php echo $event_id; ?>">
$seat_count_var = apply_filters('mep_event_total_seat_counts', $total, $event_id) . ' - ' . apply_filters('mep_event_total_seat_sold', $available, $event_id, $event_date) . ' = ' . apply_filters('mep_event_total_seat_left', $sold, $event_id, '', $event_date); <?php
$seat_count_var = apply_filters('mep_event_total_seat_counts', $total, $event_id) . ' - ' . apply_filters('mep_event_total_seat_sold', $available, $event_id, $event_date) . ' = ' . apply_filters('mep_event_total_seat_left', $sold, $event_id, '', $event_date);
echo apply_filters('mep_event_seat_status_text', $seat_count_var, $total, $available, $sold); echo apply_filters('mep_event_seat_status_text', $seat_count_var, $total, $available, $sold);
?> ?>
</span> </span>
<?php //do_action('mep_after_seat_stat_info',$event_id); ?>
</span>
<?php <?php
} else { } else {
?> ?>
<span style="background: #dc3232;color: #fff;padding: 5px 10px;"> <span style="background: #dc3232;color: #fff;padding: 5px 10px; display:block">
<?php <span class="mep_seat_stat_info_<?php echo $event_id; ?>">
// $sold = ($total_seat - $total_left); <?php
$seat_count_var = apply_filters('mep_event_total_seat_counts', $total_seat, $event_id) . ' - ' . apply_filters('mep_event_total_seat_sold', $total_sold, $event_id, $event_date) . ' = ' . apply_filters('mep_event_total_seat_left', $total_left, $event_id, '', $event_date); // $sold = ($total_seat - $total_left);
$seat_count_var = apply_filters('mep_event_total_seat_counts', $total_seat, $event_id) . ' - ' . apply_filters('mep_event_total_seat_sold', $total_sold, $event_id, $event_date) . ' = ' . apply_filters('mep_event_total_seat_left', $total_left, $event_id, '', $event_date);
echo apply_filters('mep_event_seat_status_text', $seat_count_var, $total_seat, $total_sold, $total_left); echo apply_filters('mep_event_seat_status_text', $seat_count_var, $total_seat, $total_sold, $total_left);
?> ?>
</span> </span>
<?php do_action('mep_after_seat_stat_info',$event_id); ?>
</span>
<?php <?php
} }
return ob_get_clean(); return ob_get_clean();
@ -5313,7 +5319,6 @@ jQuery(document).on('change', '.mep_global_time_format', function () {
return false; return false;
}); });
</script> </script>
<?php <?php
} }