gpecf_discount_total (JS)
Description
Modify the calculated discount for a Discount field.
This filter must be used with its PHP counterpart to handle filtering the discount amount on submission.
Usage
gform.addFilter( 'gpecf_discount_total', 'my_custom_function' );
Parameters
Example
Manually Set Discount
Manually set the discount for Field ID 2 to -$4.00.
gform.addFilter( 'gpecf_discount_total', function ( discount, $field ) {
if ( $field[0].name == "input_2" ) {
discount = -4;
}
return discount;
} );
Since
This filter is available since Gravity Forms eCommerce Fields 1.0.23.