Fippocampe Posted June 16, 2017 Share Posted June 16, 2017 Hello, I am lauching a B to B website : VAT number and name of company are absolutely required to enable a customer's registration. Which files should I modify ? I am lost, I've tried to override the Customer.php class by modifying the lines 188-189, adding the value 'required' : 'company' => array('type' => self::TYPE_STRING, 'validate' => 'isCompany', 'required' => true, 'size' => 128), 'siret' => array('type' => self::TYPE_STRING, 'validate' => 'isSiret'), 'required' => true, 'size' => 128), Unpossible to find precise labels and inputs through the theme's templates (registration, authentication, customer-forms, etc). Would anyone have had the same problem or a solution ? Any help would be very welcome . Link to comment Share on other sites More sharing options...
AndreyW Posted June 26, 2017 Share Posted June 26, 2017 (edited) You don't need to set the required to true, just set it is required. for example: Instead of: 'company' => array('type' => self::TYPE_STRING, 'validate' => 'isCompany', 'required' => true, 'size' => 128) Do this: 'company' => array('type' => self::TYPE_STRING, 'validate' => 'isCompany', 'required', 'size' => 128) Also, change the addressFormat.php and on the variable $requireFormFieldList insert them on the array. Edited June 26, 2017 by AndreyW (see edit history) Link to comment Share on other sites More sharing options...
Fippocampe Posted June 28, 2017 Author Share Posted June 28, 2017 Hi Andrew, thanks a lot for your help ! I finally did something more "hand-made", adding this line to the customer-form.tpl : {if $field["name"] == "siret" or $field["name"] == "company"}{$field["required"] = true}{/if} Thanks 1 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