Skip to content

Commit ab19aaa

Browse files
committed
gpecf-deduct-deposit.php: Fixed an issue where disabled deposit field caused issues with calculations.
1 parent cc6d0dd commit ab19aaa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gp-ecommerce-fields/gpecf-deduct-deposit.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public function output_script() {
7272
self.init = function() {
7373
gform.addFilter( 'gform_product_total', function( total, formId ) {
7474
if ( formId == self.formId ) {
75+
// If deposit is disabled or hidden, return total as it is.
76+
if ( $( 'input[name="input_' + self.depositFieldId + '.2"]' ).is( ':disabled' ) ) {
77+
return total;
78+
}
79+
7580
var depositPrice = $( 'input[name="input_' + self.depositFieldId + '.2"]' ).val();
7681
var depositQuantity = $( 'input[name="input_' + self.depositFieldId + '.3"]' ).val();
7782

0 commit comments

Comments
 (0)