Community Forums

[1.5]remove counter next to product in category menu

General support for technical problems with OpenCart v1.x

[1.5]remove counter next to product in category menu

Postby tarik » Sat Jun 18, 2011 3:19 pm

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.
Last edited by i2Paq on Sat Jun 18, 2011 5:17 pm, edited 1 time in total.
Reason: Use [version] TAG in subject!
tarik
 
Posts: 16
Joined: Tue Nov 09, 2010 12:47 pm

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

Postby ifyouseek » Thu Jun 23, 2011 4:21 am

did you find out how to do this? i would like to remove the counter too!
ifyouseek
 
Posts: 158
Joined: Thu May 06, 2010 8:40 am

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

Postby harryo40 » Thu Jun 23, 2011 12:38 pm

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'] ;)
Last edited by harryo40 on Sun Jul 31, 2011 10:29 am, edited 1 time in total.
Add To Cart Confirm Ajax Popup for OC 1.5.1.3 --> 1.5.5.1 - Add to Cart Confirmation Popup
Image Map Banner Module - Image Map Banner Module
----------------------------------------------------------------------
Womens Famous Name Fashion Clothing at bargain prices - Next2nowt.com
harryo40
 
Posts: 204
Joined: Tue Oct 20, 2009 7:37 pm
Location: Blackburn, Lancashire

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

Postby hellogoodbye » Thu Jun 23, 2011 11:20 pm

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
hellogoodbye
 
Posts: 50
Joined: Tue May 03, 2011 10:33 pm

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

Postby Degsey » Sun Jun 26, 2011 1:57 am

If yoy want to do a search this issue has been covered in full in another thread.
Live Long and Prosper!

Degsey :-]

Visit us at :

http://www.Supreme-Ink.com
User avatar
Degsey
 
Posts: 91
Joined: Sat Jun 11, 2011 6:29 pm
Location: North Carolina

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

Postby bob71 » Sun Jul 31, 2011 8:17 pm

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?
bob71
 
Posts: 17
Joined: Sun Jul 31, 2011 6:15 am

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

Postby spitos » Tue Aug 02, 2011 8:01 am

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.php?f=131&t=39194
Last edited by spitos on Mon Mar 12, 2012 9:07 am, edited 1 time in total.
Image Get it here
Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!

Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
User avatar
spitos
 
Posts: 258
Joined: Mon May 23, 2011 10:19 am
Location: UK

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

Postby freetester » Sun Mar 11, 2012 8:16 pm

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
freetester
 
Posts: 1
Joined: Sat Mar 10, 2012 7:43 pm

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

Postby undersound » Tue Mar 13, 2012 7:49 pm

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.
undersound
 
Posts: 7
Joined: Wed Jan 11, 2012 9:04 am

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

Postby yesweus » Wed Mar 21, 2012 3:07 pm

Thanks
yesweus
 
Posts: 2
Joined: Wed Feb 29, 2012 1:23 pm

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

Postby aquilla » Sat Sep 29, 2012 4:01 am

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)
aquilla
 
Posts: 5
Joined: Thu Apr 26, 2012 7:31 am


Return to General Support

Who is online

Users browsing this forum: k17, merry, midgette, scanreg, WilliamBD and 86 guests

Hosted by Arvixe Web Hosting