Skip to content

Commit ddeeeb3

Browse files
authored
gpecf-set-discount-amount-by-field-value.php: Fixed an issue with comma values in discount calculations.
1 parent f1958e2 commit ddeeeb3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gp-ecommerce-fields/gpecf-set-discount-amount-by-field-value.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ public function output_script() {
105105
};
106106

107107
self.setDiscountAmount = function( value ) {
108+
// Clean the value to remove the thousand separator (could be , or . depending on currency settings).
109+
value = gformCleanNumber( value, '', '', window.gf_global.gf_currency_config.decimal_separator );
110+
108111
if ( value.indexOf( '|' ) !== -1 ) {
109112
value = value.split( '|' )[0];
110113
}

0 commit comments

Comments
 (0)