- Posts: 48
- Thank you received: 0
Custom Field "Read Only" in both - front & backend
- theweasel68
-
Topic Author
- Offline
Less
More
13 years 6 months ago #94516
by theweasel68
Custom Field "Read Only" in both - front & backend was created by theweasel68
Hi,
I would like to set several custom fields (for example the "address company" to "read only". Meaning, the user cannot change this in the frontend. As it is described in the help section: "Read only: Used to lock the value of a text type custom field, the customer can't change it's value."
However, the point is, if I set a field to "Read Only", then it is also not editable in the admin backend anymore. That means, it cannot changed at all. I also cannot setup the data for a new user.
I think this should be editable by the admin in the backend, shouldn´t it be?
Thx
I would like to set several custom fields (for example the "address company" to "read only". Meaning, the user cannot change this in the frontend. As it is described in the help section: "Read only: Used to lock the value of a text type custom field, the customer can't change it's value."
However, the point is, if I set a field to "Read Only", then it is also not editable in the admin backend anymore. That means, it cannot changed at all. I also cannot setup the data for a new user.
I think this should be editable by the admin in the backend, shouldn´t it be?
Thx
Please Log in or Create an account to join the conversation.
13 years 6 months ago #94557
by Xavier
Replied by Xavier on topic Custom Field "Read Only" in both - front & backend
Hi,
What can be done is editing the view "user / editaddress" (backend template) and relplace the line:
By:
And in the class field.php (administrator/components/com_hikashop/classes/field.php) replace the line:
By:
What can be done is editing the view "user / editaddress" (backend template) and relplace the line:
Code:
echo $this->fieldsClass->display($oneExtraField,$this->address->$fieldName,'data[address]['.$fieldName.']',false,''.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'address\',0);"'); ?>
Code:
echo $this->fieldsClass->display($oneExtraField,$this->address->$fieldName,'data[address]['.$fieldName.']',false,'backend'.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'address\',0);"'); ?>
Code:
$size .= empty($field->field_options['readonly']) ? '' : ' readonly="readonly"';
Code:
if(!preg_match('/^backend/',$options))
$size .= empty($field->field_options['readonly']) ? '' : ' readonly="readonly"';
$options = preg_replace('/^backend/','',$options);
The following user(s) said Thank You: theweasel68
Please Log in or Create an account to join the conversation.
- theweasel68
-
Topic Author
- Offline
Less
More
- Posts: 48
- Thank you received: 0
13 years 6 months ago - 13 years 6 months ago #94583
by theweasel68
Replied by theweasel68 on topic Custom Field "Read Only" in both - front & backend
Thanks. Will this be part of the next update release, or do I need to take care about saving & updating the new field.php file?
I assume, changes in the VIEW files will remain even after an update, as long as the changes where made via the HikaShop backend?
I assume, changes in the VIEW files will remain even after an update, as long as the changes where made via the HikaShop backend?
Last edit: 13 years 6 months ago by theweasel68.
Please Log in or Create an account to join the conversation.
13 years 6 months ago #94684
by Xavier
Replied by Xavier on topic Custom Field "Read Only" in both - front & backend
Hi,
We will not add it in short therm, but later there will be options to set the access on the custom fields.
We will not add it in short therm, but later there will be options to set the access on the custom fields.
Please Log in or Create an account to join the conversation.
Time to create page: 0.178 seconds