Description
The gform_ppcp_discount_total JavaScript filter is used to override the discount amount that will be sent to PayPal Checkout.
Usage
The filter which runs for all would be used like so:
1 2 3 | gform.addFilter( 'gform_ppcp_discount_total' , function ( discountTotal, formId, total ) { //do something }, 10, 3 ); |
Parameters
Examples
Log the parameters
This example would log the contents of the three parameters to the browser console.
1 2 3 4 | gform.addFilter( 'gform_ppcp_discount_total' , function ( discountTotal, formId, total ) { console.log( arguments ); return discountTotal; }, 10, 3 ); |
Placement
This code should be placed in a theme custom JS file or a custom JS functions plugin.
Since
This filter was added in Gravity Forms PayPal Checkout Add-On v2.1.
Source Code
This filter is located in GFPPCP.getDiscountTotal() in /js/frontend.js.