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?
This portion of your code:
would need to be edited with an IF statement, below the foreach line, which you'd need to include your API / Webservices provider's defined object while validating the VAT number with the $custom_field array variable.
Code: Select all
foreach ($custom_fields as $custom_field) {
$json[] = array(
'custom_field_id' => $custom_field['custom_field_id'],
'required' => $custom_field['required']
);
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 259 guests