Description
The “gform_zapier_products” filter allows the products array to be modified before it is sent to Zapier.
Usage
add_filter( 'gform_zapier_products', 'your_function_name', 10, 3 );
Parameters
- $products array
An array of product information.
-
$form Form Object
The form object.
-
$entry Entry Object
The current entry.
Examples
add_filter( 'gform_zapier_products', 'modify_products', 10, 3 ); function modify_products( $products, $form, $entry ){ $products[] = array( 'product_id' => 'TEST01', 'product_name' => 'Test Product', 'product_quantity' => 2, 'product_price' => 5, 'product_price_with_options' => 5, 'product_subtotal' => 10, 'product_options' => 'Blue' ); return $products; }
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFZapier::get_products_array() in gravityformszapier/zapier.php.