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

add missing fields to quote_address #19265

Merged
merged 2 commits into from
Mar 30, 2019

Conversation

ErikPel
Copy link
Contributor

@ErikPel ErikPel commented Nov 18, 2018

Description (*)

These fields are being used at magento/module-quote/Observer/Frontend/Quote/Address/VatValidator.php. But rightn now they don't exist and this check does nothing

public function validate(\Magento\Quote\Model\Quote\Address $quoteAddress, $store)
    {
        $customerCountryCode = $quoteAddress->getCountryId();
        $customerVatNumber = $quoteAddress->getVatId();

        $merchantCountryCode = $this->customerVat->getMerchantCountryCode();
        $merchantVatNumber = $this->customerVat->getMerchantVatNumber();

        $validationResult = null;
        if ($this->customerAddress->hasValidateOnEachTransaction(
            $store
        ) ||
            $customerCountryCode != $quoteAddress->getValidatedCountryCode() ||
            $customerVatNumber != $quoteAddress->getValidatedVatNumber()
        ) {
            // Send request to gateway
            $validationResult = $this->customerVat->checkVatNumber(
                $customerCountryCode,
                $customerVatNumber,
                $merchantVatNumber !== '' ? $merchantCountryCode : '',
                $merchantVatNumber
            );


and later
$quoteAddress->setValidatedVatNumber($customerVatNumber); $quoteAddress->setValidatedCountryCode($customerCountryCode);

Fixed Issues (if relevant)

  1. validate function in vatvalidation calls checkVatNumber a lot #17658: validate function in vatvalidation calls checkVatNumber a lot validate function in vatvalidation calls checkVatNumber a lot #17658

Manual testing scenarios (*)

  1. Set up vat validation and for example add product to cart and see that these values are not being saved to the quote_address table so the
    $customerCountryCode != $quoteAddress->getValidatedCountryCode() || $customerVatNumber != $quoteAddress->getValidatedVatNumber()
    check is useless

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • [x ] 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-engcom-team
Copy link
Contributor

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

@ErikPel
Copy link
Contributor Author

ErikPel commented Nov 19, 2018

@VladimirZaets Added the translations

@VladimirZaets
Copy link
Contributor

@ErikPel thanks

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Nov 19, 2018
@magento-engcom-team
Copy link
Contributor

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

@VasylShvorak
Copy link
Contributor

✔️ QA passed

@magento-engcom-team magento-engcom-team merged commit 7f15bd8 into magento:2.3-develop Mar 30, 2019
@m2-assistant
Copy link

m2-assistant bot commented Mar 30, 2019

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

7 participants