blessmeluck Posted December 11, 2013 Share Posted December 11, 2013 (edited) I'm in indonesia which most of the people DO NOT have last name, so it will be confusing for most people to fill out a form which they don't have. How can i remove the last name or maybe make it not a "required field". Thanks for helping I'm using 1.5.6 Edited December 13, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 11, 2013 Share Posted December 11, 2013 go to localization > countries and click on edit button near country you've got active. define address format: Link to comment Share on other sites More sharing options...
blessmeluck Posted December 11, 2013 Author Share Posted December 11, 2013 thank you again vekia.. you're the most helpful.. Link to comment Share on other sites More sharing options...
blessmeluck Posted December 11, 2013 Author Share Posted December 11, 2013 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 More sharing options...
vekia Posted December 11, 2013 Share Posted December 11, 2013 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 More sharing options...
blessmeluck Posted December 12, 2013 Author Share Posted December 12, 2013 Done that, but still wont work.. the lastname still required. and also at the above form (your information) still has the lastname column Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted December 12, 2013 Share Posted December 12, 2013 field lastname also required field for Address So you should modify file ../clasess/Address.php too Link to comment Share on other sites More sharing options...
blessmeluck Posted December 13, 2013 Author Share Posted December 13, 2013 Done, thanks everybody.. Link to comment Share on other sites More sharing options...
vekia Posted December 13, 2013 Share Posted December 13, 2013 thank you for information that it works now i missed address class, nice catch gonebdg topic marked as [solved] Link to comment Share on other sites More sharing options...
shniurs Posted December 29, 2013 Share Posted December 29, 2013 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 More sharing options...
vekia Posted December 29, 2013 Share Posted December 29, 2013 what error code you've got exactly? Link to comment Share on other sites More sharing options...
shniurs Posted December 29, 2013 Share Posted December 29, 2013 Well it just says An error occurred while creating your account. and that's it. It is shown in the same error field as other errors when some required fields are missing. Link to comment Share on other sites More sharing options...
shniurs Posted December 30, 2013 Share Posted December 30, 2013 what error code you've got exactly? vekia - any thoughts on this issue? Link to comment Share on other sites More sharing options...
webspilka Posted September 14, 2014 Share Posted September 14, 2014 Can you tell what to do to make this work in PrestaShop 1.6? I create topic for 1.6 http://www.prestashop.com/forums/topic/359608-removing-last-name-in-registration-in-1609/ Link to comment Share on other sites More sharing options...
tuananhngd Posted May 26, 2018 Share Posted May 26, 2018 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: Hi, Could I do like that with Presta 1.7.3? Tks Link to comment Share on other sites More sharing options...
rumit Posted January 24, 2019 Share Posted January 24, 2019 (edited) 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 January 24, 2019 by rumit (see edit history) Link to comment Share on other sites More sharing options...
icaroamb Posted January 19, 2021 Share Posted January 19, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now