Jump to content

Customer Sign-Up Form modification


Recommended Posts

I'm a Prestashop noobie, using PrestaShop version: 1.5.4.1

I am trying to modify the customer signup form for one page checkout

I have followed several posts on modifying the form and have two(2) issues that I cannot resolve

 

first: second address line required (I wish to have the field there but not as a required field)

second: I wish to remove the country selection from the list as we only sell in Australia

 

any and all help greatly appreciated

Link to comment
Share on other sites

i'm interesting to a solution. How can we make a filed required or not ?

i would like to make "codece" a required field

 

But this,in customer.php, does not work:

'codece' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName' , 'required' => true),

 

@rustty : for addres i think it's in Backoffice > customer > adress

Edited by vermich (see edit history)
Link to comment
Share on other sites

check Address.php file located in classes directory. ypi cam define there what fields are "required".

You have also to modify the "Addres" under the localization > countries tab. Click on "edit" button near the each available country - then edit "addres" box, you will see it :)

Link to comment
Share on other sites

Thankyou for your replies

after following several posts to alter/change required fields in the sing up form (including the advice given in the above post)

I still have address 2 coming up as a required field

I have edited address.tpl, authentication.tpl, identity.tpl, order-opc-new-account.tpl and changed the "required text" to "text"

I have changed the address format in "backoffice/localization/countries" to not included address2 but when I click on the address format button aftert saving changes address2 is still listed as required.

 

is there somewhere else I have failed to edit???

or should I simply delete this installation of Prestashop and start afresh

Edited by rustty (see edit history)
Link to comment
Share on other sites

I have edited address.tpl

 

and what about address.PHP class? classess/address.php. it's necessary to change list of necessary (required) fields there - can you paste the source with fileds here?

And you have to change the address format (localizaction > countries) for each active country.

Link to comment
Share on other sites

address.php - I removed validate from address 2 line.

 

/**

* @see ObjectModel::$definition

*/

public static $definition = array(

'table' => 'address',

'primary' => 'id_address',

'fields' => array(

'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),

'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),

'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),

'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),

'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),

'id_state' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId'),

'alias' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 32),

'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64),

'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),

'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),

'vat_number' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),

'address1' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'required' => true, 'size' => 128),

'address2' => array('type' => self::TYPE_STRING, '' => 'isAddress', 'size' => 128),

'postcode' => array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12),

'city' => array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64),

'other' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300),

'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32),

'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32),

'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16),

'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),

'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false),

'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false),

),

);

 

protected $_includeVars = array('addressType' => 'table');

protected $_includeContainer = false;I have also edited the localization > countries > addresses box again and it still shows address 2 as required after saving the change(I check in the right hand list next to the address format window)

Link to comment
Share on other sites

  • 3 months later...

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...