- Posts: 88
- Thank you received: 20
Translate Custom field Checkbox value
9 years 8 months ago - 9 years 8 months ago #260996
by dyvel
Translate Custom field Checkbox value was created by dyvel
-- HikaShop version -- : 3.0.0
Hi
I have a custom field of type checkbox with label: COLOR
I have a value and title within called BLACK
My translation works fine in backend, but in frontend where I output the content, it's not getting through.
Here's my code:
EDIT: if I use this echo in my foreach, it works:
Perhaps there are better ways?
EDIT: Sorry about wrong category for topic...
Thanks
Hi
I have a custom field of type checkbox with label: COLOR
I have a value and title within called BLACK
My translation works fine in backend, but in frontend where I output the content, it's not getting through.
Here's my code:
Code:
<ul class="list">
<?php
$color = explode(",",$this->element->color);
foreach ($color as $key => $value) {
echo '<li>';
$myField = $fieldclass->get('17');
echo $myField->field_value[$value]->value;
echo '</li>';
}
?>
</ul>
EDIT: if I use this echo in my foreach, it works:
Code:
echo JText::_($myField->field_value[$value]->value);
Perhaps there are better ways?
EDIT: Sorry about wrong category for topic...
Thanks
Last edit: 9 years 8 months ago by dyvel.
Please Log in or Create an account to join the conversation.
9 years 8 months ago #261008
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Translate Custom field Checkbox value
Hi,
When you want to display a custom field ; the best is to use the function provided by the custom field class ; like it is done in current HikaShop view :
It will support every kind of custom field and perform the translation for you.
Regards,
When you want to display a custom field ; the best is to use the function provided by the custom field class ; like it is done in current HikaShop view :
Code:
echo $fieldsClass->show($field, $value);
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.116 seconds