We print the manufacturer’s logo in Opencart card
Web Studio - site development of any direction. | WEB-STYDIA.COM
Creation, development, manufacturing sites | WEB-STYDIA.COM

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


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

Please enter your name. Please enter an valid email address. Please enter a message.