Skip to content

Delete product in cart when we set zero qty and submit with Enter key#607

Merged
nicosomb merged 1 commit intoPrestaShop:developfrom
boherm:fix-zero-qty-in-cart
Mar 15, 2024
Merged

Delete product in cart when we set zero qty and submit with Enter key#607
nicosomb merged 1 commit intoPrestaShop:developfrom
boherm:fix-zero-qty-in-cart

Conversation

@boherm
Copy link
Member

@boherm boherm commented Mar 8, 2024

Questions Answers
Description? After tests review for #600 (review),
we need to delete the product in cart when we set zero and type Enter to submit.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Not yet.
Sponsor company PrestaShop SA
How to test? See @florine2623 review in #600 (review)

--

Additional info issue from the release tests

Screen.Recording.2024-02-23.at.14.17.14.mov

if (event.key === ENTER_KEY) {
updateQuantity(qtyInputGroup, 1);
if (qtyInput.value === '0') {
const targetItem = qtyInput.closest('.cart__item');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should introduce a new entry in the selector-map 🤔
https://github.com/PrestaShop/hummingbird/blob/develop/src/js/constants/selectors-map.ts

Copy link
Contributor

@matthieu-rolland matthieu-rolland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except the selector to be added to the dedicated file as @kpodemski suggested 👍

@boherm boherm force-pushed the fix-zero-qty-in-cart branch from b7a3545 to 6ec8f3d Compare March 13, 2024 13:47
@florine2623 florine2623 self-assigned this Mar 14, 2024
Copy link

@florine2623 florine2623 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @boherm ,

Works like a charm !

Screen.Recording.2024-03-14.at.16.40.51.mov

It is QA ✅ !

@nicosomb nicosomb added this to the Beta milestone Mar 15, 2024
@nicosomb nicosomb merged commit 4e202d9 into PrestaShop:develop Mar 15, 2024
@boherm boherm deleted the fix-zero-qty-in-cart branch March 15, 2024 09:52
@pawelkierklo
Copy link
Contributor

No loading animation when Enter is pressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants