From 53df3db9376f641769bd2c33dedbd412e3fed9fe Mon Sep 17 00:00:00 2001 From: Mark Moffat Date: Sat, 9 Feb 2019 13:35:41 +1030 Subject: [PATCH] Added form PR #41 --- public/javascripts/expressCart.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/javascripts/expressCart.js b/public/javascripts/expressCart.js index 7e668e0..4fc38bf 100644 --- a/public/javascripts/expressCart.js +++ b/public/javascripts/expressCart.js @@ -531,7 +531,8 @@ $(document).ready(function (){ }); $('.qty-btn-minus').on('click', function(){ - $('#product_quantity').val(parseInt($('#product_quantity').val()) - 1); + var number = parseInt($('#product_quantity').val()) - 1; + $('#product_quantity').val(number > 0 ? number : 1); }); $('.qty-btn-plus').on('click', function(){