How to display checkbox type field values as list?

  • Posts: 4
  • Thank you received: 0
10 years 6 months ago #190912

-- url of the page with the problem -- : selmartmp.injoomla.it/it/dissalatori-progress.html
-- HikaShop version -- : 2.3.5

Hi.

I've have to solve this problem.

In product view, when displaying the table that contains product specifications, all field values set as selected checkbox options are shown as a text where the values are separated by a comma and one space.
I need these values to be shown as a list with br tag following each value.
Is it possible? How to do it?

Look my page, please...
selmartmp.injoomla.it/it/dissalatori-progress.html

In the table contained in

div id="hikashop_product_custom_info_main"
, in the field labelled "Alimentazione", I'd prefer that the values "12V DC, (24V DC su richiesta)" could be shown as

12V DC
(24V DC su richiesta)

without any comma and space before the second value.

The html should be
12V DC<br />(24V DC su richiesta)

Please, help me!!!

Thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 84220
  • Thank you received: 13673
  • MODERATOR
10 years 6 months ago #190947

Hi,

Edit the file "show_block_custom_main" via the menu Display>Views and change the line:
<?php echo $this->fieldsClass->show($oneExtraField,$value); ?>

to:
<?php echo str_replace(', ','<br/>',$this->fieldsClass->show($oneExtraField,$value)); ?>

The following user(s) said Thank You: MatteoLin

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
10 years 6 months ago #191041

Thank you.

So doing it, it's OK.

Only for further information: this code editing will affect all values of custom fields, not only checkbox comma separated values... Is it true?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 84220
  • Thank you received: 13673
  • MODERATOR
10 years 6 months ago #191048

That's correct. But then you can potentially have a more complex version which does the replacing only for that custom field and not others if necessary.

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum