Page 1 of 2

SOLVED::Remove category count

Posted: Wed Jun 15, 2011 4:06 am
by mylasbags
Hi! I want to remove the category count from the category column. Is there a way to remove this in the admin or do I have to do something with the code?

Re: Remove category count

Posted: Fri Jun 17, 2011 11:01 am
by Degsey
You will have to alter the core code, this has been asked in another thread as well and we are waiting for for some helpfull replies.

Re: Remove category count

Posted: Fri Jun 17, 2011 11:33 am
by Degsey
Ok I have solved it.

See here on my development website http://www.laptopmadness.com

How to do it?

Edit this file /catalog/controller/module/catergory.php

Look for

Code: Select all

'name'        => $child['name'] . ' (' . $product_total . ')',
and replace with

Code: Select all

'name'        => $category['name'],
This is in 2 places and each must be replaced.

Re: Remove category count

Posted: Fri Jun 17, 2011 9:49 pm
by mylasbags
My file @ /catalog/controller/module/catergory.php only shows that line 1 time, should I edit another category.php file?

Re: Remove category count

Posted: Fri Jun 17, 2011 10:39 pm
by Degsey
That is the file and in V1.5xx it is repeated twice in the code.

This hack only takes out the side catergory count, I am working on the sub cats and the home page menu bar but time is very short at present.

Try just the one line that you see keep a copy of the old one and see what happens!

Re: Remove category count

Posted: Fri Jun 17, 2011 10:56 pm
by cmaster
mylasbags wrote:My file @ /catalog/controller/module/category.php only shows that line 1 time, should I edit another category.php file?
/catalog/controller/module/category.php

1.Search

Code: Select all

'name'        => $child['name'] . ' (' . $product_total . ')',
Replace with

Code: Select all

'name'        => $child['name'],
2.Search

Code: Select all

'name'        => $category['name'] . ' (' . $product_total . ')',
Replace with

Code: Select all

'name'        => $category['name'],

Re: Remove category count

Posted: Fri Jun 17, 2011 11:02 pm
by cmaster
Remove Sub category count:

/catalog/controller/product/category.php

Find

Code: Select all

'name'  => $result['name'] . ' (' . $product_total . ')',
Replace with

Code: Select all

'name'  => $result['name'],

Re: Remove category count

Posted: Sat Jun 18, 2011 12:09 am
by keether
degsey and cmaster = genious

Awesome thanks!

Re: Remove category count

Posted: Sun Jun 19, 2011 3:22 am
by budfox
Could I just ask something here:

I seem to remember that when playing with 1.4x it was possible to leave core files untouched and over-ride them with duplicated/modified files based on a new template.

I too want to remove category counts but I'd like to do it a 'nice' way.

If someone could advise I'd appreciate it.

Re: Remove category count

Posted: Sun Jun 19, 2011 6:19 am
by tarik
i have edited the two files and it doesnt appear to have done the trick on the top menu bar

Re: Remove category count

Posted: Sun Jun 19, 2011 6:19 pm
by AD.
For the top bar go to

Code: Select all

/catalog/controller/common/header.php
Look for:

Code: Select all

$product_total = $this->model_catalog_product->getTotalProducts($data);
									
$children_data[] = array(
	'name'  => $child['name'] . ' (' . $product_total . ')',
And Replace with:

Code: Select all

									
$children_data[] = array(
	'name'  => $child['name'],

Re: Remove category count

Posted: Sun Jun 19, 2011 11:24 pm
by Degsey
Thanks AD that just about raps up the whole thing!

Re: Remove category count

Posted: Mon Jun 20, 2011 12:30 am
by tarik
thank you all done ;D

Re: Remove category count

Posted: Sat Jun 25, 2011 7:49 pm
by budfox
Actually...what about where category counts appear in the page body under 'refine search'? Could someone point me to that module please.

Ta.

Re: Remove category count

Posted: Sun Jun 26, 2011 5:30 pm
by AD.
That was covered in the first post by cmaster, if you make sure to do both of those things it should work.

Re: Remove category count

Posted: Mon Jun 27, 2011 5:02 am
by budfox
Oops, sorry.

Re: Remove category count

Posted: Sat Jul 30, 2011 7:08 am
by imadam
i've done this and it works, but now the header drop down list is some reason not as wide as it should be. anyone know why this might change the size? it's no longer the length of the parent category width

Re: Remove category count

Posted: Thu Sep 08, 2011 11:02 pm
by Degsey
On an update there is a VQMod that does this for you and does not need any code alteration, even if you have partly taken out the code it will take out all product counts, even in subcats.

Re: SOLVED::Remove category count

Posted: Sat Sep 10, 2011 6:42 am
by Landho
Where is the VQMod?

Re: SOLVED::Remove category count

Posted: Sat Sep 10, 2011 9:38 am
by rph