Jump to content

How to make postcode not obligatory?


Recommended Posts

Hi

I'm using prestashop 1.4 and i'm trying to make the postal code not obligatory when a new user registers in my site.

I've done what I've seen i'm supposed to:
- Make sure that "postcode" is not in the array $fieldsRequired from /classes/address.php
- Commented the code where the post code is shown in ..../theme/address.tpl and ..../theme/autentication.tpl, so it dows not appear in the registration form or anywhere else.

Yet, registration process is still asking for the postal code!

I even put "postcode" in $fieldsRequired to see what would happen and prestashop threw 2 errors saying that post code is needed (shown in attached image. it's in spanish).

Where else should I take a look so post code is not obligatory?

This is what my /classes/address.php file looks like, around $fieldsRequired array.

protected static $_idZones = array();
   protected static $_idCountries = array();

   protected    $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'city');
   protected    $fieldsSize = array('alias' => 32, 'company' => 32, 'lastname' => 32, 'firstname' => 32,
                                   'address1' => 128, 'address2' => 128, 'postcode' => 12, 'city' => 64,
                                   'other' => 300, 'phone' => 16, 'phone_mobile' => 16, 'dni' => 16);
   protected    $fieldsValidate = array('id_customer' => 'isNullOrUnsignedId', 'id_manufacturer' => 'isNullOrUnsignedId',
                                       'id_supplier' => 'isNullOrUnsignedId', 'id_country' => 'isUnsignedId', 'id_state' => 'isNullOrUnsignedId',
                                       'alias' => 'isGenericName', 'company' => 'isGenericName', 'lastname' => 'isName','vat_number' => 'isGenericName',
                                       'firstname' => 'isName', 'address1' => 'isAddress', 'address2' => 'isAddress', /*'postcode'=>'isPostCode',*/
                                       'city' => 'isCityName', 'other' => 'isMessage',
                                       'phone' => 'isPhoneNumber', 'phone_mobile' => 'isPhoneNumber', 'deleted' => 'isBool', 'dni' => 'isDniLite');



Thanks in advance

44291_UB5sp6qbx2TEyLOopp03_t

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...