Jump to content

How to customize the customer's registration fields ? 1.7.1


Fippocampe

Recommended Posts

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

  • 2 weeks later...

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 by AndreyW (see edit history)
Link to comment
Share on other sites

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 :)

  • Like 1
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...