Post by imadam » Tue Jan 19, 2010 8:21 am

i'm trying to show the manufacturer image rather then their name on the product page. i'm trying to edit the files and i'm so so close but last bit is beating me and i need help.

here is what i have (without what i think is not needed)

i added this to model/manufacuter.php page...

Code: Select all

	public function getManufacturerImg($manufacturer_name) {
		$query = $this->db->query("SELECT image FROM " . DB_PREFIX . "manufacturer WHERE name = '" . $manufacturer_name . "'");
	
		return $query->row;	
}	

then on controller/product.php page added this...

Code: Select all

		$this->load->model('catalog/manufacturer');	
		
		$manu = $this->model_catalog_manufacturer->getManufacturerImg($product_info['manufacturer']);
		
		print_r($manu);
		
		$this->data['manu'] = array(); 
		
		foreach ($manu as $manus) {
				$this->data['manu'][] = array(
				'image' => $manus['image']
);
			}

print_r($manu);

print_r($manu); shows the exact string i want, which is the location of the image, great, but on the template page i want it i'm stuck and it doesn't work.

on view/product.tpl page i have the 3 following lines to try see if either will make a difference

Code: Select all

				<?php print_r($manu); ?>
				<?php echo $manu; ?>
                                <?php echo $manu['image']; ?>
print_r shows: Array ( [0] => Array ( [image] => d ) )
echo $manu shows the word Array,
echo $manu['image'] shows error message saying undefined call to...

where am i going wrong? sure it must be so simple and i just have one/two things slightly incorrect.

many thanks

my opencart carpet cleaning woking guildford and Office Cleaning Services in Guildford


Active Member

Posts

Joined
Sun Jan 10, 2010 10:47 pm
Location - Surrey
Who is online

Users browsing this forum: No registered users and 4 guests