add this code in CustomerFormatter.php
$format['phone'] = (new FormField)
->setName('phone')
->setLabel(
$this->translator->trans(
'Phone', [], 'Shop.Forms.Labels'
)
)
->setRequired(true)
;
$format['address1'] = (new FormField)
->setName('address1')
->setLabel(
$this->translator->trans(
'Address', [], 'Shop.Forms.Labels'
)
)
->setRequired(true)
;
$format['postcode'] = (new FormField)
->setName('postcode')
->setLabel(
$this->translator->trans(
'Zip/Postal Code', [], 'Shop.Forms.Labels'
)
)
->setRequired(true)
;
$format['city'] = (new FormField)
->setName('city')
->setLabel(
$this->translator->trans(
'City', [], 'Shop.Forms.Labels'
)
)
->setRequired(true)
;
$format['vat_number'] = (new FormField)
->setName('vat_number')
->setLabel(
$this->translator->trans(
'Vat Number', [], 'Shop.Forms.Labels'
)
)
->setRequired(true)
;
--> add this code in AuthController.php
inside if($hookResult && $register_form->submit()) {
//address saving
$customer = new Customer();
$customer = $customer->getByEmail($register_form->getCustomer()->email);
$address = new Address(
null,
$this->context->language->id
);
$address->id_country = (int) Tools::getCountry();
$address->address1 = Tools::getValue('address1');
$address->postcode = Tools::getValue('postcode');
$address->city = Tools::getValue('city');
$address->phone = Tools::getValue('phone');
$address->vat_number = Tools::getValue('vat_number');
$address->firstname = $customer->firstname;
$address->lastname = $customer->lastname;
$address->id_customer = (int) $customer->id;
$address->id_state = 0;
$address->alias = $this->trans('My Address', [], 'Shop.Theme.Checkout');
if($address->save()){
$should_redirect = true;
} else {
$customer->delete();
$this->errors[] = $this->trans('Could not update your information, please check your data.', array(), 'Shop.Notifications.Error');
$this->redirectWithNotifications($this->getCurrentURL());
}
// $should_redirect = true;
for Better please visit link