[Skip to main content](#vessel-content)

#   Custom Field "Read Only" in both - front &amp; backend

##

- **[theweasel68](/forum/user/13135-theweasel68 "View theweasel68's Profile")**
- [![theweasel68's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/13135-theweasel68 "View theweasel68's Profile") Topic Author
- [ Offline](/forum/user/13135-theweasel68)

Less More

- Posts: 48
- Thank you received: 0
-
-

13 years 7 months ago [\#94516](#94516) by [theweasel68](/forum/user/13135-theweasel68 "View theweasel68's Profile")  *[Custom Field "Read Only" in both - front &amp; backend](/forum/3-bug-report/79293-custom-field-read-only-in-both-front-backend#94516 "Hi, I would like to set several custom fields (for example the &quot;address company&quot; to &quot;read only&quot;. Meaning, the user cannot change this in the frontend. As it is described in the help section: &quot;Read only: Used to lock the value of a text type custom field, the customer can't change it's value.&quot;  However, the point is, if I set a field to &quot;Read Only&quot;, 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")* was created by *[theweasel68](/forum/user/13135-theweasel68 "View theweasel68's Profile")*

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83OTI5My1jdXN0b20tZmllbGQtcmVhZC1vbmx5LWluLWJvdGgtZnJvbnQtYmFja2VuZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 7 months ago [\#94557](#94557) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Custom Field "Read Only" in both - front &amp; backend](/forum/3-bug-report/79293-custom-field-read-only-in-both-front-backend#94557 "Hi, I would like to set several custom fields (for example the &quot;address company&quot; to &quot;read only&quot;. Meaning, the user cannot change this in the frontend. As it is described in the help section: &quot;Read only: Used to lock the value of a text type custom field, the customer can't change it's value.&quot;  However, the point is, if I set a field to &quot;Read Only&quot;, 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")*

Hi,

What can be done is editing the view "user / editaddress" (backend template) and relplace the line: Code:

echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;address-&gt;$fieldName,'data[address]['.$fieldName.']',false,''.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'address\',0);"'); ?&gt;

By: Code:

echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;address-&gt;$fieldName,'data[address]['.$fieldName.']',false,'backend'.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'address\',0);"'); ?&gt;

And in the class field.php (administrator/components/com_hikashop/classes/field.php) replace the line: Code:

$size .= empty($field-&gt;field_options['readonly']) ? '' : ' readonly="readonly"';

By: Code:

if(!preg_match('/^backend/',$options)) $size .= empty($field-&gt;field_options['readonly']) ? '' : ' readonly="readonly"'; $options = preg_replace('/^backend/','',$options);

The following user(s) said Thank You: [theweasel68](/forum/user/13135-theweasel68 "View theweasel68's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83OTI5My1jdXN0b20tZmllbGQtcmVhZC1vbmx5LWluLWJvdGgtZnJvbnQtYmFja2VuZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[theweasel68](/forum/user/13135-theweasel68 "View theweasel68's Profile")**
- [![theweasel68's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/13135-theweasel68 "View theweasel68's Profile") Topic Author
- [ Offline](/forum/user/13135-theweasel68)

Less More

- Posts: 48
- Thank you received: 0
-
-

13 years 7 months ago -  13 years 7 months ago [\#94583](#94583) by [theweasel68](/forum/user/13135-theweasel68 "View theweasel68's Profile")  Replied by *[theweasel68](/forum/user/13135-theweasel68 "View theweasel68's Profile")* on topic *[Custom Field "Read Only" in both - front &amp; backend](/forum/3-bug-report/79293-custom-field-read-only-in-both-front-backend#94583 "Hi, I would like to set several custom fields (for example the &quot;address company&quot; to &quot;read only&quot;. Meaning, the user cannot change this in the frontend. As it is described in the help section: &quot;Read only: Used to lock the value of a text type custom field, the customer can't change it's value.&quot;  However, the point is, if I set a field to &quot;Read Only&quot;, 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")*

Thanks. Will this be part of the next update release, or do I need to take care about saving &amp; 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?

Last edit: 13 years 7 months ago by [theweasel68](/forum/user/13135-theweasel68 "View theweasel68's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83OTI5My1jdXN0b20tZmllbGQtcmVhZC1vbmx5LWluLWJvdGgtZnJvbnQtYmFja2VuZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 7 months ago [\#94684](#94684) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Custom Field "Read Only" in both - front &amp; backend](/forum/3-bug-report/79293-custom-field-read-only-in-both-front-backend#94684 "Hi, I would like to set several custom fields (for example the &quot;address company&quot; to &quot;read only&quot;. Meaning, the user cannot change this in the frontend. As it is described in the help section: &quot;Read only: Used to lock the value of a text type custom field, the customer can't change it's value.&quot;  However, the point is, if I set a field to &quot;Read Only&quot;, 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")*

Hi,

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83OTI5My1jdXN0b20tZmllbGQtcmVhZC1vbmx5LWluLWJvdGgtZnJvbnQtYmFja2VuZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.065 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
