Page 1 of 1

Manufacturer's image in admin list

Posted: Mon Sep 24, 2018 4:12 pm
by SubatWest
Hi
I am building a book specific site on localhost with Opencart 3.0.2.0 and will have a 'manufacturer's' list which is a list of authors.of around 500. Everything is fine with the language files all changed appropriately, but I want to be able to quickly see if there is an author's image with each entry. I therefore want to place the manufacturer's logo on the Manufacturer's list, just before the name.
I have looked at the 'manufacturer list twig file in admin\view\template\catalog\' and have changed it thus;

<tbody>
{% if manufacturers %}
{% for manufacturer in manufacturers %}
<tr>
<td class="text-center">{% if manufacturer.manufacturer_id in selected %}
<input type="checkbox" name="selected[]" value="{{ manufacturer.manufacturer_id }}" checked="checked" />
{% else %}
<input type="checkbox" name="selected[]" value="{{ manufacturer.manufacturer_id }}" />
{% endif %}</td>
<td class="text-left"> <a href="" id="manufacturer-image" data-toggle="image" class="img-thumbnail"><img src="{{ manufacturer.image}}" alt="" /></a></td>
<td class="text-left">{{ manufacturer.name }}</td>
<td class="text-right">{{ manufacturer.sort_order }}</td>
<td class="text-right"><a href="{{ manufacturer.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
</tr>
{% endfor %}
{% else %}
<tr>
<td class="text-center" colspan="4">{{ text_no_results }}</td>
</tr>
{% endif %}
</tbody>

The placeholder has a link to load an image file but it is not retained when list closed. Can anybody help to show me what I need to do to get the manufacturer image to automatically appear from the database and to remain.
Grateful for any help.

Re: Manufacturer's image in admin list

Posted: Mon Sep 24, 2018 7:19 pm
by paulfeakins
What about something like this?

Code: Select all

{% if manufacturer_logo and manufacturer_url and manufacturer_name %}
<a href="{{ manufacturer_url }}"><img src="{{ manufacturer_logo }}" alt="{{ manufacturer_name }}" title="{{ manufacturer_name }}"></a>
{% endif %}

Re: Manufacturer's image in admin list

Posted: Mon Sep 24, 2018 7:44 pm
by storiqax
Well, inspired by you :)
Take a look here: Tutorial - Add Manufacturer image to Admin Panel
viewtopic.php?f=202&t=207184

Re: Manufacturer's image in admin list

Posted: Mon Sep 24, 2018 11:44 pm
by SubatWest
Thanks Guys,

The first suggestion did not produce any result but the second worked perfectly.
Thank you for your help. I had searched the forum for a solution and dd not come across that post. So thank you for pointing it out.
Really appreciated.
Subbie

Re: Manufacturer's image in admin list

Posted: Tue Sep 25, 2018 12:13 am
by storiqax
SubatWest wrote:
Mon Sep 24, 2018 11:44 pm
Thanks Guys,

The first suggestion did not produce any result but the second worked perfectly.
Thank you for your help. I had searched the forum for a solution and dd not come across that post. So thank you for pointing it out.
Really appreciated.
Subbie
You are welcome :)