public function validateController($htmlentities = true) { $errors = parent::validateController($htmlentities); if (!Configuration::get('VATNUMBER_CHECKING')) { return $errors; } include_once _PS_MODULE_DIR_ . 'vatnumber/vatnumber.php'; if (class_exists('VatNumber', false)) { return array_merge($errors, VatNumber::WebServiceCheck($this->vat_number)); } return $errors; }
public function hookActionValidateCustomerAddressForm(&$params) { $form = $params['form']; $is_valid = true; if (($vatNumber = $form->getField('vat_number')) && Configuration::get('VATNUMBER_MANAGEMENT') && Configuration::get('VATNUMBER_CHECKING')) { $isAVatNumber = VatNumber::WebServiceCheck($vatNumber->getValue()); if (is_array($isAVatNumber) && count($isAVatNumber) > 0) { $vatNumber->addError($isAVatNumber[0]); $is_valid = false; } } return $is_valid; }