News:

AbanteCart v1.4.2 is released.

Main Menu

Change postcode to optional field

Started by Patricio Guaman, June 29, 2020, 07:25:49 PM

Previous topic - Next topic

Patricio Guaman

Hi, I am using Abantecart but I have the problem we dont use postal code, so I wonder if is possible change postcode from mandatory to optional field? or maybe another alternative to permit users enter the orders without the need to enter postcode.

Thanks,

dvagner

Hi, you can change validation behavior via Hooks Model AccountAddress, method validateAddressData
just unset $this->error['postcode']
or set default value for postcode.

Patricio Guaman

#2
Thanks for the answer, I am a little confused about hooks, can you explain more how can I unset the error.

BTW, I tried to comment all this command in all the files I found $this->error['postcode'] but it is still mandatory.

if ((mb_strlen($data['postcode']) < 3) || (mb_strlen($data['postcode']) > 128)) {
     ////$this->error['postcode'] = $this->language->get('error_postcode');   
}

See in the attached pic where is the field appearing.

Thanks!

Forum Rules Code of conduct
AbanteCart.com 2010 -