Post by jomeza001 » Sat Aug 27, 2011 4:38 pm

In my case don;t really help much having that category counters. Is there any way to disable them??

User avatar
Active Member

Posts

Joined
Tue May 17, 2011 10:55 am

Post by silencox » Sun Aug 28, 2011 3:56 am

You need to edit controller for category module

open catalog/controller/module/category.php in editor ( notepad++ or similar )

then find this (around line 48)

Code: Select all

    $children_data[] = array(
        'category_id' => $child['category_id'],
        'name'        => $child['name'] . ' (' . $product_total . ')',
        'href'        => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) 
    );                                      
and replace like this

Code: Select all

    $children_data[] = array(
        'category_id' => $child['category_id'],
        'name'        => $child['name'] ,
        'href'        => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) 
    );                                      

If you need to remove same thing in header menu

you need to edit header.php in catalog/controller/common

so open catalog/controller/common/header.php file

and find

Code: Select all

     $children_data[] = array(
          'name'  => $child['name'] . ' (' . $product_total . ')',
          'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])       
     );                                      
and replace with this

Code: Select all

     $children_data[] = array(
          'name'  => $child['name'] ,
          'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])       
     );                                      
And that is all

Newbie

Posts

Joined
Thu Sep 16, 2010 4:10 pm

Post by jomeza001 » Sun Aug 28, 2011 10:35 am

Tnx. Will try it.

User avatar
Active Member

Posts

Joined
Tue May 17, 2011 10:55 am

Post by jomeza001 » Tue Aug 30, 2011 10:15 am

Ok. Tried both of the above codes and it eliminate the Counts for Child Categories Only. The Header menu counts did eliminate as well.

So Category counts are still present in Parent Categories in Side Menu and also, Under "Refine your Search".

How to eliminate those as well?

Thanks in advance.

User avatar
Active Member

Posts

Joined
Tue May 17, 2011 10:55 am

Post by silencox » Tue Aug 30, 2011 3:25 pm

Well i forgot for parent :) but here is

in catalog/controller/module/category.php

find this ( around line 60 )

Code: Select all

    $this->data['categories'][] = array(
         'category_id' => $category['category_id'],
         'name'        => $category['name'] . ' (' . $product_total . ')',
         'children'    => $children_data,
         'href'        => $this->url->link('product/category', 'path=' . $category['category_id'])
   );
And replace with this

Code: Select all

    $this->data['categories'][] = array(
         'category_id' => $category['category_id'],
         'name'        => $category['name'],
         'children'    => $children_data,
         'href'        => $this->url->link('product/category', 'path=' . $category['category_id'])
   );
regarding Refine Your Search please specify url ( index.php?route=XXXXX/YYYYY )

specify me XXXXX and YYYYYY

and what version you use

regards




jomeza001 wrote:Ok. Tried both of the above codes and it eliminate the Counts for Child Categories Only. The Header menu counts did eliminate as well.

So Category counts are still present in Parent Categories in Side Menu and also, Under "Refine your Search".

How to eliminate those as well?

Thanks in advance.

Newbie

Posts

Joined
Thu Sep 16, 2010 4:10 pm

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by Xsecrets » Tue Aug 30, 2011 9:22 pm

also note that if you are going to remove the category counts you should probably go ahead and remove or comment out the $product_total line because it is one of the slowest parts of the entire cart. No need to let it continue to run if you are not going to display it.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by jomeza001 » Wed Aug 31, 2011 1:55 am

Cool. I just installed the vQmod file and it works. Thanks again.

edit: Spoke too soon. This mod does not really disable the Left menu Categories Counters as of right now :(
Last edited by jomeza001 on Wed Aug 31, 2011 6:25 am, edited 2 times in total.

User avatar
Active Member

Posts

Joined
Tue May 17, 2011 10:55 am

Post by jomeza001 » Wed Aug 31, 2011 6:23 am

silencox wrote: regarding Refine Your Search please specify url ( index.php?route=XXXXX/YYYYY )

specify me XXXXX and YYYYYY

and what version you use

regards
This is what i mean for "Refine Search" counters:
Image

User avatar
Active Member

Posts

Joined
Tue May 17, 2011 10:55 am

Post by will345 » Sun Sep 04, 2011 4:30 am

I would like to know how to remove the counters in the refined search too. Running version 1.5.1. Any suggestions would be appreciated.

New member

Posts

Joined
Mon Aug 22, 2011 2:53 pm

Post by silencox » Sun Sep 04, 2011 5:10 am

Hello

Go to catalog/controller/product/ and edit category.php file

find this ( its around line 136)

Code: Select all

$this->data['categories'][] = array(
    'name'  => $result['name'] . ' (' . $product_total . ')',
    'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
and change to this

Code: Select all

$this->data['categories'][] = array(
    'name'  => $result['name'] ,
    'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);

that will remove product count from refine

if you need help let me know

regards

will345 wrote:I would like to know how to remove the counters in the refined search too. Running version 1.5.1. Any suggestions would be appreciated.

Newbie

Posts

Joined
Thu Sep 16, 2010 4:10 pm

Post by will345 » Sun Sep 04, 2011 5:21 am

Hey thanks! It works perfect. I didn't know what file that code was on to edit. I knew it was similar to above, but didn't know where to look. Thanks again, i appreciate it.

New member

Posts

Joined
Mon Aug 22, 2011 2:53 pm
Who is online

Users browsing this forum: No registered users and 17 guests