-
-
Save raihan004/377aef69aeabe46840748e075cc97565 to your computer and use it in GitHub Desktop.
Quantity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label for="Quantity">Quantity</label> | |
<div class="product-quantity product-single__quantity {% unless section.settings.product_quantity_enable %} is-hidden{% endunless %}"> | |
<input value="-" class="qtyminus" field="Quantity" type="button"> | |
<input id="Quantity" name="quantity" value="1" min="1" max="10" data-product-qty="" class="cart__quantity-selector quantity-selector" type="text"> | |
<input value="+" class="qtyplus" field="Quantity" type="button"> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".qtyminus").on("click",function() { | |
var input = $(this).siblings(".cart__quantity-selector"), | |
qty = parseInt(input.val(),10); | |
if(qty > 1){ | |
input.val(qty - 1) | |
} | |
}); | |
$(".qtyplus").on("click",function() { | |
var input = $(this).siblings(".cart__quantity-selector"), | |
qty = parseInt(input.val(),10); | |
input.val(qty + 1) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment