Design comparison
Solution retrospective
Any comment is strongly appreciated
Community feedback
- @RubenSmnPosted almost 2 years ago
Hi, I did some playing around and found that you're able to pass in a negative value in the input. When clicking Add to cart the cart gets a -amount label.
When I tried to add a extra item after one was already in the cart the count did not increase. Instead it changed to the newly added amount.
- added 2 > cart: 2
- added 1 > cart: 1
Once there are multiple items in the cart the delete functionality does not seem to work that well.
Marked as helpful0@ssenyondo67Posted almost 2 years ago@RubenSmn Yes, but am still thinking of a way to go about it because it shouldn't allow the same item to be added to the cart more than once instead the amount, and the total price should be the one updated. One idea I had was to count the childNodes but it is not giving me what I want if you have any ideas I will be glad thanks much for your time.
0@ssenyondo67Posted almost 2 years ago@RubenSmn Hello, how do you see the changes I have made now
0@RubenSmnPosted almost 2 years ago@ssenyondo67 Yeah this is a great improvement, nice job! I did however managed to still break it. When entering a decimal value the shopping cart will give a
NaN
indication.0@ssenyondo67Posted almost 2 years ago@RubenSmn Thanks, do you mean I should prevent entering them or?
0@RubenSmnPosted almost 2 years ago@ssenyondo67 I think you can have a simple check if the value is below 1 don't add it, maybe give the user a message that only whole numbers are allowed. And round the values up so currently 1.5 will also cause some unwanted actions
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord