Changing the product quantity in the shopping cart
In the products overview in the shopping cart tab of the Cart page, the user can adjust the product quantity of each product using an input group with buttons next to the current value. To implement the functionality of decreasing and increasing the value when clicking on these buttons, we will add the .js-productQuantity
class to the input group component for each product and use it as a hook to our JavaScript. The markup for our input group component will be updated in the following way:
part-2/chapter-9/website/cart.html
<div class="input-group me-3 js-productQuantity"> <button type="button" class="btn btn-secondary"><i class="bi-dash-circle"></i></button> <input type="text" class="form-control text-center" value="1" aria-label="Product quantity...