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


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


Hope this will help you.. :)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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