AbanteCart Development > Customization help
Optional field
(1/1)
juancot:
Hi.
I am using AvanteCart for the first time and here in my country we do not use the zip code, I need it to be an optional field, how can I do this in AvanteCart version 1.2.16?
Ir can I make my own customer registration form?
Thank you.
dvagner:
Hi
You can use hook
for example:
--- Code: ---public function onModelAccountCustomer_ValidateData()
{
$that = &$this->baseObject;
if (isset($that->error['postcode'])) {
unset($that->error['postcode']);
}
}
--- End code ---
juancot:
Thanks for your help, but where do I have to put this?
I don't know much about programming.
juancot:
I found the solution to this and share it:
find the create.php file in
storefront \ controller \ pages \ account \
and change the following code:
$this->data['form']['fields']['address']['postcode'] = $form->getFieldHtml(
array(
'type' => 'input',
'name' => 'postcode',
'value' => $this->request->post['postcode'],
'required' => ture,
));
Change it for:
$this->data['form']['fields']['address']['postcode'] = $form->getFieldHtml(
array(
'type' => 'input',
'name' => 'postcode',
'value' => $this->request->post['postcode'],
'required' => false,
));
A friend helped me 8) and I share it with you, I suppose it can be used for something more than the zip code. ;)
abantecart:
Thank you Juancot for sharing this solution.
Navigation
[0] Message Index
Go to full version