Description
Filter the requested inventory amount.
Usage
Apply to all applicable fields on all forms.
add_filter( 'gpi_requested_quantity', 'my_custom_function' );
Apply to all applicable fields on a specific form.
add_filter( 'gpi_requested_quantity_FORMID', 'my_custom_function' );
Apply to a specific field on a specific form.
add_filter( 'gpi_requested_quantity_FORMID_FIELDID', 'my_custom_function' );
Parameters
Since
This filter is available since Gravity Forms Inventory 1.0-beta-1.1.
Examples
Set Requested Quantity by Field Value
<?php
/**
* Gravity Perks // Inventory // Set Requested Inventory by Field Value
* https://gravitywiz.com/documentation/gravity-forms-inventory/
*/
// Update "123" to your form ID and "4" to your Inventory-enabled field.
add_filter( 'gpi_requested_quantity_123_4', function( $requested_quantity ) {
// Update "5" to the ID of the field that should be used to specify the quantity.
return rgpost( 'input_5' );
} );