Post by nabibaig » Wed Jan 27, 2016 1:36 pm

I am using opencart 2.1.0.1 i want to add the product count in each manufacturer in manufacturer page, i see there is option in admin to do the same for categories but for manufacturer its not avalible, please help me with the code where i have to do the changes, i tried it but the results are not showing up.

i want it to show like this. Apple (50), Adidas (20)

Opencart default shows like this - Apple, Adidas but no product count in that.

please help me getting this work.

Thanks

Newbie

Posts

Joined
Wed Jan 13, 2016 11:04 pm

Post by viethemes » Thu Jan 28, 2016 12:14 am

To do that you can follow below steps
1. Open file catalog\controller\product\manufacturer.php
2. Find

Code: Select all

$this->load->model('catalog/manufacturer');
and add below code after that line

Code: Select all

$this->load->model('catalog/product');
3. Find

Code: Select all

'name' => $result['name'],
and replace with

Code: Select all

'name' => $result['name'] . ' (' . $this->model_catalog_product->getTotalProducts(array('filter_manufacturer_id' => $result['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 nabibaig » Sun Jan 31, 2016 4:15 pm

thanks a lot it works fine.

Newbie

Posts

Joined
Wed Jan 13, 2016 11:04 pm

Post by viethemes » Mon Feb 01, 2016 11:13 pm

Glad to hear that the problem is fixed :)

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 Knighty » Sun Sep 25, 2016 11:55 am

viethemes wrote:Glad to hear that the problem is fixed :)
Thanks for posting this. However, it doesn't work for 2.0.3.1. Any ideas? - Also, how can i show manufactures that contain only products and hide the ones without products.

We have thousands of manufacturers but only a couple of hundred with products.

Newbie

Posts

Joined
Sun Sep 25, 2016 11:53 am

Post by jfn99 » Thu Sep 27, 2018 12:01 am

I'm looking for way to make manufacturer list on admin of OC 3 to display product count per manufacturer...
Either in a new column or after the name like: ManufacturerA (45)
Any help much appreciated.

New member

Posts

Joined
Thu Feb 25, 2010 5:14 pm
Who is online

Users browsing this forum: No registered users and 2 guests