- Posts: 4
- Thank you received: 0
How to display checkbox type field values as list?
11 years 7 months ago #190912
by MatteoLin
How to display checkbox type field values as list? was created by MatteoLin
-- 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
, 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
Please, help me!!!
Thank you.
-- 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
Code:
div id="hikashop_product_custom_info_main"
12V DC
(24V DC su richiesta)
without any comma and space before the second value.
The html should be
Code:
12V DC<br />(24V DC su richiesta)
Please, help me!!!
Thank you.
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190947
by nicolas
Replied by nicolas on topic How to display checkbox type field values as list?
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)); ?>
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.
11 years 7 months ago #191041
by MatteoLin
Replied by MatteoLin on topic How to display checkbox type field values as list?
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
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.
11 years 7 months ago #191048
by nicolas
Replied by nicolas on topic How to display checkbox type field values as list?
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.165 seconds