$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 ); } } } Contact - Profesional Immigration Services
contact

Do you have a question? Contact us.

We will be happy to answer all of your questions.

Office hours

Monday – Friday
08:00 – 17:00

Correspondence
address

Vajnorská 142
OFFICE 142
831 04 Bratislava
Slovakia

Billing
information

ImmiCo. s. r. o.
Vajnorská 142
831 04 Bratislava
IČO: 55 834 248
DIČ: 21 221 068 33

Office hours

Monday - Friday
08:00 - 17:00

Outside of office hours, call only in urgent cases such as assistance in crisis situations.

Where you can find us
Skip to content