-
Notifications
You must be signed in to change notification settings - Fork 143
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
@W-13666502 - Removed offline products in baskets #1691
Conversation
@alexvuong Did you bring in Trevor to get some UX advice on this? We might want to do that to make sure we have the best experience possible. |
The ticket also mentioned another scenario: the order history. Currently, if an order is made and it contains an offline product, that product will not show up. I believe the expectation here is to still render the offline product in the product history. Somehow we're able to retrieve the data from another source? |
@vmarta I am not sure how an order with a offline product can be successful checkout. I tried and got an error during checkout. Hence there should be no order. 🤔 Also, when a product is marked a offline in BM. That product will not be present in the product details via getProducts. I don't think we have any source to retrieve that information. |
@alexvuong the scenario that I'm thinking of (and described in the ticket too) is for an existing order that was successful. At the time of order, the product was still online. But then afterwards, it becomes offline. |
On the Checkout page, if I skip the Cart and go straight to Checkout, what are the shoppers supposed to see with the offline product? For me, I saw that there is no prompt on Checkout to remove this offline product. |
gotcha, one way we can do this is to show whatever available data from the order detail in this case |
@vmarta All the comments has been addressed. I've made changes for wishlist and order details to make sure we handle unavailable products. In summary:
|
@alexvuong how about the Checkout page? There is no prompt on Checkout to remove the offline product. Last time on Slack DMs we discussed this scenario. |
@vmarta Checkout page now will prompt users to remove unavailable products. Please have another review when available. Thanks |
packages/template-retail-react-app/app/pages/account/wishlist/index.jsx
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/pages/checkout/index.jsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the PR feedback!
Description
This PR fixes an issue when a customer who has offline (or deleted) products in their basket or an existing order will have poor experience in cart and checkout. Errors are emitted to console in all cases.
Solution
Since basket does not have any property to indicate a productItem is offline. To solve this, after getting product details for basket's product items to populate onto the UI, we compare the number of items in basket and the number of returned data from
getProducts
. If a product is offline, thegetProducts
will not return any data related to that product. Hence, we know unavailable product ids, and remove them from basket before allowing users to interact with the cart and proceed to checkout.See demo video here: https://www.loom.com/share/af80b139be1d4f4ab38af60340d97182?sid=698a44c8-60bb-4621-b0aa-60b446064a5f
Types of Changes
Changes
How to Test-Drive This PR
Checkout this branch
Add items to cart
Go to business manager, find these items and mark them as offline
Navigate to cart page, you should expect to see a prompt to remove those items
Click Remove items
Offline products are removed completely from cart
For wishlist page, do the same process
Go to order page, observe that the unavailable products are still shown in the detail page but has a tag saying product unavailable next to the title, and it is no longer a link directing to a PDP
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization