I am using opencart as part of a process for users to order food from any one of a selection of local restaurants, which will then be delivered by my customer
Some of the restaurants have extensive menus, so I decided to use subcategories as follows to help users refine their searches
I located teh following code within {my-template}/product/category.tpl
Code: Select all
if ($categories) { ?>
<h2><?php echo $text_refine; ?></h2>
<section class="category-list">
Which works as expected: for example when in the category "Joe's"
" Refine search" we see
Joes' > Pizza (34)
Joe's > Pasta (20)
Joe's > Drinks (16)
Joe's > Desserts (8)
However, when they click on , say, "Joe's > PIzza (34)", we see a listing of all the products in that category ( i.e 34 pizzas)
BUT
the refine search element is not displayed.
As far as I can see from the code this is because it is designed to only show sub categories - or child - or 'lower level' categories.
Code: Select all
if ($categories) {
// meaning if there are are categories lower than the category we are currently in ?
?>
<h2><?php echo $text_refine; ?></h2>
<section class="category-list">
What I want to do :
I would still like to display " same level" or " brother/sister/sibling" categories
So in the example above if some-one is browsing the pizzas in category "Joe's >Pizzas", I would like to still be able to display the following to the user
Joes' > Pizza (34)
Joe's > Pasta (20)
Joe's > Drinks (16)
Joe's > Desserts (8)
so they can navigate directly to "desserts" from within "pizzas" - and then to "drinks" from within "desserts"...
So how to do this ?
I have done a google search and of his forum but can't see anything quite like the answer I seek.
Within {my-template}/product/category.tpl -
if I print_r the $categories array, it returns an empty array when in a 'lowest level' category
So perhaps I have to write my own SQL query - ( I hope not ) -
What I want is something like this...
Code: Select all
//if($categories)
// if ( there are other categories which have the same parent as this current category....){ ?>
<h2><?php echo $text_refine; ?></h2>
<section class="category-list">
I hope this makes sense and someone can point me in the right direction...