-- HikaShop version -- : Essential 2.3.0
-- Joomla version -- : 3.3
Hi,
Is there a way I can display custom field into category view. I have pasted this code from views/product/tmpl/show.php to listing_image_title.php
<table width="100%">
<?php
$this->fieldsClass->prefix = '';
foreach ($this->fields as $fieldName => $oneExtraField) {
if(empty($variant->$fieldName) && !empty($this->element->main->$fieldName)){
$variant->$fieldName = $this->element->main->$fieldName;
}
if(!empty($variant->$fieldName)) $variant->$fieldName = trim($variant->$fieldName);
if (!empty ($variant->$fieldName)) {
?>
<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;?>_<?php echo $variant_name;?>" 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;?>_<?php echo $variant_name;?>" class="hikashop_product_custom_value">
<?php echo $this->fieldsClass->show($oneExtraField,$variant->$fieldName); ?>
</span>
</td>
</tr>
<?php
}
}
?>
</table>
Leads me to error:
Notice: Undefined property: ProductViewProduct::$fields in C:\xampp\htdocs\...\components\com_hikashop\views\product\tmpl\listing_img_title.php on line 90Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\...\components\com_hikashop\views\product\tmpl\listing_img_title.php on line 90
Please help.
Thanks