Skip to content

Commit

Permalink
[priceNull - 3.2] - add listener for null/empty price on field
Browse files Browse the repository at this point in the history
  • Loading branch information
codingioanniskrikos committed Nov 26, 2024
1 parent b29fcbf commit d1f5829
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 d1f5829

Please sign in to comment.