$ticket['etn_sold_tickets'] = $ticket['etn_sold_tickets'] + 1; } } } $event->update([ 'etn_ticket_variations' => $event_tickets, 'etn_total_sold_tickets' => (int) $event->etn_total_sold_tickets + 1 ]); } /** * Decrese event ticket variation amount after refunded * * @param OrderModel $order The order need to refund * * @return void */ public function decrese_event_sold_ticket_after_refund( OrderModel $order ) { if ( 'refunded' != $order->status ) { return; } $event = new Event_Model( $order->event_id ); $event_tickets = $event->etn_ticket_variations; if ( $event_tickets ) { foreach( $event_tickets as &$ticket ) { $ticket_amount = $order->get_total_ticket_by_ticket( $ticket['etn_ticket_slug'] ); if ( $ticket_amount > 0 ) { $ticket['etn_sold_tickets'] = $ticket['etn_sold_tickets'] - $ticket_amount; } } } $event->update([ 'etn_ticket_variations' => $event_tickets, ]); // Update seat on refunded. $event_seats = get_post_meta( $event->id, '_etn_seat_unique_id', true ); $order_seats = $order->seat_ids; if ( $order_seats ) { $event_seats = explode(',', $event_seats ); $event_seats = array_diff( $event_seats, $order_seats ); $event_seats = implode( ',', array_unique( $event_seats ) ); update_post_meta( $event->id, '_etn_seat_unique_id', $event_seats ); } } } Blogs - Profesional Immigration Services
Blogs

Fees at the Foreign Police and Embassies will increase from 1. 4. 2024

Administrative fees related to the foreign agenda will increase at the beginning of April...
Skip to content