Merge pull request #5494 from devansh-webkul/quantity-issue

Validation Added #5491
This commit is contained in:
Glenn Hermans 2021-12-30 10:31:22 +01:00 committed by GitHub
commit fd5c110a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 12 deletions

View File

@ -257,9 +257,13 @@
watch: {
qty: function (val) {
this.$refs.quantityChanger.value = val;
this.$refs.quantityChanger.value = ! isNaN(parseFloat(val)) ? val : 0;
this.qty = ! isNaN(parseFloat(val)) ? this.qty : 0;
this.$emit('onQtyUpdated', this.qty);
this.$validator.validate();
}
},
@ -310,7 +314,9 @@
alert('{{ __('shop::app.products.less-quantity') }}');
}
}
document.getElementById('cart-quantity'+index).value = quantity;
event.preventDefault();
}
</script>

View File

@ -251,9 +251,13 @@
watch: {
qty: function (val) {
this.$refs.quantityChanger.value = val;
this.$refs.quantityChanger.value = ! isNaN(parseFloat(val)) ? val : 0;
this.qty = ! isNaN(parseFloat(val)) ? this.qty : 0;
this.$emit('onQtyUpdated', this.qty);
this.$validator.validate();
}
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
{
"/js/velocity-core.js": "/js/velocity-core.js?id=03a0210d750dd5a7a25a",
"/js/velocity.js": "/js/velocity.js?id=c3c94d3b658b034a604c",
"/js/velocity.js": "/js/velocity.js?id=3ede5db1d647d2cbb3d2",
"/js/manifest.js": "/js/manifest.js?id=0632f4b734c0b094a611",
"/js/components.js": "/js/components.js?id=2a81ca1a7d2b98468a12",
"/js/components.js": "/js/components.js?id=553ee40489a7d7ae4060",
"/css/velocity.css": "/css/velocity.css?id=5c9e937a8ad9844d7158",
"/css/velocity-admin.css": "/css/velocity-admin.css?id=301f732acd63a842dc52",
"/images/Camera.svg": "/images/Camera.svg?id=b2fd2f9e17e1ccee96e2",

View File

@ -1,10 +1,8 @@
<template>
<div
:class="
`quantity control-group ${
errors.has(controlName) ? 'has-error' : ''
}`
"
:class="`quantity control-group ${
errors.has(controlName) ? 'has-error' : ''
}`"
>
<label
class="required"
@ -80,9 +78,13 @@ export default {
watch: {
qty: function(val) {
this.$refs.quantityChanger.value = val;
this.$refs.quantityChanger.value = ! isNaN(parseFloat(val)) ? val : 0;
this.qty = ! isNaN(parseFloat(val)) ? this.qty : 0;
this.$emit('onQtyUpdated', this.qty);
this.$validator.validate();
}
},