runtime123 Posted September 12, 2016 Share Posted September 12, 2016 HI there I am trying to change the "required" option on my one page checkout form fields in Presta Shop I think I have found the file in which to do so? "order-opc-new-account.tpl" - in my themes folder. ___________________________________________________ I have removed the asterisk (*) from the field labels, "First Name" and "Last name" however the fields still remain as "required" - even with the (*) removed ? Please can you assist me in changing the code so that these fields are NOT required. thank you ___________________________________________________ <div class="required form-group"> <label for="firstname">{l s='First name'} <sup></sup></label> <input type="text" class="text form-control validate" id="customer_firstname" name="customer_firstname" onblur="$('#firstname').val($(this).val());" data-validate="isName" value="{if isset($guestInformations) && isset($guestInformations.customer_firstname) && $guestInformations.customer_firstname}{$guestInformations.customer_firstname}{/if}" /> </div> <div class="required form-group"> <label for="lastname">{l s='Last name'} <sup></sup></label> <input type="text" class="form-control validate" id="customer_lastname" name="customer_lastname" onblur="$('#lastname').val($(this).val());" data-validate="isName" value="{if isset($guestInformations) && isset($guestInformations.customer_lastname) && $guestInformations.customer_lastname}{$guestInformations.customer_lastname}{/if}" /> </div> Link to comment Share on other sites More sharing options...
Apium Posted September 12, 2016 Share Posted September 12, 2016 (edited) While of course a solution to this problem exists, I cannot help but wonder why you would not want to know the name and surname of your customers (if anything, if you're not interested in that information, you could delete the fields altogether). The sole thing I came up with is that you are looking to offer something similar to a guest checkout, which is already a feature in the default PrestaShop installation. Are you sure what you're asking is actually the behaviour you are looking for? Edited September 12, 2016 by Apium (see edit history) Link to comment Share on other sites More sharing options...
runtime123 Posted September 12, 2016 Author Share Posted September 12, 2016 I have these same fields (required) within my "instant checkout form" My client would like as few fields to be "required" as possible. The fields still need to remain on the form, however they must not be "required" Please kindly see screenshot Link to comment Share on other sites More sharing options...
sergi256 Posted September 13, 2016 Share Posted September 13, 2016 HI Runtime123, I think you have to remove the "validate" class from the "input" fields. Link to comment Share on other sites More sharing options...
runtime123 Posted September 13, 2016 Author Share Posted September 13, 2016 thank you Sergi254 - would I replace it with another class ? or just remove the word validate from the class name? Link to comment Share on other sites More sharing options...
riccardo123 Posted November 2, 2016 Share Posted November 2, 2016 i'm interested too...... you find a solution? Link to comment Share on other sites More sharing options...
Vee.K727 Posted February 20, 2017 Share Posted February 20, 2017 The format can depend upon your theme but in general you have to remove the required/is_required classes or attributes applied on the fields. Just compare the required and non-required fields in your existing form and judge the difference. 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