Page 1 of 1

Show all manufacturers under category

Posted: Thu Aug 27, 2015 5:14 pm
by fokz8
Hello. I'm creating a webstore which offers products from multiple brands. Now users can see products from differents categories (etc. laptops, multimedia)...but i would also like to make a category, which would display all the brands. Which means that when user would click on (etc. HP), the page would display all HP products.

Any idea how to do that?

Thank you very much. I appreciate your help!

Re: Show all manufacturers under category

Posted: Thu Aug 27, 2015 9:21 pm
by viethemes
To do that you can open file catalog/controller/common/header.php
find

Code: Select all

$data['language'] = $this->load->controller('common/language');
and add below code before that line

Code: Select all

$this->load->model('catalog/manufacturer');
$manufacturers = $this->model_catalog_manufacturer->getManufacturers();

foreach ($manufacturers as $manufacturer) {
	$data['categories'][] = array(
		'name' => $manufacturer['name'],
		'children' => array(),
		'column' => 1,
		'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id'])
	);
}

Re: Show all manufacturers under category

Posted: Fri Aug 28, 2015 3:51 pm
by fokz8
viethemes wrote:To do that you can open file catalog/controller/common/header.php
find

Code: Select all

$data['language'] = $this->load->controller('common/language');
and add below code before that line

Code: Select all

$this->load->model('catalog/manufacturer');
$manufacturers = $this->model_catalog_manufacturer->getManufacturers();

foreach ($manufacturers as $manufacturer) {
	$data['categories'][] = array(
		'name' => $manufacturer['name'],
		'children' => array(),
		'column' => 1,
		'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id'])
	);
}
could you please visit : proprehrana.eu and see what happens with that code. You must have missunderstood the question. I want them brands to appear on dropdown if users clicks on collumn "znamke" on the right.

Thanks for your input!

Re: Show all manufacturers under category

Posted: Fri Aug 28, 2015 6:38 pm
by fokz8
anyone?

Re: Show all manufacturers under category

Posted: Sat Aug 29, 2015 1:04 am
by viethemes
I understood your idea. Could you send me a admin account and a FTP account via PM, so I can try to make it?