Page 1 of 1

[1.5]remove counter next to product in category menu

Posted: Sat Jun 18, 2011 11:19 pm
by tarik
Hi guys im struggling to find out the correct way to describe this so i can really find anything relating to what im searching.
I basically just want to remove the little number that is next to the category in the menu bar so for example if there is one product in the category then it has (1) next to it.
I cant seem to find any settings in the control panel for it but then again i might just be blind.
Im using 1.5 btw.
thanks for any help in advance.

Re: [1.5]remove counter next to product in category menu

Posted: Thu Jun 23, 2011 12:21 pm
by ifyouseek
did you find out how to do this? i would like to remove the counter too!

Re: [1.5]remove counter next to product in category menu

Posted: Thu Jun 23, 2011 8:38 pm
by harryo40
tarik wrote:I basically just want to remove the little number that is next to the category in the menu bar so for example if there is one product in the category then it has (1) next to it.
I cant seem to find any settings in the control panel for it but then again i might just be blind.
Im using 1.5 btw.
thanks for any help in advance.
If I am right, you just want your customers to see the categories in the dropdown menu without the quantities in brackets i.e. (2) ?
You can do this by altering one line of code in the catalog/controller/header.php file.
Find the following line of code (around line 200) . . .

Code: Select all

						'name'  => $child['name'] . ' (' . $product_total . ')',
& change it to this . . .

Code: Select all

						'name'  => $child['name'],// . ' (' . $product_total . ')',
This will still show your categories but without the qty (2)
To change it back, simply delete these 3 characters . . .

Code: Select all

,//
that show after ['name'] ;)

Re: [1.5]remove counter next to product in category menu

Posted: Fri Jun 24, 2011 7:20 am
by hellogoodbye
Thanks for the tip! and if you want to edit the one in the category module, the file is in catalog/controller/module/category.php

Re: [1.5]remove counter next to product in category menu

Posted: Sun Jun 26, 2011 9:57 am
by Degsey
If yoy want to do a search this issue has been covered in full in another thread.

Re: [1.5]remove counter next to product in category menu

Posted: Mon Aug 01, 2011 4:17 am
by bob71
I have been searching and not able to find anything which works

above example does not work for me

On main page when we see category with total products I want to remove those qty with bracket
any solution?

Re: [1.5]remove counter next to product in category menu

Posted: Tue Aug 02, 2011 4:01 pm
by spitos
Undo the previous changes and upload this vqmod i made to get rid of the product count in all areas.

!!!!!UPDATE!!!!!
I've updated this file to reduce load times and some other minor improvements.
Please see this thread for the latest version:
http://www.opencart.com/forum/viewtopic ... 31&t=39194

Re: [1.5]remove counter next to product in category menu

Posted: Mon Mar 12, 2012 4:16 am
by freetester
remove counter next to product in category menu

The solution of "harryo40" above guides to the right direction but you have to fulfill changes on other three points, in other two scripts!!!

The whole solution:

First change:

Open category.php with your preferred editor on => catalog/controller/module/category.php

Go to the line 48: 'name' => $child['name'] . ' (' . $product_total . ')'
Change it to: 'name' => $child['name'],// . ' (' . $product_total . ')'

Go to line 62: 'name' => $category['name'] . ' (' . $product_total . ')',
Change it to: 'name' => $category['name'],// . ' (' . $product_total . ')',



Second change:

Open category.php on => catalog/controller/product/category.php

Go to line 137: 'name' => $result['name'] . ' (' . $product_total . ')'
Change it to: 'name' => $result['name'],// . ' (' . $product_total . ')'


Third change:

Open category.php on => catalog/controller/common/header.php

Go to line: 'name' => $child['name'] . ' (' . $product_total . ')',
Change it to: 'name' => $child['name'],// . ' (' . $product_total . ')',

Thanks to "harryo40" for his IDEA


Hope it helps...

FREETESTER

Re: [1.5]remove counter next to product in category menu

Posted: Wed Mar 14, 2012 3:49 am
by undersound
I have created a vqmod for this but when searching for the string:

Code: Select all

'name' => $child['name'] . ' (' . $product_total . ')'
it returns no result

when I search for: (mind the extra space between 'name' and =>)

Code: Select all

'name'  => $child['name'] . ' (' . $product_total . ')'
I do get a hit.

Although I like the way of being able to make changes without touching core files this method seems very error prone to me especially with regard to spaces (like mentioned above).

I am using opencart 1.5.1.3.

Re: [1.5]remove counter next to product in category menu

Posted: Wed Mar 21, 2012 11:07 pm
by yesweus
Thanks

Re: [1.5]remove counter next to product in category menu

Posted: Sat Sep 29, 2012 12:01 pm
by aquilla
freetester wrote:remove counter next to product in category menu

The solution of "harryo40" above guides to the right direction but you have to fulfill changes on other three points, in other two scripts!!!

The whole solution:

First change:

Open category.php with your preferred editor on => catalog/controller/module/category.php

Go to the line 48: 'name' => $child['name'] . ' (' . $product_total . ')'
Change it to: 'name' => $child['name'],// . ' (' . $product_total . ')'

Go to line 62: 'name' => $category['name'] . ' (' . $product_total . ')',
Change it to: 'name' => $category['name'],// . ' (' . $product_total . ')',



Second change:

Open category.php on => catalog/controller/product/category.php

Go to line 137: 'name' => $result['name'] . ' (' . $product_total . ')'
Change it to: 'name' => $result['name'],// . ' (' . $product_total . ')'

Third change:

Open category.php on => catalog/controller/common/header.php

Go to line: 'name' => $child['name'] . ' (' . $product_total . ')',
Change it to: 'name' => $child['name'],// . ' (' . $product_total . ')',

Thanks to "harryo40" for his IDEA


Hope it helps...

FREETESTER
UPDATE vers. 1.5.3.1


First change:

Open category.php with your preferred editor on => catalog/controller/module/category.php

Go to the line 49: 'name' => $child['name'] . ' (' . $product_total . ')'
Change it to: 'name' => $child['name'],// . ' (' . $product_total . ')'

Go to line 71: 'name' => $category['name'] . ' (' . $product_total . ')',
Change it to: 'name' => $category['name'],// . ' (' . $product_total . ')',



Second change:

Open category.php on => catalog/controller/product/category.php

Go to line 137: 'name' => $result['name'] . ' (' . $product_total . ')',
Change it to: 'name' => $result['name'],// . ' (' . $product_total . ')',



Third change:

Open category.php on => catalog/controller/common/header.php

Go to line: 'name' => $child['name'] . ' (' . $product_total . ')';
Change it to: 'name' => $child['name'];// . ' (' . $product_total . ')';




This is what I have done and it works fine. 8)