Skip to content

Commit

Permalink
Merge pull request #2757 from coreshop/priceNull
Browse files Browse the repository at this point in the history
[priceNull - 3.2] - add listener for null/empty price on field
  • Loading branch information
dpfaffenbauer authored Nov 28, 2024
2 parents fae4d12 + d1f5829 commit 01e599d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ coreshop.product.storeValues.items.price = Class.create(coreshop.product.storeVa
priceField.setMaxValue(this.builder.fieldConfig.maxValue);
}

priceField.on('blur', function (field) {
var value = field.getValue();
if (value === null || value === '') {
field.setValue(0);
}
});

priceField.resumeEvents(true);

return priceField;
Expand Down

0 comments on commit 01e599d

Please sign in to comment.