We print the manufacturer’s logo in Opencart card
Web Studio - site development of any direction. | web-ukraine.com
πŸ’Ό Creation of modern websites of any complexity. | πŸ‘Œ WEB-UKRAINE.COM

We print the manufacturer’s logo in Opencart card

5/54 ratings

Good day dear visitors of our site, we all know that in opencart manufacturers are displayed on a separate page, but often the owners of online stores would display manufacturer goods directly to the card, well, what if you have to mean going to do, and so in this article we Screw photos of our products is in the product card with the ability to enable and disable from admin panel, as well as with the ability to change the size of the image maker, and so proceed.

1. First, let us create the desired field in the admin panel.
The changes will make in the following files:

1. File β€œadmin/language/russian/setting/setting.php”. In any place in the file ( between) is inserted:

All language variables we added, we now need to move these variables in the template visibility well and accordingly create/receive and process settings.
2. File β€œadmin/controller/setting/setting.php”. The function index() (~30 line) after the code:

We will add:

We all ended up with the linguistic variables. Next, after the code (~330 line):

We need to add:

3. File β€œadmin/view/template/setting/setting.tpl”. All settings were received and processed, and we now have the template variables are available:

All the settings we will be creating in the "Images" tab. We are looking for the code (~684 line):

And before

insert:

Now we need to go to settings and enter the values as settings they are empty by default. Example settings in the admin panel should look like this:

In this work with the administrative panel is finished.

2. The second step, we will display our logo the manufacturer directly on the item card.
In some files, we will make changes:

1. File β€œcatalog/model/catalog/product.php”. By default, the product page already has variables that contain the name and a link to the manufacturer. Now we need to add the path to the image. The function getProduct($product_id) (~7 line) to request the code:
After β€œmanufacturer,” we will add a new column β€œm.image AS mimage,”, to get this:
Now, the database will return a path to picture producer. Now, to transfer the picture controller to the processing necessary in this same function following:
add:
Now our variable $mimage will be available in the controller, where it is already processed.
2. File β€œcatalog/controller/product/product.php”. The function index() we find the code (~199 line):
thereafter adding:
That's the method of our image has been received and processed, it now remains to us to take it on the item card.
3. File β€œcatalog/view/theme/template name/template/product/product.tpl”. We now have available a variable $mimage, it is the path to the photo products (120 Γ— 50). Also still available is already variable $manufacturers, which is a link to the page producer in the store and the variable $config_show_manufacturer_image.
Now we move to the addition of the image links. After the code (~24 lines):
add:
That's it, a few minutes of your time and patience, and we now have a picture in the card manufacturer's product.
Thank you for your attention, if you have questions to ask in the comments.

You may also like

No Comment

You can post first response comment.

Leave a Reply

Π’ΠΈΠ±Π΅Ρ€Ρ–Ρ‚ΡŒ спосіб спілкування
Звязатися Π· Π½Π°ΠΌΠΈ!
Ми Π³ΠΎΡ‚ΠΎΠ²Ρ– Π΄ΠΎ Π΄Ρ–Π°Π»ΠΎΠ³Ρƒ.