From d1f58290629fc15431b9fed71d111f5c0e573a36 Mon Sep 17 00:00:00 2001 From: Krikochoritis Ioannis Date: Tue, 26 Nov 2024 13:07:26 +0100 Subject: [PATCH] [priceNull - 3.2] - add listener for null/empty price on field --- .../public/pimcore/js/product/storevalues/items/price.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/product/storevalues/items/price.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/product/storevalues/items/price.js index cc0c73ed20..a2aec8cbe2 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/product/storevalues/items/price.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/product/storevalues/items/price.js @@ -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;