Hi!Qphoria wrote:Try this:
Change:To:Code: Select all
$children = $this->getCategories($result['category_id'], $new_path);
Code: Select all
if (substr_count($new_path, '_') < 1) { $children = $this->getCategories($result['category_id'], $new_path); }
I applied this code to my web store and it's working great; I set < 2 so main category and subcategory are displayed.
But here is the problem... I have 2nd and 3rd level sub categories added to my categories as well and in case someone click in 1st level of subcategory second one (second level of subcategory) doesn't appear.
What I would like is to have displayed main category and first subcategory, but when someone click on this subcategory, subcategory of this subcategory should be displayed as well (in case there is sub-subcategory).
Can someone please help me on this?
We too are having this same issue. Boxerworks is using the latest incarnation of OpenCart - 1.4.9. I would have thought something like this would have been solved WAY before now as it appears to be an ongoing issue starting many versions back.
Is there a mod someone can recommend that would provide a bandaid for this issue? Please advise ASAP. Thank you.
Is there a mod someone can recommend that would provide a bandaid for this issue? Please advise ASAP. Thank you.
Hi Q,Qphoria wrote:all categories work with SEO for me.. even 4 levels deep
How do you do that?
As soon as i use a SEO keyword for a product, the breadcrumb and Category module links are lost as soon as you click that product.
I have set up an example with 2 products here:
http://bit.ly/cpuD61
One product with an SEO keyword, and one without. As you can see, if you click the left one, the subcat. closes and the subcat in the breadcrumb padth too.
Any idea why?
Thanks in advance!
I dont' see any SEO on your site.
My demo shows
Desktop as the parent category with seo "desktop"
PC as the subcategory with seo "pc"
HP LP3065 as the product with seo "HP-LP3065"
http://unbannable.com/v149/desktops/pc
My demo shows
Desktop as the parent category with seo "desktop"
PC as the subcategory with seo "pc"
HP LP3065 as the product with seo "HP-LP3065"
http://unbannable.com/v149/desktops/pc
Thanks Hagelslaghagelslag wrote:Q, it even works perfect with your multiple cat block module!!
Great.
With the help of Mr Q's Category Box Clone found here http://theqdomain.com/ocstore/opencart_ ... _box_clone
I have been able to solve my menu problem that has been frustrating me for a couple of months.
Hello, I had same problem too now. I was looking into it for some minutes and I think I figured it out. I am using OC just one day lol, but I hope it will work, try it:hagelslag wrote: Hi Q,
How do you do that?
As soon as i use a SEO keyword for a product, the breadcrumb and Category module links are lost as soon as you click that product.
I have set up an example with 2 products here:
http://bit.ly/cpuD61
One product with an SEO keyword, and one without. As you can see, if you click the left one, the subcat. closes and the subcat in the breadcrumb padth too.
Any idea why?
Thanks in advance!
Instead of lines ~55-57
Code: Select all
if ($category_id == $result['category_id']) {
$children = $this->getCategories($result['category_id'], $new_path);
}
Code: Select all
if ($category_id == $result['category_id']) {
$children = $this->getCategories($result['category_id'], $new_path);
}elseif(substr_count($new_path, '_') < 1){
array_unshift( $this->path, $category_id );
$children = $this->getCategories($result['category_id'], $new_path);
}

is there a version of this code for version 1.5?
i notice the html code is the same, the php code is different, could this be done through css?
attached is the /catalog/controller/module/category.php file.
i notice the html code is the same, the php code is different, could this be done through css?
attached is the /catalog/controller/module/category.php file.
Code: Select all
<?php
class ControllerModuleCategory extends Controller {
protected function index() {
$this->language->load('module/category');
$this->data['heading_title'] = $this->language->get('heading_title');
if (isset($this->request->get['path'])) {
$parts = explode('_', (string)$this->request->get['path']);
} else {
$parts = array();
}
if (isset($parts[0])) {
$this->data['category_id'] = $parts[0];
} else {
$this->data['category_id'] = 0;
}
if (isset($parts[1])) {
$this->data['child_id'] = $parts[1];
} else {
$this->data['child_id'] = 0;
}
$this->load->model('catalog/category');
$this->load->model('catalog/product');
$this->data['categories'] = array();
$categories = $this->model_catalog_category->getCategories(0);
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'])
);
}
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/category.tpl')) {
$this->template = $this->config->get('config_template') . '/template/module/category.tpl';
} else {
$this->template = 'default/template/module/category.tpl';
}
$this->render();
}
}
?>
ok i think i have solved my issue, all i did was change/remove
to
e.g remove the display: none
Code: Select all
.box-category > ul > li ul {
display: none;
}
Code: Select all
.box-category > ul > li ul {
/*display: none;*/
}
If you follow DrunkMunki's post that will show all subs at all times. However, there is a 2 level max that can be displayed at this time so if you have:
Parent
----SubA
----SubB
--------SubSubB
You won't see SubSubB as it is the 3rd level
This was done to cut down on the page loading times because the recursive category query is very taxing.
But perhaps that should be left to the discretion of the admin to choose how many levels are shown at the per-module basis.
Parent
----SubA
----SubB
--------SubSubB
You won't see SubSubB as it is the 3rd level
This was done to cut down on the page loading times because the recursive category query is very taxing.
But perhaps that should be left to the discretion of the admin to choose how many levels are shown at the per-module basis.
It works very well. but I need a little more such as:grongor wrote: Hello, I had same problem too now. I was looking into it for some minutes and I think I figured it out. I am using OC just one day lol, but I hope it will work, try it:
Instead of lines ~55-57Use thisCode: Select all
if ($category_id == $result['category_id']) { $children = $this->getCategories($result['category_id'], $new_path); }
If you find an bug, please tell meCode: Select all
if ($category_id == $result['category_id']) { $children = $this->getCategories($result['category_id'], $new_path); }elseif(substr_count($new_path, '_') < 1){ array_unshift( $this->path, $category_id ); $children = $this->getCategories($result['category_id'], $new_path); }
----SubA
--------Sub Su1
--------SubSub2
----SubB
--------Sub Su1
--------SubSub2
--------Sub Su3
--------SubSub4
We hope to receive help from you. thanks much
https://quocbinhvip.blogspot.com
https://sites.google.com/site/qbinh68/
https://sites.google.com/site/qbinh68/t ... t/opencart
The solution here is the same as the one found at One more level of subcategory. The only difference is that instead of
they suggest using
And there is some CSS rules defined.
I can confirm that the SEO URL problem also solves if all categories within a brunch (both parents and children) have their SEO keyword set. BTW, in my oppinion, 'SEO address' would be more relevant than 'SEO keyword'.
So, I think this topic is SOLVED.
Code: Select all
if($sisters) {
foreach ($sisters as $sisterMember) {
Code: Select all
if(count($sisters) > 1) {
foreach ($sisters as $sisterMember) {
I can confirm that the SEO URL problem also solves if all categories within a brunch (both parents and children) have their SEO keyword set. BTW, in my oppinion, 'SEO address' would be more relevant than 'SEO keyword'.
So, I think this topic is SOLVED.
Who is online
Users browsing this forum: Bing [Bot] and 57 guests