Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cart updates throttling in case of changing the quantity #3191

Closed
pkarw opened this issue Jul 6, 2019 · 3 comments
Closed

Cart updates throttling in case of changing the quantity #3191

pkarw opened this issue Jul 6, 2019 · 3 comments
Assignees
Labels
1: Easy feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can P2: Important Priority mark - still high ;) QA approved after merge Testers will add this label after positive check on merged changes vs-hackathon Tasks for the Hackathon
Milestone

Comments

@pkarw
Copy link
Collaborator

pkarw commented Jul 6, 2019

What is the motivation for adding / enhancing this feature?

Currently (1.9.2, 1.10rc1) each keypress into quantity field (Microcart/Product.vue) causes the cart/sync action to be executed

There is something like this:

      <div class="h5 pt5 cl-accent lh25 qty">
        <base-input-number
          :name="$t('Quantity')"
          :value="product.qty"
          @input="updateQuantity"
          :min="1"
        />
      </div>

... and in the microcart/components/Product.ts (base component of this Product.vue)

    updateQuantity (quantity) {
      this.$store.dispatch('cart/updateQuantity', { product: this.product, qty: quantity })
    }

This causes immediate call to cart/sync and after entering kind of 6..1.. we've got two calls instead of one (just for 61)

We need a time-based throttling or some other way to limit this behavior

@pkarw pkarw added the feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can label Jul 6, 2019
@pkarw pkarw added this to the 1.10.0 milestone Jul 6, 2019
@pkarw
Copy link
Collaborator Author

pkarw commented Jul 6, 2019

@filrak or @patzick can you please take this one?

@pkarw
Copy link
Collaborator Author

pkarw commented Jul 6, 2019

We can probably use the debounce filter (example: https://github.com/DivanteLtd/vue-storefront/pull/2654/files)

@patzick
Copy link
Collaborator

patzick commented Jul 8, 2019

@pkarw yes, debounce is right solution here:) it's 1.10 milestone, so will be added soon!

@pkarw pkarw modified the milestones: 1.10.0, 1.11.0-rc.1 Jul 10, 2019
@pkarw pkarw added 1: Easy P2: Important Priority mark - still high ;) vs-hackathon Tasks for the Hackathon labels Jul 11, 2019
@patzick patzick closed this as completed Jul 16, 2019
@patzick patzick added the QA - Ready for tests This is notification for testers, that improvement is ready to be tested and verified. label Jul 16, 2019
@alinadivante alinadivante added QA approved after merge Testers will add this label after positive check on merged changes and removed QA - Ready for tests This is notification for testers, that improvement is ready to be tested and verified. labels Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1: Easy feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can P2: Important Priority mark - still high ;) QA approved after merge Testers will add this label after positive check on merged changes vs-hackathon Tasks for the Hackathon
Projects
None yet
Development

No branches or pull requests

4 participants