Custom Registration Form field VAT number Validation
Posted: Sun Jan 20, 2019 2:39 am
Hi,
In the registration prosess in OC2.x there is a selection you select your organisasjon private or Company
I have created a custom field in registration when customers select business and the vat field appears
Q: is it possible to validate the vat number entered and compare to the vat registration database in norway WEB: https://www.brreg.no/
and validate if the entered number is valid or not....
catalog/controller/account/register.php
public function customfield() {
$json = array();
$this->load->model('account/custom_field');
// Customer Group
if (isset($this->request->get['customer_group_id']) && is_array($this->config->get('config_customer_group_display')) && in_array($this->request->get['customer_group_id'], $this->config->get('config_customer_group_display'))) {
$customer_group_id = $this->request->get['customer_group_id'];
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
$custom_fields = $this->model_account_custom_field->getCustomFields($customer_group_id);
foreach ($custom_fields as $custom_field) {
$json[] = array(
'custom_field_id' => $custom_field['custom_field_id'],
'required' => $custom_field['required']
);
}
Anyone on this one?
In the registration prosess in OC2.x there is a selection you select your organisasjon private or Company
I have created a custom field in registration when customers select business and the vat field appears
Q: is it possible to validate the vat number entered and compare to the vat registration database in norway WEB: https://www.brreg.no/
and validate if the entered number is valid or not....
catalog/controller/account/register.php
public function customfield() {
$json = array();
$this->load->model('account/custom_field');
// Customer Group
if (isset($this->request->get['customer_group_id']) && is_array($this->config->get('config_customer_group_display')) && in_array($this->request->get['customer_group_id'], $this->config->get('config_customer_group_display'))) {
$customer_group_id = $this->request->get['customer_group_id'];
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
$custom_fields = $this->model_account_custom_field->getCustomFields($customer_group_id);
foreach ($custom_fields as $custom_field) {
$json[] = array(
'custom_field_id' => $custom_field['custom_field_id'],
'required' => $custom_field['required']
);
}
Anyone on this one?