This commit is contained in:
rahul shukla 2019-04-26 15:31:01 +05:30
parent 47d2ac40dc
commit 2674fbb9ca
8 changed files with 39 additions and 14 deletions

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,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=fc251a49a8378ebc43e7",
"/css/shop.css": "/css/shop.css?id=8991884e53441d770cee"
"/js/shop.js": "/js/shop.js?id=ad1039174ce2c81c8805",
"/css/shop.css": "/css/shop.css?id=bafca07fed1830b7fd24"
}

View File

@ -1963,6 +1963,14 @@ section.product-detail {
}
}
}
.quantity-change {
cursor: pointer;
&:focus {
border-color: $border-color !important;
}
}
}
}
}
@ -3139,12 +3147,6 @@ section.review {
height: 30px;
}
}
// .default-address {
// position: absolute;
// top: 10px;
// right: 10px;
// }
}
}

View File

@ -321,7 +321,8 @@ return [
'quantity' => 'الكمية',
'in-stock' => 'في الأسهم',
'out-of-stock' => 'خارج الأسهم',
'view-all' => 'عرض الكل'
'view-all' => 'عرض الكل',
'less-quantity' => 'Quantity can not be less than one.'
],
'wishlist' => [

View File

@ -330,7 +330,8 @@ return [
'in-stock' => 'In Stock',
'out-of-stock' => 'Out Of Stock',
'view-all' => 'View All',
'select-above-options' => 'Please select above options first.'
'select-above-options' => 'Please select above options first.',
'less-quantity' => 'Quantity can not be less than one.'
],
'wishlist' => [

View File

@ -326,7 +326,8 @@ return [
'in-stock' => 'Em Estoque',
'out-of-stock' => 'Fora de Estoque',
'view-all' => 'Ver Tudo',
'select-above-options' => 'Por favor, selecione as opções acima primeiro.'
'select-above-options' => 'Por favor, selecione as opções acima primeiro.',
'less-quantity' => 'Quantity can not be less than one.'
],
'wishlist' => [

View File

@ -51,7 +51,11 @@
<label class="required">{{ __('shop::app.products.quantity') }}</label>
<input name="quantity" class="control" value="1" v-validate="'required|numeric|min_value:1'" style="width: 60px;" data-vv-as="&quot;{{ __('shop::app.products.quantity') }}&quot;">
<input class="control quantity-change" value="-" style="width: 35px; border-radius: 3px 0px 0px 3px;" onclick="updateQunatity('remove')" readonly>
<input name="quantity" id="quantity" class="control quantity-change" value="1" v-validate="'required|numeric|min_value:1'" style="width: 60px; position: relative; margin-left: -4px; margin-right: -4px; border-right: none;border-left: none; border-radius: 0px;" data-vv-as="&quot;{{ __('shop::app.products.quantity') }}&quot;" readonly>
<input class="control quantity-change" value="+" style="width: 35px; padding: 0 12px; border-radius: 0px 3px 3px 0px;" onclick=updateQunatity('add') readonly>
<span class="control-error" v-if="errors.has('quantity')">@{{ errors.first('quantity') }}</span>
</div>
@ -186,5 +190,21 @@
}
}
};
function updateQunatity(operation) {
var quantity = document.getElementById('quantity').value;
if (operation == 'add') {
quantity = parseInt(quantity) + 1;
} else if (operation == 'remove') {
if (quantity > 1) {
quantity = parseInt(quantity) - 1;
} else {
alert('{{ __('shop::app.products.less-quantity') }}');
}
}
document.getElementById("quantity").value = quantity;
event.preventDefault();
}
</script>
@endpush