Forum
Perch Shop - Individual product quantity in cart
Hello,
I am working on a shop. In my cart I have + and - buttons to increase or decrease item quantity in the cart. When I increase the first item in cart, the other items in the cart also show that same number as the first one.
Now when I increase the 2nd, 3rd etc. item, they individually increase, but when I update they jump back to 1.
I think there is something wrong with the identifier or something, maybe a newbie question, but what am I doing wrong?
My quantity form in cart.html:
<form action='#' class="qty-btns">
<div class="qtyminus"></div>
<perch:input env-autofill="false" class="qty" id="qty:<perch:cartitem id="identifier" />" value="<perch:cartitem env-autofill="false" id="quantity" />" type="text" min="0" />
<div class="qtyplus"></div>
</form>
Hello Mike,
Can you share your full template?
Hello Hussein, thanks for responding. Sure, this is my cart.html template:
How are you implementing the buttons?
It looks like you have a
<form>
inside another<form>
(the parent form is<perch:form>
). I don't think you're allowed to nest forms in HTML. I wonder if this is what causing the unexpected behaviour.