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

#   Text Output Change from Checkboxes

##

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

Less More

- Posts: 62
- Thank you received: 0
-
-

11 years 2 months ago [\#211602](#211602) by [ninjab](/forum/user/33534-ninjab "View ninjab's Profile")  *[Text Output Change from Checkboxes](/forum/26-product-category-display/878776-text-output-change-from-checkboxes#211602 "-- HikaShop version -- : 2.5.0  Hi there,  I have added a customfield checkbox selection for the backend to select a colour, and the data is outputted on the front end as just text (which is what I want it to do). What I am wanting to know, is how to I add a space after the data as its having commas without spaces between each colour name?  For example, the output is outputting this at the moment: Red,Blue,Green  And I am wanting to show like this: Red, Blue, Green.  I assume the change would need to be done in PHP?  My alternative option is just change the customfield to a text box and enter the colours in manually but I'd prefer not to.  Many thanks.")* was created by *[ninjab](/forum/user/33534-ninjab "View ninjab's Profile")*

-- HikaShop version -- : 2.5.0

Hi there,

I have added a customfield checkbox selection for the backend to select a colour, and the data is outputted on the front end as just text (which is what I want it to do). What I am wanting to know, is how to I add a space after the data as its having commas without spaces between each colour name?

For example, the output is outputting this at the moment:
Red,Blue,Green

And I am wanting to show like this:
Red, Blue, Green.

I assume the change would need to be done in PHP?

My alternative option is just change the customfield to a text box and enter the colours in manually but I'd prefer not to.

Many thanks.

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

Less More

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

11 years 2 months ago [\#211633](#211633) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Text Output Change from Checkboxes](/forum/26-product-category-display/878776-text-output-change-from-checkboxes#211633 "-- HikaShop version -- : 2.5.0  Hi there,  I have added a customfield checkbox selection for the backend to select a colour, and the data is outputted on the front end as just text (which is what I want it to do). What I am wanting to know, is how to I add a space after the data as its having commas without spaces between each colour name?  For example, the output is outputting this at the moment: Red,Blue,Green  And I am wanting to show like this: Red, Blue, Green.  I assume the change would need to be done in PHP?  My alternative option is just change the customfield to a text box and enter the colours in manually but I'd prefer not to.  Many thanks.")*

Hi,

Here is the code which handles the display of the checkbox custom fields values on the frontend:
[ take.ms/vbwVo](http://take.ms/vbwVo)
It's in the file administrator/components/com_hikashop/classes/field.php
As you can see, the separator there is already a comma followed by a space. So that should already be the case, unless that code has been changed on your website or something else is modifying the output.
Could you provide a link to a product page with the issue so that we can look at it ? Can you also check that the code in the field.php is correct ?

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

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

Less More

- Posts: 62
- Thank you received: 0
-
-

11 years 2 months ago -  11 years 2 months ago [\#211643](#211643) by [ninjab](/forum/user/33534-ninjab "View ninjab's Profile")  Replied by *[ninjab](/forum/user/33534-ninjab "View ninjab's Profile")* on topic *[Text Output Change from Checkboxes](/forum/26-product-category-display/878776-text-output-change-from-checkboxes#211643 "-- HikaShop version -- : 2.5.0  Hi there,  I have added a customfield checkbox selection for the backend to select a colour, and the data is outputted on the front end as just text (which is what I want it to do). What I am wanting to know, is how to I add a space after the data as its having commas without spaces between each colour name?  For example, the output is outputting this at the moment: Red,Blue,Green  And I am wanting to show like this: Red, Blue, Green.  I assume the change would need to be done in PHP?  My alternative option is just change the customfield to a text box and enter the colours in manually but I'd prefer not to.  Many thanks.")*

Hi Nicholas, thankd for the reply.

I have it only on a localserver at the moment with wamp.

Its strange, I found the code you mentioned and it had the space. But doesnt seem to generate like that.

This is the code here:
Code:

class hikashopCheckbox extends hikashopRadioCheck { var $radioType = 'checkbox'; function display($field, $value, $map, $inside, $options = '', $test = false, $allFields = null, $allValues = null){ if(!is_array($value)){ $value = explode(',',$value); } return parent::display($field,$value,$map,$inside,$options,$test,$allFields,$allValues); } function show(&amp;$field,$value){ if(!is_array($value)){ $value = explode(',',$value); } if(!empty($field-&gt;field_value) &amp;&amp; !is_array($field-&gt;field_value)){ $field-&gt;field_value = $this-&gt;parent-&gt;explodeValues($field-&gt;field_value); } $results = array(); foreach($value as $val){ if(isset($field-&gt;field_value[$val])) $val = $field-&gt;field_value[$val]-&gt;value; $results[] = parent::show($field,$val); } return implode(', ',$results); }

Thanks.

Last edit: 11 years 2 months ago by [ninjab](/forum/user/33534-ninjab "View ninjab's Profile").

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

Less More

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

11 years 2 months ago [\#211678](#211678) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Text Output Change from Checkboxes](/forum/26-product-category-display/878776-text-output-change-from-checkboxes#211678 "-- HikaShop version -- : 2.5.0  Hi there,  I have added a customfield checkbox selection for the backend to select a colour, and the data is outputted on the front end as just text (which is what I want it to do). What I am wanting to know, is how to I add a space after the data as its having commas without spaces between each colour name?  For example, the output is outputting this at the moment: Red,Blue,Green  And I am wanting to show like this: Red, Blue, Green.  I assume the change would need to be done in PHP?  My alternative option is just change the customfield to a text box and enter the colours in manually but I'd prefer not to.  Many thanks.")*

Hi,

Then I'm afraid we'll have to look at the issue directly on the page. Could you put it temporarily online so that we could access it ?

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

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

[](#top)
