This function runs during save. It runs for each item. So, with core WPIM only, it runs after each reservation because only one item can be reserved at a time with just core. If you have Reserve Cart, then this runs for each item in the cart.
function my_custom_function($inventory_id, $quantity, $original_quantity) {
$inventory_id; // Item id
$quantity; // Quantity reserved
$original_quantity; // The quantity the item had at the time of the reserve (not including the reduction)
// Get the item information
$item_info = new WPIMItem(); // Call new instance of WPIMItem class
$item_info = $item_info->get( $inventory_id ); // Get the item information with inventory id
$name = $item_info->inventory_name; // Example of how you would get the name of an item
// Do whatever you want from here!
}
add_action('wpim_save_reserve', 'my_custom_function', 10, 3);
