Post by snoopster » Tue Aug 20, 2013 10:21 pm

Hello everybody.

As the title implies, I am trying to add the manufacturer name+logo to each of the products in the featured area.
I managed to find some code but it's not exactly working properly, as it shows me the right manufacturer name, but the image and link is of a single manufacturer to all of the products.

Here is the code from featured.php controller:

Code: Select all

$this->load->model('catalog/manufacturer');

		if (isset($this->request->get['manufacturer_id'])) {
			$this->data['breadcrumbs'][] = array(
				'text'      => $this->language->get('text_brand'),
				'href'      => $this->url->link('product/manufacturer'),
				'separator' => $this->language->get('text_separator')
			);

			$manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']);

			if ($manufacturer_info) {
				$this->data['breadcrumbs'][] = array(
					'text'	    => $manufacturer_info['name'],
					'href'	    => $this->url->link('product/manufacturer/product', 'manufacturer_id=' . $this->request->get['manufacturer_id']),
					'separator' => $this->language->get('text_separator')
				);
			}
		}



				 $manufacturer_image = $this->model_catalog_manufacturer->getManufacturer($product_info['manufacturer_id']);

         if($manufacturer_image){
            $this->data['manufacturers_img'] = $this->model_tool_image->resize($manufacturer_image['image'], 100, 100);
         }else{
            $this->data['manufacturers_img'] = false;
         }

And here is the code from featured.tpl:

Code: Select all

<a href="<?php echo $manufacturers; ?>"><?php echo ($manufacturers_img) ? '<img width="40"height="40" style="display: block;margin: 0px auto;" src="'.$manufacturers_img.'" title="'.$product["name"].' was designed by '.$product["manufacturer"].'" />' : $manufacturers ;?><br /><span style="display: block;font-family: Lato;font-size: 11px;font-weight: bold;line-height: 15px;text-align: center;text-transform: uppercase;"><?php echo $product['manufacturer']; ?></span></a>

Can someone please guide me as to make this work properly?
Thank you!

P.S.: Opencart version - 1.5.3.1

New member

Posts

Joined
Mon Nov 28, 2011 7:06 am

Post by snoopster » Thu Aug 22, 2013 11:49 pm

Anyone?

New member

Posts

Joined
Mon Nov 28, 2011 7:06 am

Post by snoopster » Fri Aug 30, 2013 4:47 am

Still haven't managed to fix this... Can anybody assist?

New member

Posts

Joined
Mon Nov 28, 2011 7:06 am

Post by snoopster » Fri Sep 13, 2013 10:14 pm

Someone?

New member

Posts

Joined
Mon Nov 28, 2011 7:06 am
Who is online

Users browsing this forum: No registered users and 55 guests