Set Requested Inventory by Field Value

Code

Filename: gpi-set-requested-quantity-by-field-value.php

<?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_quantity_input_ids_123_4', function( $input_ids, $field ) {
	// Update "5" to the ID of the field that should be used to specify the quantity.
	return array( 5 );
}, 10, 2 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.