Thanks for the Reply!
You were right(ofcorse) the problem is in a template file. The template contains the following file wich causes the error: hikashop_characteristics.php to override the characteristics table layout on the product page. The file contains the following code:
<?php
function hikashop_characteristics_html(&$element,&$params, &$obj){
if(empty($element->main->characteristics)) return '';
$obj->characteristics=&$element->main->characteristics;
foreach($obj->characteristics as $k => $characteristic){
if(empty($obj->characteristics[$k]->characteristic_display_method)){
$obj->characteristics[$k]->characteristic_display_method = $params->get('characteristic_display');
}
}
$obj->load();
if(empty($html)){
switch($params->get('characteristic_display')){
default:
case 'radio':
case 'dropdown':
$main_html = '<div class="hikashop_product_characteristics_table">';
$config =& hikashop_config();
foreach($obj->characteristics as $characteristic){
$main_html.='<div class="hikashop_characteristic_line_'.$characteristic->characteristic_id.'">';
$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($element->variants as $variant){
foreach($variant->characteristics as $variantCharacteristic){
if($variantCharacteristic->characteristic_id==$value->characteristic_id){
if($variant->product_quantity != 0){
$hasQuantity = true;
}elseif( $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['.$characteristic->characteristic_id.']';
$js = "var el = document.querySelector('[name=\"".$id."\"]'); if(el) el.checked = true; hikashopUpdateVariant(el);";
}
$js = "
window.hikashop.ready( function() {".$js."});";
if (!HIKASHOP_PHP5) {
$doc =& JFactory::getDocument();
}else{
$doc = JFactory::getDocument();
}
$doc->addScriptDeclaration("\n<!--\n".$js."\n//-->\n");
$switch_done = true;
}
}
}
}
if(!$hasQuantity) continue;
}
$values[$k]=$value->characteristic_value;
}
}
$html=$obj->display(@$characteristic->characteristic_id,@$characteristic->default->characteristic_id,$values,$characteristic->characteristic_display_method);
if($params->get('characteristic_display_text') && isset($characteristic->characteristic_value)){
$html=$characteristic->characteristic_value.'</div><div class="col-md-9">'.$html;
}
$main_html.='<div class="row"><div class="col-md-3">'.$html.'</div></div>';
}
$main_html.='</div></div>';
$html = $main_html;
break;
}
}
$html.='
<noscript>
<input type="submit" class="btn button" name="characteristic" value="'.JText::_('REFRESH_INFORMATION').'"/>
</noscript>';
return $html;
}
I have followed another topic wich said: create this function, paste the core code in the function and replace $this with $obj. Could you tell the problem with this code?
Thanks in advance!