Post by SubatWest » Mon Sep 24, 2018 4:12 pm

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.

Attachments

2018-09-24 09_07_36-Authors.png

2018-09-24 09_07_36-Authors.png (17.01 KiB) Viewed 978 times


Active Member

Posts

Joined
Fri Oct 31, 2014 1:29 am

Post by paulfeakins » Mon Sep 24, 2018 7:19 pm

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 %}

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by storiqax » Mon Sep 24, 2018 7:44 pm

Well, inspired by you :)
Take a look here: Tutorial - Add Manufacturer image to Admin Panel
viewtopic.php?f=202&t=207184

User avatar
New member

Posts

Joined
Tue May 29, 2018 10:19 pm

Post by SubatWest » 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

Active Member

Posts

Joined
Fri Oct 31, 2014 1:29 am

Post by storiqax » Tue Sep 25, 2018 12:13 am

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 :)

User avatar
New member

Posts

Joined
Tue May 29, 2018 10:19 pm
Who is online

Users browsing this forum: Semrush [Bot] and 520 guests