function update
This commit is contained in:
parent
8676f992ee
commit
5d2695c047
|
@ -740,7 +740,9 @@ function mep_check_attendee_exist_before_create($order_id, $event_id, $date ='')
|
|||
if(!class_exists( 'RP_SUB' )){
|
||||
if(!class_exists( 'Afterpay_Plugin' )){
|
||||
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')) {
|
||||
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_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_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);
|
||||
$event_date = date('Y-m-d H:i', strtotime(mep_get_event_upcoming_date($event_id)));
|
||||
|
||||
ob_start();
|
||||
if ($t == 'multi') {
|
||||
if ($recurring != 'no') {
|
||||
$total = (int)$total_seat * (int)$m;
|
||||
$sold = $total - ($total_sold + $total_resv);
|
||||
$available = $total - $sold;
|
||||
?>
|
||||
<span style="background: #dc3232;color: #fff;padding: 5px 10px;">
|
||||
<?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);
|
||||
?>
|
||||
</span>
|
||||
<span style="background: #dc3232;color: #fff;padding: 5px 10px; display:block">
|
||||
<span class="mep_seat_stat_info_<?php echo $event_id; ?>">
|
||||
<?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);
|
||||
?>
|
||||
</span>
|
||||
<?php //do_action('mep_after_seat_stat_info',$event_id); ?>
|
||||
</span>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<span style="background: #dc3232;color: #fff;padding: 5px 10px;">
|
||||
<?php
|
||||
// $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);
|
||||
?>
|
||||
</span>
|
||||
<span style="background: #dc3232;color: #fff;padding: 5px 10px; display:block">
|
||||
<span class="mep_seat_stat_info_<?php echo $event_id; ?>">
|
||||
<?php
|
||||
// $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);
|
||||
?>
|
||||
</span>
|
||||
<?php do_action('mep_after_seat_stat_info',$event_id); ?>
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
return ob_get_clean();
|
||||
|
@ -5313,7 +5319,6 @@ jQuery(document).on('change', '.mep_global_time_format', function () {
|
|||
return false;
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue