예제 #1
0
 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;
 }
예제 #2
0
 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;
 }