Skip to content

Commit

Permalink
deploy: 6fa431f
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Nov 4, 2024
1 parent 7663234 commit 4a6d8dd
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions mt-tickets.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,17 @@
* @return bool
*/
function mt_change_ticket_type( $payment_id, $event_id, $ticket, $type ) {
$registration = get_post_meta( $event_id, '_mt_registration_options', true );
$purchase = get_post_meta( $payment_id, '_purchased', true );
$ticket_data = get_post_meta( $event_id, '_' . $ticket, true );
$old_type = $ticket_data['type'];
$ticket_data['type'] = $type;
$result = update_post_meta( $event_id, '_' . $ticket, $ticket_data );
$prices = $registration['prices'];
$registration = get_post_meta( $event_id, '_mt_registration_options', true );
$purchase = get_post_meta( $payment_id, '_purchased', true );
$ticket_data = get_post_meta( $event_id, '_' . $ticket, true );
$purchase_ticket = get_post_meta( $payment_id, $ticket, true );
$old_type = $ticket_data['type'];
$ticket_data['type'] = $type;
$purchase_ticket['type'] = $type;
$result = update_post_meta( $event_id, '_' . $ticket, $ticket_data );
$result2 = update_post_meta( $payment_id, $ticket, $purchase_ticket );
$prices = $registration['prices'];

if ( 'continuous' !== $registration['counting_method'] ) {
$old_type_sold = $prices[ $old_type ]['sold'] - 1;
$new_type_sold = $prices[ $type ]['sold'] + 1;
Expand Down

0 comments on commit 4a6d8dd

Please sign in to comment.