This commit is contained in:
jitendra 2019-10-11 11:19:46 +05:30
parent 310f426272
commit 195330c192
3 changed files with 24 additions and 8 deletions

View File

@ -1933,15 +1933,22 @@ section.product-detail {
float: right;
.control-group {
display: inline-block;
max-width: 50px;
max-width: initial;
width: auto;
text-align: center;
margin-bottom: 0;
border-top: 0;
padding-top: 0;
label {
display: none;
}
.control {
margin: 0;
width: 100%;
height: 38px;
width: 60px;
text-align: center;
line-height: 38px;
}
}
}

View File

@ -176,6 +176,11 @@
default: 1
},
minQuantity: {
type: [Number, String],
default: 1
},
validations: {
type: String,
default: 'required|numeric|min_value:1'
@ -198,7 +203,7 @@
methods: {
decreaseQty: function() {
if (this.qty > 1)
if (this.qty > this.minQuantity)
this.qty = parseInt(this.qty) - 1;
this.$emit('onQtyUpdated', this.qty)

View File

@ -16,10 +16,14 @@
@include ('shop::products.price', ['product' => $groupedProduct->associated_product])
</span>
<span class="qty">
<div class="control-group">
<input name="qty[{{$groupedProduct->associated_product_id}}]" class="control" value="{{ $groupedProduct->qty }}"/>
</div>
<quantity-changer
:control-name="'qty[{{$groupedProduct->associated_product_id}}]'"
:validations="'required|numeric|min_value:0'"
quantity="{{ $groupedProduct->qty }}"
min-quantity="0">
</quantity-changer>
</span>
</li>
@endforeach