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

#   Custom fields

##

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 3 months ago [\#22571](#22571) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22571 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

so i tried then registering and i get a next button, but when i click next the only thing that happens is the form resets.

i could really use some help here.

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

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 3 months ago [\#22573](#22573) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22573 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

okay i uninstalled the cart, removed my view overrides etc... deleted the database and all the files and then reinstalled the whole thing again directly from the business download.
i set up a few products and a payment zone etc..
i can then checkout.

then i added two custom fields each on the order table

parent field and child field.
parent field is a single drop down.
child is a single drop down with a limit to parent field on one of the options.

doesnt work. no errors and no javascript present.it lets me checkout but doesnt do the limited fields properly. does parent need to have some setting i am not seeing?

thanks, Liz

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMDcwLWN1c3RvbS1maWVsZHM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

15 years 3 months ago [\#22605](#22605) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22605 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

Thank you for the research you did on the problem.
There was indeed some code missing to handle that option for custom fields of the type "order". We've published a new version which fixes the problem. You can download it again on our website and install over your current version to make it work.

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

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 3 months ago [\#22608](#22608) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22608 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

THANK YOU!! that works!

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

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 3 months ago [\#22615](#22615) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22615 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

oops almost works

it works with a straight usage of the template file however... if the parent doesnt appear at all the child is still appearing. i have my template working so that based on a custom field of product type it shows different parents. when the parent with the child does not appear. the child still appears. here is the code i have for my custom_fields view...

&lt;?php
$mydates = 'default';
foreach($this-&gt;rows as $i =&gt; $row){

if (preg_match("/rosh/",$row-&gt;dates)) {
$mydates = "rosh";
}
//echo $row-&gt;dates;
}
//echo '-'.$mydates;
?&gt;

&lt;?php
if ($mydates =='rosh'){
$type = $this-&gt;type;
foreach($this-&gt;extraFields[$type] as $fieldName =&gt; $oneExtraField) {
if ($fieldName != 'default-dates'){; ?&gt;
&lt;tr class="hikashop_checkout_&lt;?php echo $fieldName;?&gt;_line" id="hikashop_&lt;?php echo $type.'_'.$oneExtraField-&gt;field_namekey; ?&gt;"&gt;
&lt;td class="key"&gt;
&lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField);?&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;?php $onWhat='onchange'; if($oneExtraField-&gt;field_type=='radio') $onWhat='onclick';
echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;$type-&gt;$fieldName,'data',false,' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'order\',0);"');
?&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?php } ?&gt;
&lt;?php } ?&gt;

&lt;?php

} else {

$type = $this-&gt;type;
foreach($this-&gt;extraFields[$type] as $fieldName =&gt; $oneExtraField) {
if ($fieldName != 'rosh-dates'){; ?&gt;
&lt;tr class="hikashop_checkout_&lt;?php echo $fieldName;?&gt;_line" id="hikashop_&lt;?php echo $type.'_'.$oneExtraField-&gt;field_namekey; ?&gt;"&gt;
&lt;td class="key"&gt;
&lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField);?&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;?php $onWhat='onchange'; if($oneExtraField-&gt;field_type=='radio') $onWhat='onclick';
echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;$type-&gt;$fieldName,'data',false,' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'order\',0);"');
?&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?php } ?&gt;
&lt;?php } ?&gt;
&lt;?php } ?&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMDcwLWN1c3RvbS1maWVsZHM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

15 years 3 months ago [\#22616](#22616) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22616 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

You should do it differently. Instead of not showing at all the HTML of the custom field, you should still display it but add a style="dsiplay:none;" on the tr tag so that the custom field line is hidden. That should allow the JS handling the parent option to work properly.

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

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 3 months ago [\#22618](#22618) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22618 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

that could be a problem though: i need these fields to be required ... they are pickup date fields and i need them to not be passed through to the backend and cart as part of the order. wont that happen if they are there but not showing?

L

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

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 2 months ago -  15 years 2 months ago [\#22625](#22625) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22625 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

okay trying it your way.
i modified the script to add a class to hide the unwanted select, but then of course, it doesnt validate. so i added a class of dontValidate to the select that is hidden as well... now i am stuck with how to fix the validation to ignore a class of dontValidate invalid LOL

i think that is here (in hikashop.js.. any help with how to modify it?

function hikashopCheckField(elementToCheck,type,i,elementName,form){
if(elementToCheck){
var isValid = false;
if(typeof elementToCheck.value != 'undefined'){
if(elementToCheck.value==' ' &amp;&amp; typeof form[elementName+'[]'] != 'undefined'){
if(form[elementName+'[]'].checked){
isValid = true;
}else{
for(var a=0; a &lt; form[elementName+'[]'].length; a++){
if(form[elementName+'[]'][a].checked &amp;&amp; form[elementName+'[]'][a].value.length&gt;0) isValid = true;
}
}
}else{
if(elementToCheck.value.length&gt;0) isValid = true;
}
}else{
for(var a=0; a &lt; elementToCheck.length; a++){
if(elementToCheck[a].checked &amp;&amp; elementToCheck[a].value.length&gt;0) isValid = true;
}
}

if(!isValid){
elementToCheck.className = elementToCheck.className +' invalid';
alert(hikashop[type]*);
return false;
}
}
return true;
}

Liz*

Last edit: 15 years 2 months ago by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile"). Reason: typos

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMDcwLWN1c3RvbS1maWVsZHM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

15 years 2 months ago [\#22626](#22626) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22626 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

It's indeed there. In the elementToCheck.className you should check if the class is dontValidate and return true;
However, there is a double check. One in javascript, and one server side. So you will also have to change the server check in the function _checkOneInput of the file administrator/components/com_hikashop/classes/field.php because otherwise, the system won't accept the data.

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

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 2 months ago [\#22627](#22627) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22627 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

thinking about this the other way ... maybe it would be easier to use javascript on the the page to remove the required class from the hidden fields... hmmm

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

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 2 months ago [\#22628](#22628) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22628 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

i couldnt get that to work. i also am worried about tracking too many hacks to core files for updating...
what do you think the best way to do this would be?

one select list of dates and one set of hours needs to appear as default.
then there are items which call an override select which is a parent to a number of child hours lists...

they all need to be required.

furthermore another weird thing that happens is that when you click next after all the filling of the first page... you click next and it takes you to another page where it resets the select lists and you have to fill them in again... which is not really great. why is that?

thanks, Liz

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMDcwLWN1c3RvbS1maWVsZHM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

15 years 2 months ago [\#22644](#22644) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22644 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

Well the custom fields system is indeed no made to handle it that way.
One solution which might be better is to not set the field as required in the options of the field, but to add it on the fly with javascript on page load and add/remove it based on the selection of the user.
That wouldn't produce any hack of core files and that seems like a lighter solution.

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

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 2 months ago [\#22665](#22665) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22665 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

okay good idea... what do i need to add exactly to which element to invoke the required script? i couldnt see any differences or classes that did that.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMDcwLWN1c3RvbS1maWVsZHM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

15 years 2 months ago [\#22679](#22679) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22679 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

If you look on our demo website at the javascript of the checkout page, you can see that code: Code:

var hikashop=Array(); hikashop['reqFieldsComp']=Array(); hikashop['validFieldsComp']=Array(); hikashop['reqFieldsComp']['register'] = Array('name','username','email','password','password2'); hikashop['validFieldsComp']['register'] = Array('Please enter a value for the field Name','Please enter a value for the field Username','Please enter a value for the field E-mail','Please enter a value for the field Password','Please enter a value for the field password2'); hikashop['reqFieldsComp']['address'] = Array('address_title','address_firstname','address_lastname','address_street','address_city','address_telephone'); hikashop['validFieldsComp']['address'] = Array('Please enter a value for the field Title','Please enter a value for the field First name','Please enter a value for the field Last name','Please enter a value for the field Street','Please enter a value for the field City','Please enter a value for the field Telephone');

That code specifies which field is required. Since your fields are of the table order, you should add something like that:
hikashop = Array('my_custom_field_column');
hikashop = Array('Please enter a value for the field My field');
Or then remove these arrays when needed via some javascript.

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

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

Less More

- Posts: 102
- Thank you received: 0
-
-

15 years 2 months ago [\#22694](#22694) by [MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")  Replied by *[MinnieMouse](/forum/user/3535-minniemouse "View MinnieMouse's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#22694 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

i did it. so i did it the first way i tried so that i didnt feed in the extra fields at all. i just added some code so that any field with a prefix of X would not be inserted. here it is:

thanks for all the help!!!

&lt;?php
$searchterm = 'rosh'; //the special holiday menu that overrides the default entertainment menu. this value should be the same as the value in the dates type select at the bottom of a product.
$mydates = 'default';

foreach($this-&gt;rows as $i =&gt; $row){

//$row-&gt;dates is the value that is retrieved from the cart products custom field dates.

if (preg_match("/$searchterm/",$row-&gt;dates)) {
$mydates = $searchterm;
}

}

?&gt;

&lt;?php
if ($mydates == $searchterm){
$type = $this-&gt;type;
foreach($this-&gt;extraFields[$type] as $fieldName =&gt; $oneExtraField) {
if ($fieldName != 'default-dates'){; ?&gt;
&lt;tr class="hikashop_checkout_&lt;?php echo $fieldName;?&gt;_line" id="hikashop_&lt;?php echo $type.'_'.$oneExtraField-&gt;field_namekey; ?&gt;"&gt;
&lt;td class="key"&gt;
&lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField);?&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;?php $onWhat='onchange'; if($oneExtraField-&gt;field_type=='radio') $onWhat='onclick';
echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;$type-&gt;$fieldName,'data',false,' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'order\',0);"');
?&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?php } ?&gt;
&lt;?php } ?&gt;

&lt;?php

} else {

$type = $this-&gt;type;
foreach($this-&gt;extraFields[$type] as $fieldName =&gt; $oneExtraField) {
if (!preg_match("/$searchterm/",$fieldName)){; ?&gt;
&lt;tr class="hikashop_checkout_&lt;?php echo $fieldName;?&gt;_line" id="hikashop_&lt;?php echo $type.'_'.$oneExtraField-&gt;field_namekey; ?&gt;"&gt;
&lt;td class="key"&gt;
&lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField);?&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;?php $onWhat='onchange'; if($oneExtraField-&gt;field_type=='radio') $onWhat='onclick';
echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;$type-&gt;$fieldName,'data',false,' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'order\',0);"');
?&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?php } ?&gt;
&lt;?php } ?&gt;
&lt;?php } ?&gt;

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

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

Less More

- Posts: 209
- Thank you received: 18
-
-

15 years 2 months ago [\#24745](#24745) by [JIK](/forum/user/362-jik "View JIK's Profile")  Replied by *[JIK](/forum/user/362-jik "View JIK's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#24745 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

Hi Nicolas, getting back to my original question at the start of this thread, I am still stuck on this...
I'm using Essentials 1.5.3.

I need to get more information from the customer depending on what product they are buying.

For example:

If they buy a product from Category A, I also need to know their birthdate
If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate

To which you replied...

> Category custom fields are only to add information to categories. You won't be able to do what you want with them.
>
> You should wait for next release (before the end of the week) as it includes new options for custom fields which will allow you to display them only for some categories. That way, you will be able to create custom fields of the table "item" and restrict them to category A or B.

So now I've got the latest release but I can't see where I can create a custom field of the table "item" as you describe or how to restrict a field to a category.

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMDcwLWN1c3RvbS1maWVsZHM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

15 years 2 months ago [\#24752](#24752) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#24752 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

Hi,

Custom fields of the table "item" are only available in the Business edition. That's why you don't see them.

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

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

Less More

- Posts: 34
- Thank you received: 0
-
-

14 years 11 months ago [\#30178](#30178) by [SD](/forum/user/3897-sd "View SD's Profile")  Replied by *[SD](/forum/user/3897-sd "View SD's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#30178 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

I have version 1.5.3 on Joomla 1.7. I have added a custom field for an extra address line . I've published it everywhere, but for some reason the "Core" column remains unpublished and it won't let me publish it either - I can't even click on it. Is there any way to fix this problem?

I'm assuming this is why it's entered but not saved on the client end.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMDcwLWN1c3RvbS1maWVsZHM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

14 years 11 months ago [\#30219](#30219) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Custom fields](/forum/4-how-to/22070-custom-fields?start=20#30219 "Hi,  I need to get more information from the customer depending on what product they are buying.  For example:  If they buy a product from Category A, I also need to know their birthdate If they buy a product from Category B, I also need to know their drivers licence number but not their birthdate  I have tried creating a custom &quot;Category&quot; field but I can't see how to link this just to a particular category of products nor can I get it to show anywhere in the front end, either on the product page or the registration page.  After creating the custom category fields, I can see them when I edit the category details but can't seem to turn some off for a particular category.  Any help appreciated!")*

The "core" column is to say whether a custom field was in HikaShop by default or not (you can't delete them).
So it's normal that you can't change it and it has no incidence on the behavior of the custom field.

If the custom field doesn't get the value entered, it comes from something else. You should activate the debug mode in the configuration of joomla and try again to see if you get an error message. If no, please give a link to that page so that we can have a look.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIyMDcwLWN1c3RvbS1maWVsZHM/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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.183 seconds

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

[](#top)
