Page 1 of 1

How to add Product Count to Manufacturing page

Posted: Wed Jan 27, 2016 1:36 pm
by nabibaig
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

Re: How to add Product Count to Manufacturing page

Posted: Thu Jan 28, 2016 12:14 am
by viethemes
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'])) . ')',

Re: How to add Product Count to Manufacturing page

Posted: Sun Jan 31, 2016 4:15 pm
by nabibaig
thanks a lot it works fine.

Re: How to add Product Count to Manufacturing page

Posted: Mon Feb 01, 2016 11:13 pm
by viethemes
Glad to hear that the problem is fixed :)

Re: How to add Product Count to Manufacturing page

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

Re: How to add Product Count to Manufacturing page

Posted: Thu Sep 27, 2018 12:01 am
by jfn99
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.