Skip to content

Many requests when changing quantity in cart #2476

@jpboskdnz

Description

@jpboskdnz

Describe the bug
When you change the quantity in the cart using the plus and minus buttons, a request is sent to the /cart/ with every single click. This call isn’t particularly fast to begin with, and it becomes even more problematic when a large number of requests are sent in quick succession (see screenshot). Is this something that could be improved?

To Reproduce
Steps to reproduce the behavior:

  1. Add a product to the cart
  2. Open the cart page with the network inspector attached
  3. Click 10 times in quick succession on the plus-button to increase the quantity to 11
  4. Check the network inspector: there are 10 requests to /cart/

Also reproduceable on https://catalyst-demo.site/.

Expected behavior
When clicking in quick succession on the plus of minus button, I don't expect a direct request for each click. Instead, I expect a debounce, and only one request after some time (let's say 300-500ms).

Screenshots
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions