How would I go about getting the manufacturer image to display on the product/manufacturer page above the products? I did a search and found where someone had explained how to get them to appear for the sidebox module but not for the actual page itself.
Version 1.4
Any help greatly appreciated.
If you are talking about the product list display, where, if you use the manufacturer's sort box to then display the list of products by that manufacturer, and have their image appear along with their name, then I am very interested in this as well.
Does anyone have an answer? This is the query I have and it's not working:
Any help would be greatly appreciated!!! <-- there's no "begging" smilie, so that's the best I can do. LOL
Jeri
If it makes a difference in whether or not anyone cares to tackle this, I am desperate and
$$$ WILLING TO PAY $$$
for the code. Cart version is 1.4
Does anyone have an answer? This is the query I have and it's not working:
Code: Select all
getManufacturerImage($manufacturer_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "manufacturer_image WHERE manufacturer_id = '" . (int)$manufacturer_id . "'");
return $query->row;
Any help would be greatly appreciated!!! <-- there's no "begging" smilie, so that's the best I can do. LOL
Jeri
If it makes a difference in whether or not anyone cares to tackle this, I am desperate and
$$$ WILLING TO PAY $$$
for the code. Cart version is 1.4
I didn't think there was a 'manufacturer_image' table? Correct me if I'm wrong, but I've just looked in my database schema and I see only a 'manufacturer' table, within it is an 'image' field.. so maybe this code might be better:signsintime wrote:If you are talking about the product list display, where, if you use the manufacturer's sort box to then display the list of products by that manufacturer, and have their image appear along with their name, then I am very interested in this as well.
Does anyone have an answer? This is the query I have and it's not working:Code: Select all
getManufacturerImage($manufacturer_id) { $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "manufacturer_image WHERE manufacturer_id = '" . (int)$manufacturer_id . "'"); return $query->row;
Code: Select all
getManufacturerImage($manufacturer_id){
$query = $this->db->query("SELECT `image` FROM `" . DB_PREFIX . "manufacturer` WHERE `manufacturer_id` = " . (int)$manufacturer_id);
return $query->row;
}
Currently unavailable for freelance work and consulting.
pstreet,
Given that your code is correct for the model file then all that should need doing would be to add to the template file to pull in the image, correct? Or does something need added to the controller file as well?
I've added your code to the model file and inserted <?php echo $manufacturer['image']; ?> as the image source in the tpl but the image still isn't being pulled in.
I want so badly to learn how to do these (what should be) simple edits but I'm pulling my hair out over this one.
Given that your code is correct for the model file then all that should need doing would be to add to the template file to pull in the image, correct? Or does something need added to the controller file as well?
I've added your code to the model file and inserted <?php echo $manufacturer['image']; ?> as the image source in the tpl but the image still isn't being pulled in.
I want so badly to learn how to do these (what should be) simple edits but I'm pulling my hair out over this one.
Thanks so much, pstreet, for your reply!
I'm about at the same place flightoffancy is, wanting to know how to do this stuff and having it drive me crazy.
I ran that query on the db from phpMyAdmin and it worked fine, giving me the manufacturer's image list.
Now, because I know so very little about this, which file does that query go in? The controller?
And then what, if anything, goes in the model? I have nothing in that file for the image, and I, too tried to use the echo image code in the tpl file but it doesn't show up and I know for certain an image exists and should show up.
I really want to learn this and am a very good student, willing to listen and follow instruction, but need it given to me at an elementary school level. :-)
TIA for your help
Jeri
I'm about at the same place flightoffancy is, wanting to know how to do this stuff and having it drive me crazy.
I ran that query on the db from phpMyAdmin and it worked fine, giving me the manufacturer's image list.
Now, because I know so very little about this, which file does that query go in? The controller?
And then what, if anything, goes in the model? I have nothing in that file for the image, and I, too tried to use the echo image code in the tpl file but it doesn't show up and I know for certain an image exists and should show up.
I really want to learn this and am a very good student, willing to listen and follow instruction, but need it given to me at an elementary school level. :-)
TIA for your help
Jeri
Sorry guys, I'm not writing a mod or anything for this, I was just providing a fix for the SQL query that was incorrect above.
To be honest after reviewing the model file in 'catalog/model/catalog/manufacturer.php' you don't even need to be creating a 'getManufacturerImage' function. The 'getManufacturer' call in that model file will already have made available the 'image' field containing the path to an image file (or an empty string if no image has been applied).
As an example, just to show how you can get an image onto the manufacturer page you can add the following code into your 'catalog/controller/product/manufacturer.php' file, beneath the code:Add this code:
Then in your 'catalog/view/theme/<your theme folder>/template/product/manufacturer.tpl' you can add:
This code is simply an example of how you can get the image into your template, I'll leave it up to you as an exercise to modify it how you like.
Please note this information applies only to v1.4.0 (it could apply to earlier versions, I haven't checked however).
To be honest after reviewing the model file in 'catalog/model/catalog/manufacturer.php' you don't even need to be creating a 'getManufacturerImage' function. The 'getManufacturer' call in that model file will already have made available the 'image' field containing the path to an image file (or an empty string if no image has been applied).
As an example, just to show how you can get an image onto the manufacturer page you can add the following code into your 'catalog/controller/product/manufacturer.php' file, beneath the code:
Code: Select all
$this->data['heading_title'] = $manufacturer_info['name'];
$this->data['text_sort'] = $this->language->get('text_sort');
Code: Select all
if(isset($manufacturer_info['image']) && $manufacturer_info['image'] != "") {
$manufacturer_image = $manufacturer_info['info'];
} else {
$manufacturer_image = 'no_image.jpg';
}
$this->data['manufacturer_image'] = image_resize($manufacturer_image, $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
Code: Select all
<img src="<?php echo $manufacturer_image; ?>"/>
Please note this information applies only to v1.4.0 (it could apply to earlier versions, I haven't checked however).
Currently unavailable for freelance work and consulting.
Didn't work for me with 1.4.9.1 ... Can someone write what I need to alter to add it to the manufacturers page?
Thanks!
Thanks!
Solution for version v1.5.2.1
You can show Manufacture image on the manufacturer page by adding 2 lines in 2 pages
1.
Open this file catalog/controller/product/manufacturer.php
go to line 50 and add this 'image' => $result['image'], after that you code will look like this
Now you have get the image from database now you have to show this image in manufacture tpl file
open this catalog/view/theme/yourthemname/template/product/manufacturer_list.tpl and add this code
where you want to show your image that's it
You can show Manufacture image on the manufacturer page by adding 2 lines in 2 pages
1.
Open this file catalog/controller/product/manufacturer.php
go to line 50 and add this 'image' => $result['image'], after that you code will look like this
Code: Select all
$this->data['categories'][$key]['manufacturer'][] = array(
'name' => $result['name'],
'image' => $result['image'],
'href' => $this->url->link('product/manufacturer/product', 'manufacturer_id=' . $result['manufacturer_id'])
);
open this catalog/view/theme/yourthemname/template/product/manufacturer_list.tpl and add this code
Code: Select all
<img src="<?php echo $category['manufacturer'][$i]['image']; ?>" />
Who is online
Users browsing this forum: No registered users and 78 guests