jotaeme Posted March 22, 2016 Share Posted March 22, 2016 (edited) Hi everyone, I've been trying to make the field company NOT mandatory when a user is creating his account. I checked several solutions such as go to my admin panel and then Clients>Address and then setting the mandatory fields. That's not working since if I check company field it does appear in my form as mandatory field and if I don't check it, it does not appear at all. The other thing that I've tried was go to Customer.php classes and checked that company wasn't stablished as required (required' => true) and it didn't. What can I do? Thanks! Edited March 22, 2016 by jotaeme (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted March 22, 2016 Share Posted March 22, 2016 I did not think it was mandatory. Can you give prestashop version, country (may be set in country settings), do you have B2B switched on? Do you have a link for us to test? Link to comment Share on other sites More sharing options...
jotaeme Posted March 22, 2016 Author Share Posted March 22, 2016 (edited) On 3/22/2016 at 1:40 PM, haylau said: I did not think it was mandatory. Can you give prestashop version, country (may be set in country settings), do you have B2B switched on? Do you have a link for us to test? Ey! thanks for your answer. Apparently it is. If I want it to appear in my registration form, the only way to get it done is through checking that option (Client/Address and then selecting company as mandatory) that indeed makes it visible but also makes it required. Current version is 1.6.1.4, language: spanish. b2b has been desabled so far. I can not provide an url since the shop is currently under maintenance. Thanks again! Edited March 22, 2016 by jotaeme (see edit history) Link to comment Share on other sites More sharing options...
presta.show Posted March 22, 2016 Share Posted March 22, 2016 Go to: Admin back-end > Clients > Adresses -> Set required fields for this section Link to comment Share on other sites More sharing options...
jotaeme Posted March 22, 2016 Author Share Posted March 22, 2016 On 3/22/2016 at 2:31 PM, kalifsoup said: Go to: Admin back-end > Clients > Adresses -> Set required fields for this section Yeah, by doing that I get exactly what I don't want. I do want the company field in my registration field but I dont want it to be mandatory. Thanks! Link to comment Share on other sites More sharing options...
presta.show Posted March 22, 2016 Share Posted March 22, 2016 1. Uncheck 'company' in: Admin back-end > Clients > Adresses -> Set required fields for this section 2. Open file /themes/(theme name)/address.tpl and show me your code between: {if $field_name eq 'company'} and {/if} 3. Open /classes/AdressFormat.php and check do you have 'company' in $requireFormFieldsList array. 4. Do you have some files in /override/classes or /override/controllers/front/ ? Link to comment Share on other sites More sharing options...
jotaeme Posted March 23, 2016 Author Share Posted March 23, 2016 On 3/22/2016 at 5:41 PM, kalifsoup said: 1. Uncheck 'company' in: Admin back-end > Clients > Adresses -> Set required fields for this section 2. Open file /themes/(theme name)/address.tpl and show me your code between: {if $field_name eq 'company'} and {/if} 3. Open /classes/AdressFormat.php and check do you have 'company' in $requireFormFieldsList array. 4. Do you have some files in /override/classes or /override/controllers/front/ ? 1. Done 2. What I have in address.tpl {if $field_name eq 'company'} <div class="form-group"> <label for="company">{l s='Company'}</label> <input class="form-control validate" data-validate="{$address_validation.$field_name.validate}" type="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{else}{if isset($address->company)}{$address->company|escape:'html':'UTF-8'}{/if}{/if}" /> </div> {/if} 3. AddressFormat.php public static $requireFormFieldsList = array( 'firstname', 'lastname', 'address1', 'city', } 4. No Thanks! Link to comment Share on other sites More sharing options...
presta.show Posted March 23, 2016 Share Posted March 23, 2016 Send me url to your shop. I will help. Link to comment Share on other sites More sharing options...
jotaeme Posted March 23, 2016 Author Share Posted March 23, 2016 On 3/23/2016 at 10:36 AM, kalifsoup said: Send me url to your shop. I will help. Check your pm inbox! Thanks! Link to comment Share on other sites More sharing options...
presta.show Posted March 23, 2016 Share Posted March 23, 2016 In address I see as mandatory: first and last name, address, city, post code, country, state, phone number In personal informations mandatory is: first and last name, e-mail, password Where do you see 'company' field as mandatory? Link to comment Share on other sites More sharing options...
jotaeme Posted March 23, 2016 Author Share Posted March 23, 2016 On 3/23/2016 at 11:26 AM, kalifsoup said: In address I see as mandatory: first and last name, address, city, post code, country, state, phone number In personal informations mandatory is: first and last name, e-mail, password Where do you see 'company' field as mandatory? Nowhere. I want company to show but as an optional field. Link to comment Share on other sites More sharing options...
presta.show Posted March 23, 2016 Share Posted March 23, 2016 Admin > Locations > Countries > (edit country) > Address format > (add 'country' field) 1 Link to comment Share on other sites More sharing options...
jotaeme Posted March 23, 2016 Author Share Posted March 23, 2016 On 3/23/2016 at 11:36 AM, kalifsoup said: Admin > Locations > Countries > (edit country) > Address format > (add 'country' field) Yeees!!! That worked for me. Thank you very much 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