Also, in the multilingual version of Phoca Cart, how to translate the content of Custom fields?
In the screenshot, custom field Användning has no content and it is displayed anyway. Also in Serbian version of shop it is displayed in Swedish.




Code: Select all
$cFG = [];
$fields = PhocacartFields::getProductFields($x);
foreach ($fields as $fieldsGroup) {
$hasValue = false;
// Provera da li postoji barem jedno popunjeno polje u grupi
foreach ($fieldsGroup->fields as $fieldCheck) {
if (!empty($fieldCheck->value)) {
$hasValue = true;
break;
}
}
if (!$hasValue) {
continue; // preskoči grupu ako nema popunjenih polja
}
// Ako je došlo dovde, onda grupa ima nešto i možemo je prikazati
$alias = 'field-' . $fieldsGroup->id;
$title = $fieldsGroup->title ?: Text::_('COM_PHOCACART_PRODUCT_CUSTOM_FIELDS');
$tabLiO .= '<li class="' . $this->s['c']['nav-item'] . ' ' . $activeTab.'"><a href="#' . $alias . '" data-bs-toggle="tab" class="' . $this->s['c']['nav-link'] . ' ' . $active . '">' . $title . '</a></li>';
$tabO .= '<div class="' . $this->s['c']['tabpane'] . ' ph-tab-pane ' . $active . '" id="' . $alias . '">';
$tabO .= '<div class="' . $this->s['c']['row'] . '">';
foreach ($fieldsGroup->fields as $field) {
if (!empty($field->value)) {
$tabO .= '<div class="' . $this->s['c']['col.xs12.sm4.md4'] . ' ph-cf-title">';
$tabO .= isset($field->title) ? $field->title : '';
$tabO .= '</div>';
$tabO .= '<div class="' . $this->s['c']['col.xs12.sm6.md6'] . ' ph-cf-value">';
$tabO .= $field->value;
$tabO .= '</div>';
}
}
$tabO .= '</div>';
$tabO .= '</div>';
$active = $activeTab = '';
}

