Perch Shop: Quantity stops accepting numbers after a year

  • Hi All

    I have a perch shop install which has been working absolutely perfectly since september 2017.

    Suddenly last week, we started getting complaints that the quantity selection on the product pages (product.html) wasn't accepting user selected quantites. Nothing has changed on the site, no updates to anything.

    Just wondered if anyone had any ideas as to potential what has happened and what I could try to fix it.

    heres the code on the product.html page

    1. <perch:input type="number" id="qty" name="quantity" value="1" class="field">

    Here's the code on the cart.html page

    1. <td class="qty"><perch:input id="qty:<perch:cartitem id="identifier" />" value="<perch:cartitem id="quantity" />" type="number" min="0" /></td>

    I'm actually starting to wonder whether this ever worked correctly... though I'm positive it did as it's been online since 2017 with no issues

    Running PHP 7.2 (though has been tried at PHP 5.6 and PHP 7)
    Final perch version 2.8.34
    Shop version 1.0.12

    Thanks in advance


  • drewm

    Approved the thread.
  • Hi Drew

    Yeah, It's happening now, I've been testing it and I can't input a custom quantity value either.

    I've even re-uploaded an archived version on the template in case it had gotten corrupted in some way.

    Next idea is to maybe update Perch to V3 and update the shop app... but can't guarantee this would fix the problem, especially as nothing has actually changed since launch.

  • Well, what happens is, you enter the value into the input and click the add to basket, which then transfers you to the cart... the quantity in the cart remains at 1 regardless of what quantity has been entered on the product page.

    No errors, or validation messages... it just doesn't come through.

  • Yeah, completely odd. I'm at a loss to work it out as there doesn't appear to be any reason for it... even tried changing the input type to text rather than number, but with the same result.

    I'll have another mess about with it... hope I figure something out

    Having looked at the lines of code, you can't see anything wrong with it can you?

  • Drew, I appear to have fixed it... I changed the name="quantity" to name="qty" and it started working again. Absolutely positive that this worked before but this change seems to have fixed it oddly.

    Thanks for listening

    Appreciate the Perch team being here for us all

    Nik :)