marcinde Posted August 12, 2013 Share Posted August 12, 2013 Even though I've removed the code responsible for 'lastname' field in authentication.tpl file, here's an error that shows when I try to create a customer account: THERE ARE 2 ERRORS alias is required. lastname is required. Where else can I remove it? Thanks. Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted August 13, 2013 Share Posted August 13, 2013 u need to go to controllers front contact controllers Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2013 Share Posted August 13, 2013 u need to go to controllers front contact controllers you need to go an what? please clarify it, not everyone here are developer. 1 Link to comment Share on other sites More sharing options...
marcinde Posted August 13, 2013 Author Share Posted August 13, 2013 So...? I should do ... ? Do you mean the customer settings in backoffice? Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2013 Share Posted August 13, 2013 no, he mean that you have to edit the customer class: classes/Customer you've got there object definition: public static $definition = array( 'table' => 'customer', 'primary' => 'id_customer', 'fields' => array( 'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5', 'copy_post' => false), 'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'required' => true, 'size' => 128), 'passwd' => array('type' => self::TYPE_STRING, 'validate' => 'isPasswd', 'required' => true, 'size' => 32), 'last_passwd_gen' => array('type' => self::TYPE_STRING, 'copy_post' => false), 'id_gender' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'birthday' => array('type' => self::TYPE_DATE, 'validate' => 'isBirthDate'), 'newsletter' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'newsletter_date_add' => array('type' => self::TYPE_DATE,'copy_post' => false), 'ip_registration_newsletter' => array('type' => self::TYPE_STRING, 'copy_post' => false), 'optin' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'website' => array('type' => self::TYPE_STRING, 'validate' => 'isUrl'), 'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 'siret' => array('type' => self::TYPE_STRING, 'validate' => 'isSiret'), 'ape' => array('type' => self::TYPE_STRING, 'validate' => 'isApe'), 'outstanding_allow_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'copy_post' => false), 'show_public_prices' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'id_risk' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_post' => false), 'max_payment_days' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_post' => false), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'note' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml', 'size' => 65000, 'copy_post' => false), 'is_guest' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false), 'id_shop_group' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false), 'id_default_group' => array('type' => self::TYPE_INT, 'copy_post' => false), 'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), ), ); required fields have got 'required' => true just remove it from fields that you don't want to be "required" as you can see there is no "alias" field, it's because it is a part of classes/Address,php file 1 Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted August 13, 2013 Share Posted August 13, 2013 (edited) ohh sorry its authentication form, class/customer line 162 'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => false, 'size' => 32), on authentication.tpl u can completly remove this <p class="required text"> <label for="customer_lastname">{l s='Last name'} <sup>*</sup></label> <input onkeyup="$('#lastname').val(this.value);" type="text" class="text" id="customer_lastname2" name="customer_lastname2" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" /> </p> Edited August 13, 2013 by Jiten rash (see edit history) Link to comment Share on other sites More sharing options...
marcinde Posted August 13, 2013 Author Share Posted August 13, 2013 public static $definition = array( 'table' => 'customer', 'primary' => 'id_customer', 'fields' => array( 'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5', 'copy_post' => false), 'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => false, 'size' => 32), 'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'required' => true, 'size' => 128), 'passwd' => array('type' => self::TYPE_STRING, 'validate' => 'isPasswd', 'required' => true, 'size' => 32), 'last_passwd_gen' => array('type' => self::TYPE_STRING, 'copy_post' => false), 'id_gender' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'birthday' => array('type' => self::TYPE_DATE, 'validate' => 'isBirthDate'), 'newsletter' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'newsletter_date_add' => array('type' => self::TYPE_DATE,'copy_post' => false), 'ip_registration_newsletter' => array('type' => self::TYPE_STRING, 'copy_post' => false), 'optin' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'website' => array('type' => self::TYPE_STRING, 'validate' => 'isUrl'), 'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 'siret' => array('type' => self::TYPE_STRING, 'validate' => 'isSiret'), 'ape' => array('type' => self::TYPE_STRING, 'validate' => 'isApe'), 'outstanding_allow_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'copy_post' => false), 'show_public_prices' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'id_risk' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_post' => false), 'max_payment_days' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_post' => false), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'note' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml', 'size' => 65000, 'copy_post' => false), 'is_guest' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false), 'id_shop_group' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false), 'id_default_group' => array('type' => self::TYPE_INT, 'copy_post' => false), 'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), ), As you can see, I've set lastname - required' => false, It is still required while an atempt to register a customer... And also alias is required Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2013 Share Posted August 13, 2013 have you changed also the "address" class ? it's necessary too. Link to comment Share on other sites More sharing options...
marcinde Posted August 13, 2013 Author Share Posted August 13, 2013 Thank you, Vekia, I did it, now when I try to register it shows: THERE IS 1 ERROR An error occurred while creating your account.. I have no idea what error it may be - no special symbols in address were entered. Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2013 Share Posted August 13, 2013 okay, so what fields you marked as "unrequired" ? while you creating new account - try to fill "alias" field ok? error appears too? Link to comment Share on other sites More sharing options...
marcinde Posted August 13, 2013 Author Share Posted August 13, 2013 (edited) It seems that you cannot set lastname as not required. Don't try this, I had to bring the whole Authentication.tpl file back to default. This code is a total mess. Edited August 13, 2013 by marcinde (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2013 Share Posted August 13, 2013 it's related to the alias, you need to define the alias field i checked it in my demo 1.5.4 store and everything works as should work Link to comment Share on other sites More sharing options...
marcinde Posted August 13, 2013 Author Share Posted August 13, 2013 Thank you for your effort, I really appreciate it. But, after those adventures I've just changed the labels for some fields and left them "required". Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2013 Share Posted August 13, 2013 thanks for information, hope that everytihng works for you as you expected best regards Link to comment Share on other sites More sharing options...
shniurs Posted December 30, 2013 Share Posted December 30, 2013 I have same issue - alias field has value, so it has nothing to do with this error. Link to comment Share on other sites More sharing options...
pienzu Posted September 12, 2014 Share Posted September 12, 2014 it's related to the alias, you need to define the alias field i checked it in my demo 1.5.4 store and everything works as should work Hi Vekia, I suddenly have a problem with the "alias/assign a name to the address" field when customer is registering. This was not a problem before. Can I erase this field or can this cause problems? Also I turned on debugging but dont see the error more than before Link to comment Share on other sites More sharing options...
pienzu Posted September 13, 2014 Share Posted September 13, 2014 Hi, OK resolved this problem. Go to /address.tpl and look for: <input type="hidden" name="token" value="{$token}" /> Remove it and put it just here {if $field_name eq 'address1'} <p class="required text"> <input type="hidden" name="token" value="{$token}" /> 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