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

added min=0 to qty field product detail page #21055

Merged

Conversation

awviraj
Copy link

@awviraj awviraj commented Feb 8, 2019

Description (*)

On product detail page it is possible to go to minus values using keyboard. Once the add to cart button is clicked validation error - "Please enter a quantity greater than 0" shown.

Manual testing scenarios (*)

1.Go to product detail page
2. Decrease the qty by using arrow keys

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Feb 8, 2019

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @awviraj. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@dmytro-ch dmytro-ch self-requested a review February 8, 2019 08:50
@dmytro-ch dmytro-ch self-assigned this Feb 8, 2019
@dmytro-ch
Copy link
Contributor

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @dmytro-ch. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @dmytro-ch, here is your new Magento instance.
Admin access: https://pr-21055.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@dmytro-ch
Copy link
Contributor

Hi @awviraj,
I could not reproduce the issue on clean 2.3-develop instance.

screen shot 2019-02-08 at 3 30 02 pm

Also looks like there is a proper validation rule for Qty field:

data-validate="{"required-number":true,"validate-item-quantity":{"minAllowed":1,"maxAllowed":10000}}"

I dont think additinal validation is necessary in this case.

Thank you.

@awviraj
Copy link
Author

awviraj commented Feb 8, 2019

@dmytro-ch Thanks for reviewing the issue.

  • From my point of view , you have already reproduced the issue.
  • My point is if users are not allowed to select negative values , why not prevent it from html level itself before going to js validation. Isn't it better to do as much of validation from html level ?
  • Js validation still can be used when minallowed-qty is set to a number more than 1 and for other scenarios.

I would appreciate if you could provide feedback about above points .

Thank you !

@dmytro-ch
Copy link
Contributor

@awviraj, thank you for the details.
I agree that we may add such an improvement.

@magento-engcom-team
Copy link
Contributor

Hi @dmytro-ch, thank you for the review.
ENGCOM-4196 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@awviraj thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@magento-engcom-team magento-engcom-team merged commit da38e29 into magento:2.3-develop Feb 13, 2019
@ghost
Copy link

ghost commented Feb 13, 2019

Hi @awviraj, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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

Successfully merging this pull request may close these issues.

5 participants