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

Fixed assignment of the guest customer to the guest group when 'Automatic Assignment by VAT ID' is enabled #22091

Conversation

vovayatsyuk
Copy link
Member

Description

Current logic doesn't work for a guest group id since it's 0.

This commit fixes the case when guest fills valid VAT number,
then returns to the shipping step and removes VAT from the address.

Manual testing scenarios

  1. Navigate to Customers > Customer Groups and create two groups "Valid VAT", "Invalid VAT".
  2. Navigate to Stores > Configuration > Customers > Customer Configuration > Create New Account Options and enable "Enable Automatic Assignment to Customer Group". Use groups from the first step for valid and invalid vat id groups. Don't forget to enable "Show VAT Number on Storefront" option.
  3. Open checkout as a guest and use "LU26375245" as a VAT number and "Luxembourg" as a country.
  4. Proceed to the payment step.
  5. Open quote DB table using adminer of phpmyadmin, find your quote and look at the customer_group_id column. You'll see id of valid group (4, for example).
  6. Return to the shipping step, remove VAT number, and proceed to the payment step again.
  7. Take a look and the quote table again. I'm expecting to see 0 here but it still has 4.

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)

This commit fixes the case when guest fills in valid VAT number,
then returns to the shipping step and removes VAT from the address.
@m2-assistant
Copy link

m2-assistant bot commented Apr 1, 2019

Hi @vovayatsyuk. 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

@rogyar
Copy link
Contributor

rogyar commented Apr 1, 2019

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @rogyar. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-4635 has been created to process this Pull Request

@VasylShvorak
Copy link
Contributor

✔️ QA passed

@magento-engcom-team magento-engcom-team merged commit b4c6158 into magento:2.3-develop Apr 15, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 15, 2019

Hi @vovayatsyuk, 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.

magento-engcom-team pushed a commit that referenced this pull request Apr 15, 2019
…p when 'Automatic Assignment by VAT ID' is enabled #22091
@magento-engcom-team magento-engcom-team added this to the Release: 2.3.2 milestone Apr 15, 2019
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