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

fix: disable add-to-basket when quantity is zero #1066

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

dhhyi
Copy link
Collaborator

@dhhyi dhhyi commented Mar 11, 2022

PR Type

[x] Bugfix

What Is the Current Behavior?

"Add to Cart" buttons on retail sets are active when quantity is 0.

Steps to reproduce:

What Is the New Behavior?

  • disable add to cart for quantity below 1
  • track quantity of children in parent context to enable the same behavior

Does this PR Introduce a Breaking Change?

[ ] Yes
[x] No

Other Information

WAIT: Fix is based on #1063, please review and merge before this fix.

AB#76057

@dhhyi dhhyi added bug Something isn't working wait Waiting for something (e.g. new ICM release) community Community contributions labels Mar 11, 2022
@SGrueber SGrueber self-requested a review March 14, 2022 09:01
@SGrueber SGrueber self-assigned this Mar 14, 2022
@dhhyi dhhyi force-pushed the refactor/product-context-improvements branch from b51b7b7 to 36c0153 Compare March 14, 2022 14:33
@dhhyi dhhyi force-pushed the fix/retail-set-zero-quantity branch from d2abe1b to 3d8d6e4 Compare March 14, 2022 14:34
@Eisie96 Eisie96 self-requested a review March 17, 2022 07:51
@dhhyi dhhyi force-pushed the refactor/product-context-improvements branch from 36c0153 to b9e0d4a Compare April 4, 2022 08:17
@dhhyi dhhyi force-pushed the fix/retail-set-zero-quantity branch from 3d8d6e4 to 5abd271 Compare April 4, 2022 09:01
Base automatically changed from refactor/product-context-improvements to develop April 19, 2022 06:13
@dhhyi dhhyi force-pushed the fix/retail-set-zero-quantity branch from 5abd271 to b330280 Compare April 19, 2022 21:40
@dhhyi dhhyi removed the wait Waiting for something (e.g. new ICM release) label Apr 19, 2022
@Eisie96
Copy link
Contributor

Eisie96 commented Apr 29, 2022

It works in the most cases. But there is a problem for "Add To Order Template" for retail sets (sku: 201807198 for example). In this case the sku is set by the quantity of the parent product. In this solution the quantity of the parent will be updated with the sum of quantities for each child. This is the reason why for the sku: 201807198 4 products will be added to the order template.

A solution could be to move the logic to detect the quantity of all children to the product-add-to-basket component.

@dhhyi
Copy link
Collaborator Author

dhhyi commented Apr 29, 2022

@Eisie96

It works in the most cases. But there is a problem for "Add To Order Template" for retail sets (sku: 201807198 for example).

This sounds an awful lot like missing functionality in the ICM references here: #748
I don't think retail sets are supposed to land as one item on order templates...

A solution could be to move the logic to detect the quantity of all children to the product-add-to-basket component.

That would mix concerns in my opinion. 🤔

@dhhyi
Copy link
Collaborator Author

dhhyi commented May 2, 2022

@Eisie96 sorry, I misunderstood your comment. Yes, if a retail set is added to an order template from the detail page, the quantities are wrong. I'll fix something. 😅

@dhhyi dhhyi marked this pull request as draft May 2, 2022 15:10
@dhhyi dhhyi assigned dhhyi and unassigned SGrueber May 2, 2022
@dhhyi dhhyi force-pushed the fix/retail-set-zero-quantity branch from b330280 to 5b857dd Compare May 2, 2022 17:30
@dhhyi dhhyi changed the base branch from develop to fix/retail-set-list-handling May 2, 2022 17:30
@dhhyi dhhyi marked this pull request as ready for review May 2, 2022 17:49
@dhhyi
Copy link
Collaborator Author

dhhyi commented May 2, 2022

@Eisie96 now based on #1141 which handles #748

@dhhyi dhhyi added the wait Waiting for something (e.g. new ICM release) label May 2, 2022
@dhhyi dhhyi removed their assignment May 3, 2022
@dhhyi dhhyi force-pushed the fix/retail-set-zero-quantity branch 2 times, most recently from ee08ca0 to b9df9b4 Compare May 4, 2022 11:00
@dhhyi dhhyi force-pushed the fix/retail-set-list-handling branch from 0f36489 to 1d19938 Compare May 5, 2022 11:29
@dhhyi dhhyi force-pushed the fix/retail-set-zero-quantity branch from b9df9b4 to 4d3c8df Compare May 5, 2022 11:29
@shauke shauke added this to the 3.0 milestone May 25, 2022
@Eisie96 Eisie96 force-pushed the fix/retail-set-list-handling branch from 1d19938 to 01ed5ee Compare July 20, 2022 12:19
@shauke shauke assigned Eisie96 and SGrueber and unassigned Eisie96 Jul 20, 2022
@jometzner jometzner removed this from the 3.0 milestone Jul 25, 2022
@SGrueber SGrueber force-pushed the fix/retail-set-list-handling branch from 01ed5ee to 56a726b Compare July 27, 2022 12:42
@SGrueber SGrueber force-pushed the fix/retail-set-zero-quantity branch from 4d3c8df to 07793e3 Compare July 27, 2022 12:53
@SGrueber SGrueber force-pushed the fix/retail-set-zero-quantity branch from 07793e3 to d2158e0 Compare July 27, 2022 13:11
@SGrueber SGrueber removed the wait Waiting for something (e.g. new ICM release) label Jul 28, 2022
@SGrueber SGrueber merged commit d655d63 into fix/retail-set-list-handling Jul 28, 2022
@SGrueber SGrueber deleted the fix/retail-set-zero-quantity branch July 28, 2022 08:59
@SGrueber SGrueber restored the fix/retail-set-zero-quantity branch July 29, 2022 07:08
SGrueber pushed a commit that referenced this pull request Aug 11, 2022
SGrueber pushed a commit that referenced this pull request Aug 11, 2022
@shauke shauke deleted the fix/retail-set-zero-quantity branch January 6, 2023 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community Community contributions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants