Jevgen Posted February 21, 2011 Share Posted February 21, 2011 Hello. I made mobile phone required at registration. Star symbol which showing field obligatory is gray. All others are red. See photo what i mean. How can I make it red as others. Use PS 1.3.6 Link to comment Share on other sites More sharing options...
Jevgen Posted February 21, 2011 Author Share Posted February 21, 2011 all was done by this instruction Some users may need to have the phone number field required for new registrations. This is quite simple and needs you to edit 2 files on your server. Address.php which is located in your classes folder, and also the authentication.tpl file wich is located in your theme folder.First the Address.php file. Find the the following line of code:protected $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city');and change it to:protected $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city', 'phone');In the authentication.tpl file find the following code:{l s='Home phone'}<input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" /> and change it to:{l s='Home phone'}<input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />* This second section of code adds the astrix to show that the field is required.You could use the above example to make any of the fields required in your registration process. Just look for the different sections in the authentication.tpl file and add the *. Link to comment Share on other sites More sharing options...
sbnet Posted February 21, 2011 Share Posted February 21, 2011 Can you give your live site url ? or a copy of your authentication.tpl ? Link to comment Share on other sites More sharing options...
Jevgen Posted February 21, 2011 Author Share Posted February 21, 2011 the website is under password, I`ll give you authentication.tplhere is the file http://rapidshare.com/files/449072862/authentication.rarsmall file i couldnot upload here Link to comment Share on other sites More sharing options...
sbnet Posted February 21, 2011 Share Posted February 21, 2011 Add 'required' in your p tag : {l s='Mobile phone'} <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" /> * Link to comment Share on other sites More sharing options...
Jevgen Posted February 21, 2011 Author Share Posted February 21, 2011 many thnx bro) I appreciate your help ) Link to comment Share on other sites More sharing options...
Jevgen Posted February 21, 2011 Author Share Posted February 21, 2011 and finally for those who wants make mobile phone required at registration and using v1.3.61) in folder classes find file Address.php and the following line of code: protected $fieldsRequired = array(‘id_country’, ‘alias’, ‘lastname’, ‘firstname’, ‘address1’, ‘postcode’, ‘city’); and change it or add following protected $fieldsRequired = array(‘id_country’, ‘alias’, ‘lastname’, ‘firstname’, ‘address1’, ‘postcode’, ‘city’, ‘phone_mobile’); 2) in folder theme/your_theme/ find file authentication.tpl and the following code: {l s='Mobile phone'} <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" /> and change it to: {l s='Mobile phone'} <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" /> * by adding * make field required and adding word required in code below make symbol * red You can play with other fields to make fields required or not )Thanks to sbnet for helping Link to comment Share on other sites More sharing options...
tommyc Posted April 5, 2011 Share Posted April 5, 2011 Hi Jeygen,I have got one problem. I change the not required for lastname under the authentication.tpl.But it will still ask me to put in my lastname as a requirement. I am using presta version 1.3.7.Following is link to my code http://www.hdworld.biz/misc/aut.txtPlease help.Regards,Tommy Link to comment Share on other sites More sharing options...
Jevgen Posted April 5, 2011 Author Share Posted April 5, 2011 in folder classes find file Address.phpcheck code there Link to comment Share on other sites More sharing options...
tommyc Posted April 6, 2011 Share Posted April 6, 2011 Thanks for your respond . . . . . . For this the code if have adjust is as followsprotected $fieldsRequired = array('id_country', 'alias', 'firstname', 'phone_mobile',);The actual code is here http://www.hdworld.biz/misc/address.txt Link to comment Share on other sites More sharing options...
Jevgen Posted April 6, 2011 Author Share Posted April 6, 2011 all works now ? Link to comment Share on other sites More sharing options...
tommyc Posted April 6, 2011 Share Posted April 6, 2011 Its not working with this code either Link to comment Share on other sites More sharing options...
PaulJW Posted April 28, 2011 Share Posted April 28, 2011 Jevgen, I'm trying to remove the requirement for 'postcode' and 'other'. I followed your clear instructions above but it didn't work for me. I'm using PS 1.4.0.17, do you think that makes a difference? Link to comment Share on other sites More sharing options...
Jevgen Posted April 28, 2011 Author Share Posted April 28, 2011 in folder classes find file Address.phpfolder theme/your_theme/ find file authentication.tpldid you change all in those two files? Link to comment Share on other sites More sharing options...
Jevgen Posted April 28, 2011 Author Share Posted April 28, 2011 authentication.tplthere are 2 places. Lines 363-366 and lines 206-209 {l s='Zip / Postal Code'} <input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}"> * change to this {l s='Zip / Postal Code'} <input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}"> and in address.php protected $fieldsValidate = array('id_customer' => 'isNullOrUnsignedId', 'id_manufacturer' => 'isNullOrUnsignedId', 'id_supplier' => 'isNullOrUnsignedId', 'id_country' => 'isUnsignedId', 'id_state' => 'isNullOrUnsignedId', 'alias' => 'isGenericName', 'company' => 'isGenericName', 'lastname' => 'isName','vat_number' => 'isGenericName', 'firstname' => 'isName', 'address1' => 'isAddress', 'address2' => 'isAddress', 'postcode'=>'isPostCode', 'city' => 'isCityName', 'other' => 'isMessage', 'phone' => 'isPhoneNumber', 'phone_mobile' => 'isPhoneNumber', 'deleted' => 'isBool', 'dni' => 'isDniLite'); remove 'postcode'=>'isPostCode', Link to comment Share on other sites More sharing options...
Jevgen Posted April 28, 2011 Author Share Posted April 28, 2011 save original files before any changing Link to comment Share on other sites More sharing options...
Jevgen Posted April 28, 2011 Author Share Posted April 28, 2011 and in theme/your_theme/address.tpl {l s='Zip / Postal Code'} <input type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'htmlall':'UTF-8'}{/if}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" /> * change to {l s='Zip / Postal Code'} <input type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'htmlall':'UTF-8'}{/if}{/if}"/> Link to comment Share on other sites More sharing options...
PaulJW Posted April 28, 2011 Share Posted April 28, 2011 Thanks Jevgen, I'll try that an let you know. Link to comment Share on other sites More sharing options...
Jevgen Posted April 28, 2011 Author Share Posted April 28, 2011 some problem with code viewing in post 14... Link to comment Share on other sites More sharing options...
Son Ame Posted January 19, 2012 Share Posted January 19, 2012 Thank you, guys! very helpful and plane! Link to comment Share on other sites More sharing options...
aladiw Posted May 6, 2012 Share Posted May 6, 2012 stil not working, i'm use PS 1.4.5.1 please help.. 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