Hi
I m loading the category layout in my Custom Filters extennsion for displaying the filtering results.
The problem is that when there is no category id in the URL's query it displays all the categories at the top.
For example if you try option=com_virtuemart&view=category&virtuemart_category_id=0 , all the categories are displayed.
Can we fix/improve that, to display the children categories only when there is a parent selected?
The parent of all categories is the 0,
But when you mean the products, then you must use the categories view, which is only displaying categories, but no products.
It wouldn't be more correct to display categories there only when there is a category selected with an id higher to zero?
Otherwise what's the point of having all the categories displayed there?
To have all categories displayed there?
What should else happen when you enter category_id=0 ?
Category id = 0 means that no category is selected. So children categories cannot be displayed when there is nothing selected.
Replacing the code in the line 60 of the components\com_virtuemart\views\category\tmpl\default.php, with the following, it does the trick:
if ( VmConfig::get('showCategory',1) and empty($this->keyword) and $this->category->virtuemart_category_id>0)
no, this is just wrong
category_id 0 means, get all categories beyond 0. No category selected would be !isset or ===null. Not 0. I hope you know that in php null != 0 != "0" != ""