Die Tabellenüberschrift bei den Spezifikationen werden nicht angezeigt

  • Posts: 26
  • Thank you received: 1
  • Hikashop Business
3 weeks 11 hours ago #368567

-- HikaShop version -- : 6.1.0
-- Joomla version -- : 5.3.3
-- PHP version -- : 8.4.12

Dear Sir or Madam, In accordance with the Federal Employment Agency Act (BFSG), table headings must be displayed in tables! Accessible tables require HTML markup that identifies header cells and data cells and defines their relationship to each other. This information provides context for people who use assistive devices. Tables should only be used for tabular data. A table is automatically created during the specification, but the table heading is missing. How can I fix this? Furthermore, the H4 heading above the table is empty. Please help with this as well. Thank you very much.

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

  • Posts: 84497
  • Thank you received: 13739
  • MODERATOR
3 weeks 7 hours ago #368568

Hi,

You can go in the menu Display>Views and edit the product / show_block_specifications view file.
There, you can add a thead to the table if you need to.
Regarding the heading, it is supposed to contain the text "Specifications" (or the equivalent in your website language). The fact that it is empty likely indicate that you've added a translation override of that text in order to remove the text.

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

  • Posts: 26
  • Thank you received: 1
  • Hikashop Business
3 weeks 7 hours ago #368569

Thank you for your answer, unfortunately the show_block_specifications file does not exist under Views.

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

  • Posts: 26
  • Thank you received: 1
  • Hikashop Business
3 weeks 6 hours ago #368570

I found the setting. However, an additional element is now displayed. I must have made an error in the PHP file. What could be causing this? Thank you.

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

  • Posts: 26
  • Thank you received: 1
  • Hikashop Business
3 weeks 6 hours ago #368571

Fehler behoben: So sieht der Code jetzt aus:

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	6.1.0
 * @author	hikashop.com
 * @copyright	(C) 2010-2025 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
$this->fieldsClass->prefix = '';
$displayTitle = false;
ob_start();
foreach ($this->fields as $fieldName => $oneExtraField) {
	$value = '';
	if(empty($this->element->$fieldName) && !empty($this->element->main->$fieldName))
		$this->element->$fieldName = $this->element->main->$fieldName;
	if(isset($this->element->$fieldName))
		$value = trim($this->element->$fieldName);
	if(!empty($value) || $value === '0' || $oneExtraField->field_type == 'customtext') {
		$displayTitle = true;
	$oneExtraField->currentElement = $this->element;
	?>
		<tr class="hikashop_product_custom_<?php echo $oneExtraField->field_namekey;?>_line">
			<td class="key">
				<span id="hikashop_product_custom_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_name">
					<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
				</span>
			</td>
			<td>
				<span id="hikashop_product_custom_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_value">
					<?php echo $this->fieldsClass->show($oneExtraField,$value); ?>
				</span>
			</td>
		</tr>
	<?php
	}
}
$specifFields = ob_get_clean();
if($displayTitle){
?>

<div id="hikashop_product_custom_info_main" class="hikashop_product_custom_info_main">
<?php
	if($this->productlayout != 'show_tabular') {
?>
	<h2><?php echo JText::_('SPECIFICATIONS');?></h2>
<?php
	}
?>
	<table>
      <thead>
    <tr>
      <th>Titel</th>
      <th>Beschreibung</th>
    </tr>
  </thead>
	<?php echo $specifFields; ?>
   <td class="key">				<span>					<?php echo "Artikelnummer";?>				</span>			</td>	
        <td>				<span id="hikashop_product_custom_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_value">					<?php echo $this->element->product_code; ?>				</span>			</td>		
	</table>
</div>
<?php }

Last edit: 3 weeks 5 hours ago by nicolas.

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

  • Posts: 26
  • Thank you received: 1
  • Hikashop Business
3 weeks 6 hours ago #368572

Now I'm still missing a table heading for the weight selection: neu.shop.kreationen-seidel.de/stollen/pr...tollen-spitzenklasse
Which file do I need to edit?

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

  • Posts: 84497
  • Thank you received: 13739
  • MODERATOR
3 weeks 3 hours ago #368574

Hi,

The weight selection on this page comes from a characteristic. So, similar to the specifications, you can edit the view file product / show_block_characteristic via the menu Display>Views and add the thead in the table there.

To find which view files to edit in HikaShop, you can use the "Display view files" setting of the HikaShop configuration. I would recommend you try it out. It helps a lot when you need to customize HikaShop views.

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

  • Posts: 26
  • Thank you received: 1
  • Hikashop Business
2 weeks 6 days ago #368590

Hello. I've tried adjusting it, but it's not working properly. I'm still getting a code snippet.
neu.shop.kreationen-seidel.de/stollen/pr...tollen-spitzenklasse

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

  • Posts: 84497
  • Thank you received: 13739
  • MODERATOR
2 weeks 6 days ago #368592

Hi,

You've added the thead inside the table opening tag instead of adding it after it:
i.imgur.com/Nlxe0Ef.png

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

  • Posts: 26
  • Thank you received: 1
  • Hikashop Business
2 weeks 6 days ago #368596

However, at the position (line 118), where it should actually begin, no regular table code is displayed. Instead, only the following PHP code: $main_html = '<table class="hikashop_product_characteristics_table">';
$config = hikashop_config();
$count = count($this->characteristics);
$i = 0;
foreach($this->characteristics as $characteristic) {
$i++;
$main_html.='<tr class="hikashop_characteristic_line_'.$characteristic->characteristic_id.'" data-characrow="'.$i.'">';
$values ​​= array();
$switch_done = false;
if(!empty($characteristic->values)) {
foreach($characteristic->values ​​as $k => $value){
if(!$config->get('show_out_of_stock',1)){
$hasQuantity = false;
foreach($this->element->variants as $variant){
foreach($variant->characteristics as $variantCharacteristic){
if($variantCharacteristic->characteristic_id==$value->characteristic_id){
if($variant->product_quantity != 0){
$hasQuantity = true;
}elseif( $this->element->product_id==$variant->product_id && !$switch_done){
if($characteristic->characteristic_display_method == 'dropdown'){
$id = 'hikashop_product_characteristic_'.$characteristic->characteristic_id;
$js = "hikashopUpdateVariant(document.getElementById('".$id."'));";
}else{
$id = 'hikashop_product_characteristic';
$js = "var el = document.querySelector('[name=\"".$id."\"]'); if(el) el.checked = true; hikashopUpdateVariant(el);";
}

$js = "
window.hikashop.ready( function() {".$js."});";
$switch_done = true;
}
}
}
}
if(!$hasQuantity)
continue;
}
$values[$k] = $value->characteristic_value;
}
}

if(empty($values) || !is_array($values)){
echo JText::_('NO_VALUES_FOUND');
echo '</div>';
return;
}

if(is_array($this->characteristics)){
$characteristic_id = @$characteristic->characteristic_id;
@$characteristic->characteristic_id = 'hikashop_product_characteristic';
$id = 'hikashop_product_characteristic_'.$characteristic_id;
}else{
$id = $characteristic_id = $map;
}
$selected = (int)@$characteristic->default->characteristic_id;

$this->values ​​= array();
if(($characteristics_dynamic_display && $count > 1) || $characteristics_dynamic_display > 1) {
if($characteristic->characteristic_display_method!='radio')
$this->values[] = JHTML::_('select.option', '', JText::_('PLEASE_SELECT') );
$selected = '';
}
foreach($values ​​as $key => $val){
if(strlen($val)!=0 && empty($val)){
$val = $val.' ';
}

if(strpos($val, '<img ') !== false)
$val = str_replace('<img ', '<img onclick="return hikashopVariantSelected(\'hikashop_product_characteristic_'.$characteristic_id.$key.'\');" ', $val);
$clean = hikashop_translate(strip_tags($val));
$optionValue = ($characteristic->characteristic_display_method != 'radio' && !empty($clean) ? $clean : hikashop_translate($val));

$obj = new stdClass;
$obj->value = $key;
$obj->text = $optionValue;
$obj->id = 'hikashop_product_characteristic_'.$characteristic_id.'_'.$key;
$this->values[] = $obj;
}

$type = 'onclick';
if($characteristic->characteristic_display_method!='radio'){
$characteristic->characteristic_display_method='generic';
$type = 'onchange';
}
$options = ' '.$type.'="return hikashopVariantSelected(this);"';
$options .=' data-characteristic="'.$i.'"';
if($count == $i)
$options .=' data-last="1"';

if($characteristic->characteristic_display_method == 'generic') {
$html = JHTML::_(
'select.'.$characteristic->characteristic_display_method.'list',
$this->values,
@$characteristic->characteristic_id,
array(
'list.attr' => 'class="'.HK_FORM_SELECT_CLASS.'" size="1"' . $options,
'list.select' => $selected,
'id' => $id,
'option.text.toHtml' => false
)
);
Unfortunately, I'm not very familiar with PHP. So, can you please help me figure out where to insert the thread?
Thank you.

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

  • Posts: 26
  • Thank you received: 1
  • Hikashop Business
2 weeks 6 days ago #368597

I was able to solve it myself now
Thanks

The following user(s) said Thank You: nicolas

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

Time to create page: 0.070 seconds
Powered by Kunena Forum