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

make customer email field required when an admin is making a new order #2771

Conversation

jacobherrington
Copy link
Contributor

@jacobherrington jacobherrington commented Jun 12, 2018

This adds simple HTML validation for the email field.

I personally think that is enough to solve the problem.

refs #2008

@BenMorganIO
Copy link
Contributor

I think you should also add a validation in the model as well. If the order is a guest order, then it should require the customer email.

@jacobherrington
Copy link
Contributor Author

Hey @BenMorganIO! Thanks for weighing in.

Inside the Order model line 127 is validates :email, presence: true, if: :require_email which makes sure that you can't have a guest checkout without an email.

The issue is that the frontend doesn't stop you from progressing though several long screens before the validation fails, causing the user to lose significant time if they have to remake the order. This change will just keep the user from progressing to the next screen without inputting an email - ultimately saving time for an admin user.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks

@BenMorganIO
Copy link
Contributor

Ah, I see. 👍 good sir.

@jacobherrington
Copy link
Contributor Author

@tvdeyen anything else I need to do on this PR. Seems pretty trivial to me, but happy to do some fixups if needed.

@tvdeyen
Copy link
Member

tvdeyen commented Jun 22, 2018

@jacobherrington no, all fine. We need a second review of a core team, then we are ready to go.

Copy link
Member

@gmacdougall gmacdougall left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

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

Successfully merging this pull request may close these issues.

4 participants