Tribe__Tickets__Commerce__PayPal__Main::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/Tribe/Commerce/PayPal/Main.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;
}
$this->decrease_ticket_sales_by( $product_id, 1, $shared_capacity, $global_stock );
}
Changelog
| Version | Description |
|---|---|
| 4.10.5 | Introduced. |