Post by fokz8 » Thu Aug 27, 2015 5:14 pm

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!

New member

Posts

Joined
Sun Jul 26, 2015 8:35 pm

Post by viethemes » Thu Aug 27, 2015 9:21 pm

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'])
	);
}

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by fokz8 » Fri Aug 28, 2015 3:51 pm

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!

New member

Posts

Joined
Sun Jul 26, 2015 8:35 pm

Post by fokz8 » Fri Aug 28, 2015 6:38 pm

anyone?

New member

Posts

Joined
Sun Jul 26, 2015 8:35 pm

Post by viethemes » Sat Aug 29, 2015 1:04 am

I understood your idea. Could you send me a admin account and a FTP account via PM, so I can try to make it?

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm

Who is online

Users browsing this forum: No registered users and 4 guests