wpim_save_reserve

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);

Reserve Form Actions

WP Inventory Reserve Form Actions

WP Inventory reserve form actions can really help you to build your brand and customize your presentation.  Another possibility is to add messages to the checkout page.  Options are seemingly endless.  Below and in the right hand side navigation; are links to various different action hooks with example code.

wpim_reserve_sent – This hook allows you to get information about an item that was reserved after the email is sent to the admin.  If Reserve Cart is installed and active, it runs for each item in the cart. This is run after error checking.  Only run if decrease quantity setting on reserve is set to true.

wpim_save_reserve – This hook runs after each item on reserve when it is being saved.  This is run after error checking.

reserve_confirmation – This hook runs at the time the email is being sent to the reserver.  Must have send email confirmation to customer set to on.

wpim_reserve_confirmation_sent – This hook fires after the reserve_confirmation hook.

 

 

wpim_reserve_sent

This action allows you to get four pieces of data in order to do something different with it after the reserve email has been sent.  This does not modify the info sent to the user, it is just available if you want to add it to another table in your database, send it to another person (like an admin of your site), etc.


function my_custom_function($inventory_id, $data, $subject, $message) {
$inventory_id; // Id of the inventory item that was just reserved
$data; // The array of information from the reserve form (not the cart data)
$subject; // Subject of the email
$message; // Message of the email

// Get the item information

$item_info = new WPIMItem(); // Get new instance of the item class
$item_info = $item_info->get( $inventory_id ); // use the get method with the inventory id to get item information

$name = $item_info->inventory_name;  // Example to fetch the item name

// Do whatever you want from here!

}

add_action('wpim_reserve_sent', 'my_custom_function', 10, 4); 

Filters

WP Inventory Manager Filters

Welcome to the documentation for WPIM filters

WP Inventory is built with developers in mind, and includes a long list of filters and actions that may be leveraged to control the way WP Inventory behaves.  You can use any number of the filters in the right hand sidebar.  If you feel we are missing one or would like to see something added, please reach out to us at [email protected].

For more information on WordPress filters, please refer to the WordPress Plugin API Filter Reference.