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 Page: Inconsistent error messaging for low item stock #380

Closed
clyde-baker opened this issue Aug 11, 2021 · 5 comments · Fixed by #593 or #633
Closed

Cart Page: Inconsistent error messaging for low item stock #380

clyde-baker opened this issue Aug 11, 2021 · 5 comments · Fixed by #593 or #633
Assignees
Labels
Category: Bug Something isn't working Severity: 1 Urgent Severity

Comments

@clyde-baker
Copy link

clyde-baker commented Aug 11, 2021

Bug description:

When a buyer attempts to increase the quantity of a line item on the cart page, to a number that exceeds the limit of inventory available, it will reset to max quantity available with no explanation as to what just happened. Only after trying to increase the quantity a second time does an error message display.

The error message should display every time a buyer tries to enter a quantity that exceeds the available limit

https://screenshot.click/21-43-1vk8m-krbl2.mp4


Original Comment from @clyde-baker:

I haven't seen a fix for this yet but it's a UX disaster that will surely lead to a large number of abandonments.

Users are able to add an unlimited number of items to their cart from the product page, even if there is only 1 in stock.

Only once the user initiates checkout does an error appear stating "Out of stock. Some items are no longer available. Your cart has been updated." Unfortunately, waiting until a user has already committed to checking is way too late. And even if you click "Return to cart", the quantity doesn't actually update and remains at the impossible number.

In addition, if the user attempts to increase the impossible quantity from the cart page, it will reset to lowest quantity available with no explanation as to what just happened. Only after trying to increase the quantity a second time does an error display.

Like with the Debut theme, users should be prevented from adding the impossible quantity to cart and immediately given an error message.

  • Dawn Version: 1.1.0
  • Chrome Version 92.0.4515.131
@nicklepine
Copy link

nicklepine commented Aug 12, 2021

Thanks for spotting this @clyde-baker. Given there are 2 different bugs listed in this ticket - I've created a separate ticket for the Product Page issue, and will edit your initial description to be focused on the Cart page bug.

@nicklepine nicklepine added Category: Bug Something isn't working Severity: 1 Urgent Severity labels Aug 12, 2021
@nicklepine nicklepine changed the title Broken logic for handling low item stock Cart Page: Inconsistent error messaging for low item stock Aug 12, 2021
@nicklepine nicklepine added Severity: 2 High Severity and removed Severity: 1 Urgent Severity labels Aug 18, 2021
@nicklepine nicklepine added Severity: 1 Urgent Severity and removed Severity: 2 High Severity labels Aug 31, 2021
@ludoboludo
Copy link
Contributor

Here is what I'm observing to add some details to this issue: video

@ludoboludo
Copy link
Contributor

There is also an odd issue in Safari brought up here by @Binthout: #582 (comment)

Here is some early observations:

Interesting, from what I'm seeing it's working properly when navigation/updating the quantity via keyboard navigation. But when it's using the mouse, it doesn't detect anything for document.activeElement.getAttribute('name') from the onChange(event) function.

So if (lineItem) lineItem.querySelector([name="${name}"]).focus(); ends up failing and throwing an error which shows up in the video 🤔

@ludoboludo
Copy link
Contributor

ludoboludo commented Sep 15, 2021

Looks like it's specific to Mac. activeElement will only return the input if it's a type="text" otherwise, focus will be set to the Body or null.

Note: For iOS, elements that are not , will not get focus assigned to them. The property will then return BODY or null.

There was some useful information in that thread of comments: https://bugzilla.mozilla.org/show_bug.cgi?id=1547926

So I think a quick fix would be to change this:

if (lineItem) lineItem.querySelector(`[name="${name}"]`).focus();

to this

if (lineItem && lineItem.querySelector(`[name="${name}"]`)) lineItem.querySelector(`[name="${name}"]`).focus();

@Binthout
Copy link

Looks like it's specific to Mac. activeElement will only return the input if it's a type="text" otherwise, focus will be set to the Body or null.

Note: For iOS, elements that are not , will not get focus assigned to them. The property will then return BODY or null.

There was some useful information in that thread of comments: https://bugzilla.mozilla.org/show_bug.cgi?id=1547926

So I think a quick fix would be to change this:

if (lineItem) lineItem.querySelector(`[name="${name}"]`).focus();

to this

if (lineItem && lineItem.querySelector(`[name="${name}"]`)) lineItem.querySelector(`[name="${name}"]`).focus();

This seems to be working fine with the mentioned fix!

@ludoboludo ludoboludo mentioned this issue Sep 16, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Bug Something isn't working Severity: 1 Urgent Severity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants