Ticket::update_stock_after_deletion( int $ticket_id, int $post_id, int $product_id )
Update Stock and Global Stock when deleting an Attendee
Contents
Parameters
- $ticket_id
-
(int) (Required) the attendee id being deleted
- $post_id
-
(int) (Required) the post or event id for the attendee
- $product_id
-
(int) (Required) the ticket-product id in Tribe Commerce
Source
File: src/Tickets/Commerce/Ticket.php
public function update_stock_after_deletion( $ticket_id, $post_id, $product_id ) {
$global_stock = new \Tribe__Tickets__Global_Stock( $post_id );
$shared_capacity = false;
if ( $global_stock->is_enabled() ) {
$shared_capacity = true;
}
tribe( Module::class )->decrease_ticket_sales_by( $product_id, 1, $shared_capacity, $global_stock );
}
Changelog
| Version | Description |
|---|---|
| 5.1.9 | Introduced. |