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

#   Custom field view override

##

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

Less More

- Posts: 432
- Thank you received: 22
-

4 years 7 months ago [\#340792](#340792) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  *[Custom field view override](/forum/26-product-category-display/904246-custom-field-view-override#340792 "-- HikaShop version -- : 4.5.0  Is there any posibility to override view of custom field. I can do it with core Joomla custom fields, but not with Hikashop.")* was created by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")*

-- HikaShop version -- : 4.5.0

Is there any posibility to override view of custom field.
I can do it with core Joomla custom fields, but not with Hikashop.

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

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

Less More

- Posts: 4820
- Thank you received: 652
-
-

4 years 7 months ago -  4 years 7 months ago [\#340794](#340794) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Custom field view override](/forum/26-product-category-display/904246-custom-field-view-override#340794 "-- HikaShop version -- : 4.5.0  Is there any posibility to override view of custom field. I can do it with core Joomla custom fields, but not with Hikashop.")*

Hello,

It is possible, have a look on this **[ documentation](https://www.hikashop.com/support/documentation/153-customize-the-display.html#layout)** to learn how to perform override view in HikaShop.

And now a little tips, as a custom field can be display in looots of different views, use the "**Display view fil**e" option, from **Main HikaShop Configuration**, **Advanced** tab and first settings part.
If you activated it (***frontend***) you will have view file **references** and know which view file you have to edit.

Hope this will help you to achieved your needs
Regards

Last edit: 4 years 7 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

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

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

Less More

- Posts: 432
- Thank you received: 22
-

4 years 7 months ago [\#340856](#340856) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Custom field view override](/forum/26-product-category-display/904246-custom-field-view-override#340856 "-- HikaShop version -- : 4.5.0  Is there any posibility to override view of custom field. I can do it with core Joomla custom fields, but not with Hikashop.")*

This I understand, but there is only show_block_custom_item. I need to override only custom field type Ajax file or image.
So output for specific type.
In Joomla this is easy.

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

4 years 7 months ago [\#340858](#340858) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom field view override](/forum/26-product-category-display/904246-custom-field-view-override#340858 "-- HikaShop version -- : 4.5.0  Is there any posibility to override view of custom field. I can do it with core Joomla custom fields, but not with Hikashop.")*

Hi,

Custom fields don't have view files.
The HTML of a custom field is generated in different places. For example, a "text" type custom field will have the HTML of the input generated directly in the file administrator/components/com_hikashop/classes/field.php
Now that doesn't mean that this HTML display cannot be overridden. It can in fact, but not with a view override. It can be done by developing a plugin implementing the Fields API to add your own custom type of custom fields. In your own type of custom field, you can extend from an existing custom field type class and that way, you can redefine things up.
However, this isn't easy as it requires proper PHP knowledge. We do have documentation on this here:
[ www.hikashop.com/support/documentation/6...entation.html#fields](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#fields)

Now, besides this, there are also other things that can be done:

- AJAX custom fields use texts for their display. So if you want to change these texts, you can use translation overrides to modify them: [ www.hikashop.com/download/languages.html#modify](https://www.hikashop.com/download/languages.html#modify)
That's much much easier than developing a plugin or making a view override

- While the HTML of a custom field is not generated in a view file, it's a view file which calls the custom field system to generate that HTML. So there are many things you can do in the view file calling the custom field system to either dynamically modify the parameters of the custom field before the custom field system is called, or modifying the HTML returned after the custom field system is called. In HikaShop 4.5.1 the code generating the HTML of the custom field of the table "item" on the product details page is: Code:

$html = $this-&gt;fieldsClass-&gt;display( $oneExtraField, $itemData, 'data[item]['.$oneExtraField-&gt;field_namekey.']', false, ' '.$onWhat.'="window.hikashop.toggleField(this.value,\''.$fieldName.'\',\'item\',0);"', false, $this-&gt;itemFields );

in the view file show_block_custom_item.
So for example, you could change the type of the custom fields to text with such code before that line: Code:

if($oneExtraField-&gt;field_namekey == 'xxx') { $oneExtraField-&gt;field_type='text'; }

where xxx is the column name of the custom field.
Similarly, after that line, you could use such code to change the HTML of the custom field: Code:

if($oneExtraField-&gt;field_namekey == 'xxx') { $html = str_replace('&lt;input ','&lt;input autocomplete="off" ', $html); }

This code would add an autocomplete attribute to a text custom field for example.

- Finally, since you're using custom fields of the type AJAX, they use the uploader system we have in HikaShop. That uploader system actually uses view files to generate preview of each uploaded element. So if you search for "upload" in the Display&gt;Views menu, you'll see that you have both file_entry and image_entry view files which are actually used to generate the HTML of each element already uploaded in the uploader. So these view files could be overridden too.

So in short, since you didn't say what modification you wanted to make I can't tell you what would be the appropriate way to go. Overrides can be done but the complexity will depend on what you want to change.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDQyNDYtY3VzdG9tLWZpZWxkLXZpZXctb3ZlcnJpZGU/dG1wbD1tYXJrZG93bg==) 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.057 seconds

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