Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Change postcode to optional field  (Read 2444 times)

Offline Patricio Guaman

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Change postcode to optional field
« on: June 29, 2020, 07:25:49 PM »
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,

Offline dvagner

  • Core/UI Developer
  • Jr. Member
  • **
  • Posts: 73
  • Karma: +28/-1
    • View Profile
Re: Change postcode to optional field
« Reply #1 on: June 30, 2020, 06:02:19 AM »
Hi, you can change validation behavior via Hooks Model AccountAddress, method validateAddressData
just unset $this->error['postcode']
or set default value for postcode.

Offline Patricio Guaman

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Change postcode to optional field
« Reply #2 on: June 30, 2020, 11:00:09 AM »
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!
« Last Edit: June 30, 2020, 11:19:40 AM by Patricio Guaman »

 

Powered by SMFPacks Social Login Mod