0

I'm studying the Magento process to pick the value from vat_id field and would like to ask you some questions to which I could not find an answer:

  • In the function public function getCustomerGroupIdBasedOnVatNumber($customerCountryCode, $vatValidationResult, $store = null) That is present in data.php, where are defined $customerCountryCode and $vatValidationResult? Where is Their origin?

  • How works Magento for take the value of the field "vat_id"?

Thanks for any help guys

1 Answer 1

1

getCustomerGroupIdBasedOnVatNumber() This function is defined in Mage/Customer/Helper/Data.php. And this function is called from below files, so you can check depending upon your need:

1) Mage/Sales/Model.Observer.php

2) Mage/Customer/Model/Observer.php

3)Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php

Hope this will help you.. :)

4
  • Thanks for the reply man. :) For $customerCountryCode and $vatValidationResult, where are defined???
    – Gabriel91
    Commented Mar 10, 2017 at 15:54
  • $customerCountryCode = $customerAddress->getCountryId() $vatValidationResult = $customerHelper->checkVatNumber( $customerAddress->getCountryId(), $customerAddress->getVatId() );
    – Gulshan
    Commented Mar 10, 2017 at 15:58
  • Great! A last question please: What are the files where I can find these definitions?
    – Gabriel91
    Commented Mar 10, 2017 at 16:10
  • in the above 3 files which I mentioned above.
    – Gulshan
    Commented Mar 10, 2017 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.