Page 1 of 1
Disabling fields
Posted: Wed Jan 13, 2010 2:17 am
by OSWorX
As with the latest (1.4.0.0.) version (i do not how it was earlier), I am not able to DISable some fields as admin.
For example: allow me to disable the field Telephone, therefore new users are not required to fill in this field (which is done often with obstruse numbers).
Or let me (the store owner) define which field is required and which field shall be shown (except those which are required by local laws).
Re: Disabling fields
Posted: Wed Jan 13, 2010 3:40 am
by Qphoria
At this time, the create form is very much hardcoded. The only way to disable them is the edit the account tpl files and the controller to remove the validation steps. It is due for an overhaul... hopefully soon.
Re: Disabling fields
Posted: Wed Jan 13, 2010 11:40 am
by dangkhoaweb
In the account tpl files, just add style to input "display:none", and remove validation in controler as Qphoria said
Re: Disabling fields
Posted: Wed Feb 24, 2010 4:57 am
by CUSTOM_UK
Hi, I'm new to Opencart, can anyone expand on exactly which files and code elements I need to alter the telephone field to lose it's 'required' status. Many of my customers are international, so it is of limited use to many of us.
Any help or guidance would be much appreciated.... Thanks
Re: Disabling fields
Posted: Wed Feb 24, 2010 5:45 am
by Qphoria
catalog/controller/account/create.php
find and remove
Code: Select all
if ((strlen(utf8_decode($this->request->post['telephone'])) < 3) || (strlen(utf8_decode($this->request->post['telephone'])) > 32)) {
$this->error['telephone'] = $this->language->get('error_telephone');
}
Re: Disabling fields
Posted: Wed Feb 24, 2010 6:12 am
by CUSTOM_UK
Thanks for that. Throws up an error message, so can you point me in the direction of any other files I need to alter. Can see higher in this thread it talks about removing the validation. Not sure which contoller though as folder of that name in two separate locations.
Thanks
Re: Disabling fields
Posted: Wed Feb 24, 2010 12:23 pm
by rph
The error message should say what file it is.
Re: Disabling fields
Posted: Wed Feb 24, 2010 6:04 pm
by CUSTOM_UK
OK. I finally got it sorted.
To anyone else that wants to remove the forced telephone field in the checkout process, here is the
EASY way to achieve it.
Go to catalog/view/template/account/create. Look for the telephone field that has >*< on it. Delete the asterisk ONLY. Then go to catalog/view/template/checkout/guest_step_1 and delete that asterisk.
Next step: Go to catalog/controller/account/ create. Look for the telephone field that has validation of < 3 on it. Change the 3 for a zero. Then go to catalog/controller/checkout/guest_step_1 and change the same 3 for a zero.
Job Done. 
Re: Disabling fields
Posted: Sat Apr 24, 2010 9:05 pm
by dragonfly
Thanks CUSTOM_UK for such a simple list of instructions.
Even I managed to make the change in my install (1.4.7) and it works without any probs!
If only everything else was that simple....
Many thanks.
Rachel