Skip to content

Commit b2b28cc

Browse files
committed
gpecf-set-discount-amount-by-field-value.php: Fixed an issue with comma values in discount calculations.
1 parent 30377cf commit b2b28cc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ public function output_script() {
106106

107107
self.setDiscountAmount = function( value ) {
108108
// Clean the value to remove the thousand separator (could be , or . depending on currency settings).
109-
var thousandSeparator = window.gf_global.gf_currency_config.thousand_separator;
110-
value = value.replace(new RegExp(thousandSeparator, 'g'), '');
109+
value = gformCleanNumber( value, '', '', window.gf_global.gf_currency_config.decimal_separator );
111110

112111
if ( value.indexOf( '|' ) !== -1 ) {
113112
value = value.split( '|' )[0];

0 commit comments

Comments
 (0)