Jump to content

[SOLVED] Removing last name in registration in 1.5


Recommended Posts

Sorry, i though it is done but there's still error report pop up.

 

The lastname column is indeed disappear in "address form", but still have it in "your information form" and when i tried to fill every form and submit, the error msg pop up and say "lastname is required"

Link to comment
Share on other sites

classes/Customers.php

 

there is code:
 

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

change it to

'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32),
Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I was trying to get rid of the last name and first name fields in user registration. To do so I followed vekia's post. But after setting those two fields to not required I get the error: An error occurred while creating your account.

 

I've changed the code in both Address.php and Customer.php

 

Any ideas why I get the error?


 

Link to comment
Share on other sites

  • 8 months later...
  • 3 years later...

 

On 11/12/2013 at 10:50 PM, vekia said:

classes/Customers.php

 

there is code:
 


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

change it to


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

 

On 11/12/2013 at 5:29 PM, vekia said:

go to localization > countries and click on edit button near country you've got active.

define address format:

sqa9Hpl.png

Hi, 

 

Could I do like that with Presta 1.7.3?

 

Tks

Link to comment
Share on other sites

  • 7 months later...

Hi!

To make field lastname optional in 1.7.5 these steps were helpfull for me:

- in DB switch ps_customer into Null type

  alter table ps_customer modify lastname varchar(255) null; (don`t forget to change prefix)

- CustomerFormatter: lastname setRequired: false

- Customers.php: remove "'required' => true" for 'lastname' as Vekia wrote above

- Address.php: 'required' => false for lastname

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

-  OrderDetailController.php: commented 

'{lastname}' => $customer->lastname,

- AddressFormat.php:

public static $requireFormFieldsList = array(
        'firstname',
//        'lastname',
        'address1',
        'city',
        'Country:name',
    );

- it is better to make all modifications through overrides

- clear cache

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

  • 1 year later...

I know that here it is already marked as resolved and it is an old topic, but I followed all the process, in the address the surname is no longer mandatory, but on the identity page it is still mandatory, I have already changed costumer.php, but nothing, the bank data is also marked as null

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