actually as far as product counts it does, however no it does not show them in either the header list or the category module. In 1.5 the category list is not fully recursive it is only two levels deep, but that is a completely separate issue from the product counts.DirkZz wrote:The product count is ok, but the menu doesn't add an extra sub item.
I didn't understand you at first, thanks for pointing me to this problem, ill see if I can think of something otherwise, too bad
EDIT:
Oc doesnt see the level-3 category as a subcategory of the level-2. Thats the problem.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
good luck I banged on it for about a week and couldn't figure out a way to do it with group by.DirkZz wrote:Currenctly working on it .. ill show you what i ment.. almost done.. prob after the weekend.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
In 1 query is really almost impossible.Xsecrets wrote:yeah I'm 99.999% sure it cannot be done with group by alone. You will have to have some sort of looping or something. I just don't believe it's possible to get it in one query.
I will let PHP figure that out

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
This has made the script massively more useful for large carts - thank you for your efforts! Hopefully this will be in the core next time an update is made! (Or a better fix)Xsecrets wrote:Ok I've changed the way I approached it all. Here's a new vqmod. It basically does the same thing as the default install, but it rolls it all into the category model function and enables caching, so if someone wants to give this one a try I would love to hear if it helps. This one should not mess with the display at all.
looks like someone took my code from above and released it as a paid module. Well I don't know if they just copied the code or not, but I know the solution I have above for free does the same thing.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
This works fine on v 1.5.05 but I tried it on v1.5.1 and it doesn't work. Whats the difference from last version so I can apply it ? ThanksXsecrets wrote:ok well you or someone has obviously already modified your category module to remove the category counts.m3scott wrote:Good call on the categories, Xsecrets.
Disabling categories on the homepage resulted in this....
Domain name Size Load Time Average Speed per KB
1 dev2.aspencreekoutdoors.com 10.9 KB 0.29 seconds 0.03 seconds
Similar results for product view...
Categories enabled
Domain name Size Load Time Average Speed per KB
1 dev2.aspencreekoutdoors.com/index.php?route=product/product&product_id=3795 83.18 KB 20.53 seconds 0.25 seconds
Categories disabled
Domain name Size Load Time Average Speed per KB
1 dev2.aspencreekoutdoors.com/index.php?route=product/product&product_id=3795 15.34 KB 1.85 seconds 0.12 seconds
edit catalog/controller/module/category.php and look for code something like this (you've probably already changed it a bit)Change it to look like thisCode: Select all
foreach ($categories as $category) { $children_data = array(); $children = $this->model_catalog_category->getCategories($category['category_id']); foreach ($children as $child) { $data = array( 'filter_category_id' => $child['category_id'], 'filter_sub_category' => true ); $product_total = $this->model_catalog_product->getTotalProducts($data); $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']) ); } $data = array( 'filter_category_id' => $category['category_id'], 'filter_sub_category' => true ); $product_total = $this->model_catalog_product->getTotalProducts($data); $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']) ); }
the total next to the name is probably already removed, but make sure that you comment out the product total lines and see if that makes a difference in speed with the category module turned on.Code: Select all
foreach ($categories as $category) { $children_data = array(); $children = $this->model_catalog_category->getCategories($category['category_id']); foreach ($children as $child) { $data = array( 'filter_category_id' => $child['category_id'], 'filter_sub_category' => true ); //$product_total = $this->model_catalog_product->getTotalProducts($data); $children_data[] = array( 'category_id' => $child['category_id'], 'name' => $child['name'], 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) ); } $data = array( 'filter_category_id' => $category['category_id'], 'filter_sub_category' => true ); //$product_total = $this->model_catalog_product->getTotalProducts($data); $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']) ); }
Hi dony_b,dony_b wrote:This works fine on v 1.5.05 but I tried it on v1.5.1 and it doesn't work. Whats the difference from last version so I can apply it ? Thanks
Did you find a solution to this problem? Would like to do the same thing with 1.5.1.
Now I am in business. Thanks!
I'm using 1.5.0.5
This worked for me on 1.5.1.3. I didnt use the mod, just edited my category.php file and my counts are gone.dony_b wrote:This works fine on v 1.5.05 but I tried it on v1.5.1 and it doesn't work. Whats the difference from last version so I can apply it ? ThanksXsecrets wrote:ok well you or someone has obviously already modified your category module to remove the category counts.m3scott wrote:Good call on the categories, Xsecrets.
Disabling categories on the homepage resulted in this....
Domain name Size Load Time Average Speed per KB
1 dev2.aspencreekoutdoors.com 10.9 KB 0.29 seconds 0.03 seconds
Similar results for product view...
Categories enabled
Domain name Size Load Time Average Speed per KB
1 dev2.aspencreekoutdoors.com/index.php?route=product/product&product_id=3795 83.18 KB 20.53 seconds 0.25 seconds
Categories disabled
Domain name Size Load Time Average Speed per KB
1 dev2.aspencreekoutdoors.com/index.php?route=product/product&product_id=3795 15.34 KB 1.85 seconds 0.12 seconds
edit catalog/controller/module/category.php and look for code something like this (you've probably already changed it a bit)Change it to look like thisCode: Select all
foreach ($categories as $category) { $children_data = array(); $children = $this->model_catalog_category->getCategories($category['category_id']); foreach ($children as $child) { $data = array( 'filter_category_id' => $child['category_id'], 'filter_sub_category' => true ); $product_total = $this->model_catalog_product->getTotalProducts($data); $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']) ); } $data = array( 'filter_category_id' => $category['category_id'], 'filter_sub_category' => true ); $product_total = $this->model_catalog_product->getTotalProducts($data); $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']) ); }
the total next to the name is probably already removed, but make sure that you comment out the product total lines and see if that makes a difference in speed with the category module turned on.Code: Select all
foreach ($categories as $category) { $children_data = array(); $children = $this->model_catalog_category->getCategories($category['category_id']); foreach ($children as $child) { $data = array( 'filter_category_id' => $child['category_id'], 'filter_sub_category' => true ); //$product_total = $this->model_catalog_product->getTotalProducts($data); $children_data[] = array( 'category_id' => $child['category_id'], 'name' => $child['name'], 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) ); } $data = array( 'filter_category_id' => $category['category_id'], 'filter_sub_category' => true ); //$product_total = $this->model_catalog_product->getTotalProducts($data); $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']) ); }
first time i only commented out the query and not the output ($product_total) and got errors. Once I edited out the output line it worked perfectly. It appears the vq mod does a few more updates but since my vqmod stuff dont work, i'll just stick with this.
Users browsing this forum: No registered users and 60 guests