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

#   Display custom field checkbox with ONLY selected

##

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

Less More

- Posts: 12
- Thank you received: 0
-
-

10 years 5 months ago [\#238944](#238944) by [andrewkatz](/forum/user/36243-andrewkatz "View andrewkatz's Profile")  *[Display custom field checkbox with ONLY selected](/forum/31-development/884285-display-custom-field-checkbox-with-only-selected#238944 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45 -- Browser(s) name and version -- : Chrome x.x.x -- Error-message(debug-mod must be tuned on) -- : no error message  I have a checkbox set of entries. The entry list is pretty long. I need to display ONLY those checkboxes that have been checked, not the whole field layout. Here is what I have a that moment for my code. What do I need to do instead of the Display I am showing? I don't want it actually showing the checkboxes on the front-end. That makes no sense!  I tried to find information about the different parameters for the &quot;DIsplay&quot; function, but cannot find it in the documentation.  Code:  fields)){ foreach($this-&gt;fields as $fieldName =&gt; $oneExtraField){ if($fieldName!='applicabletopresstype') continue;  ?&gt; Applicable to Press Type:  fieldsClass-&gt;display($oneExtraField,$this-&gt;element-&gt;$fieldName,'data&#91;product&#93;',false);  } }  ?&gt;   For example, if they have chosen JUST &quot;ALL&quot; value, I only want it to show:  Applicable to Press Type: ALL  If they have chose more than one press type, I want it to show:  Applicaple to Press Type: Press 1, Press 2, Press 3,")* was created by *[andrewkatz](/forum/user/36243-andrewkatz "View andrewkatz's Profile")*

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.4.45
-- Browser(s) name and version -- : Chrome x.x.x
-- Error-message(debug-mod must be tuned on) -- : no error message

I have a checkbox set of entries. The entry list is pretty long. I need to display ONLY those checkboxes that have been checked, not the whole field layout. Here is what I have a that moment for my code. What do I need to do instead of the Display I am showing? I don't want it actually showing the checkboxes on the front-end. That makes no sense!

I tried to find information about the different parameters for the "DIsplay" function, but cannot find it in the documentation.

Code:

&lt;?php /* Get Applicable to Press Type Custom Field */
if(!empty($this-&gt;fields)){
foreach($this-&gt;fields as $fieldName =&gt; $oneExtraField){
if($fieldName!='applicabletopresstype') continue;

?&gt;
&lt;p&gt;Applicable to Press Type:

&lt;?php
echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;element-&gt;$fieldName,'data[product]',false);

}
}

?&gt;
&lt;/p&gt;

For example, if they have chosen JUST "ALL" value, I only want it to show:

Applicable to Press Type: ALL

If they have chose more than one press type, I want it to show:

Applicaple to Press Type: Press 1, Press 2, Press 3,

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4NDI4NS1kaXNwbGF5LWN1c3RvbS1maWVsZC1jaGVja2JveC13aXRoLW9ubHktc2VsZWN0ZWQ/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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

10 years 5 months ago [\#239007](#239007) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display custom field checkbox with ONLY selected](/forum/31-development/884285-display-custom-field-checkbox-with-only-selected#239007 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45 -- Browser(s) name and version -- : Chrome x.x.x -- Error-message(debug-mod must be tuned on) -- : no error message  I have a checkbox set of entries. The entry list is pretty long. I need to display ONLY those checkboxes that have been checked, not the whole field layout. Here is what I have a that moment for my code. What do I need to do instead of the Display I am showing? I don't want it actually showing the checkboxes on the front-end. That makes no sense!  I tried to find information about the different parameters for the &quot;DIsplay&quot; function, but cannot find it in the documentation.  Code:  fields)){ foreach($this-&gt;fields as $fieldName =&gt; $oneExtraField){ if($fieldName!='applicabletopresstype') continue;  ?&gt; Applicable to Press Type:  fieldsClass-&gt;display($oneExtraField,$this-&gt;element-&gt;$fieldName,'data&#91;product&#93;',false);  } }  ?&gt;   For example, if they have chosen JUST &quot;ALL&quot; value, I only want it to show:  Applicable to Press Type: ALL  If they have chose more than one press type, I want it to show:  Applicaple to Press Type: Press 1, Press 2, Press 3,")*

Hi,

I'm sorry but we need more precise information to be able to help you.
Could you provide the link of the page you're talking about and a screenshot of the settings of the custom field you're talking about ?

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

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

Less More

- Posts: 12
- Thank you received: 0
-
-

10 years 5 months ago -  10 years 5 months ago [\#239052](#239052) by [andrewkatz](/forum/user/36243-andrewkatz "View andrewkatz's Profile")  Replied by *[andrewkatz](/forum/user/36243-andrewkatz "View andrewkatz's Profile")* on topic *[Display custom field checkbox with ONLY selected](/forum/31-development/884285-display-custom-field-checkbox-with-only-selected#239052 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45 -- Browser(s) name and version -- : Chrome x.x.x -- Error-message(debug-mod must be tuned on) -- : no error message  I have a checkbox set of entries. The entry list is pretty long. I need to display ONLY those checkboxes that have been checked, not the whole field layout. Here is what I have a that moment for my code. What do I need to do instead of the Display I am showing? I don't want it actually showing the checkboxes on the front-end. That makes no sense!  I tried to find information about the different parameters for the &quot;DIsplay&quot; function, but cannot find it in the documentation.  Code:  fields)){ foreach($this-&gt;fields as $fieldName =&gt; $oneExtraField){ if($fieldName!='applicabletopresstype') continue;  ?&gt; Applicable to Press Type:  fieldsClass-&gt;display($oneExtraField,$this-&gt;element-&gt;$fieldName,'data&#91;product&#93;',false);  } }  ?&gt;   For example, if they have chosen JUST &quot;ALL&quot; value, I only want it to show:  Applicable to Press Type: ALL  If they have chose more than one press type, I want it to show:  Applicaple to Press Type: Press 1, Press 2, Press 3,")*

Please go here:

[ shopdev.komorikare.com](http://shopdev.komorikare.com)

Login as hikashop / H!k@Sh0p for the popup

Then login as demo1 / demo1 as a user

Go to "SHop by Category / Speciality Products / BW / IC Cleaning Cloths

Then, click an item.

On the detail view at the bottom, you will see "Applicable to press type". The field is showing checkboxes. I'd like to be able to only show the values that were selected and not checkboxes as well.

As an example, one of the values is ALL. I'd like the field to show:

Applicable to Press Type: ALL

and that would be it. it wouldn't show the 30 other checkboxes.

If it has more than one press type, like GL40 and LSX29, I'd like it to show something like this:

Applicable to Press Type: GL40, LSX29

Last edit: 10 years 5 months ago by [andrewkatz](/forum/user/36243-andrewkatz "View andrewkatz's Profile"). Reason: more info

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4NDI4NS1kaXNwbGF5LWN1c3RvbS1maWVsZC1jaGVja2JveC13aXRoLW9ubHktc2VsZWN0ZWQ/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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

10 years 5 months ago [\#239068](#239068) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display custom field checkbox with ONLY selected](/forum/31-development/884285-display-custom-field-checkbox-with-only-selected#239068 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.45 -- Browser(s) name and version -- : Chrome x.x.x -- Error-message(debug-mod must be tuned on) -- : no error message  I have a checkbox set of entries. The entry list is pretty long. I need to display ONLY those checkboxes that have been checked, not the whole field layout. Here is what I have a that moment for my code. What do I need to do instead of the Display I am showing? I don't want it actually showing the checkboxes on the front-end. That makes no sense!  I tried to find information about the different parameters for the &quot;DIsplay&quot; function, but cannot find it in the documentation.  Code:  fields)){ foreach($this-&gt;fields as $fieldName =&gt; $oneExtraField){ if($fieldName!='applicabletopresstype') continue;  ?&gt; Applicable to Press Type:  fieldsClass-&gt;display($oneExtraField,$this-&gt;element-&gt;$fieldName,'data&#91;product&#93;',false);  } }  ?&gt;   For example, if they have chosen JUST &quot;ALL&quot; value, I only want it to show:  Applicable to Press Type: ALL  If they have chose more than one press type, I want it to show:  Applicaple to Press Type: Press 1, Press 2, Press 3,")*

Hi,

If I understand correctly, it's not:
echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;element-&gt;$fieldName,'data[product]',false);

that you want, but:
echo $this-&gt;fieldsClass-&gt;show($oneExtraField,$this-&gt;element-&gt;$fieldName);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4NDI4NS1kaXNwbGF5LWN1c3RvbS1maWVsZC1jaGVja2JveC13aXRoLW9ubHktc2VsZWN0ZWQ/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.245 seconds

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

[](#top)
