I try to display the image of each brand on my manufacturer list in the admin page.
Unfortunately there seems to be no existing extension available for opencart 2.0.1.1 (for opencart 1.5.6 there were several extensions available)
So I try to modify the core files. I have done the necessary modifications in the catalog\manufacturer_list.tpl. An extra column is displayed for the image, but in stead of the image itself, only the title-tag text is shown.
I have the impression that the code $manufacturer['image'] is not defined correctly. See my code below:
Code: Select all
<table class="table table-bordered table-hover">
<thead>
<tr>
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
<!-- Loc -->
<td class="text-left"><?php echo $column_image; ?></td>
<!-- Einde Loc -->
<td class="text-left"><?php if ($sort == 'name') { ?>
<a href="<?php echo $sort_name; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_name; ?></a>
<?php } else { ?>
<a href="<?php echo $sort_name; ?>"><?php echo $column_name; ?></a>
<?php } ?></td>
<td class="text-right"><?php if ($sort == 'sort_order') { ?>
<a href="<?php echo $sort_sort_order; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_sort_order; ?></a>
<?php } else { ?>
<a href="<?php echo $sort_sort_order; ?>"><?php echo $column_sort_order; ?></a>
<?php } ?></td>
<td class="text-right"><?php echo $column_action; ?></td>
</tr>
</thead>
<tbody>
<?php if ($manufacturers) { ?>
<?php foreach ($manufacturers as $manufacturer) { ?>
<tr>
<td class="text-center"><?php if (in_array($manufacturer['manufacturer_id'], $selected)) { ?>
<input type="checkbox" name="selected[]" value="<?php echo $manufacturer['manufacturer_id']; ?>" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="selected[]" value="<?php echo $manufacturer['manufacturer_id']; ?>" />
<?php } ?></td>
<!-- Loc -->
<td class="text-left"><img src="<?php echo $manufacturer['image']; ?>" alt="<?php echo $manufacturer['name']; ?>" title="<?php echo $manufacturer['name']; ?>" /></td>
<!-- Einde Loc -->
<td class="text-left"><?php echo $manufacturer['name']; ?></td>
<td class="text-right"><?php echo $manufacturer['sort_order']; ?></td>
<td class="text-right"><a href="<?php echo $manufacturer['edit']; ?>" data-toggle="tooltip" title="<?php echo $button_edit; ?>" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
</tr>
<?php } ?>
<?php } else { ?>
<tr>
<td class="text-center" colspan="4"><?php echo $text_no_results; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
Thanks
SabKo