Hi guys,
I have a question regarding my site: http://fan2c.com/collections
The thing is that I only want to show the categories who have sort_code 0 on the left menu (under collections)
and the same list on the right hand side as well.
I want to do the same on another page but then with products who have a different sort_code
Does anyone know how to do this?
I suppose it has to be changed in the category.php file but I couldn't find it
Thx,
Dieter
I have a question regarding my site: http://fan2c.com/collections
The thing is that I only want to show the categories who have sort_code 0 on the left menu (under collections)
and the same list on the right hand side as well.
I want to do the same on another page but then with products who have a different sort_code
Does anyone know how to do this?
I suppose it has to be changed in the category.php file but I couldn't find it
Thx,
Dieter
You could try editing "catalog/extension/module/category.php".
Changing
to
should achieve the results you want.
Regards, Fido-X.
Changing
Code: Select all
$results = $database->getRows("select c.category_id, cd.name from category c left join category_description cd on (c.category_id = cd.category_id) where parent_id = '0' and language_id = '" . (int)$language->getId() . "' order by c.sort_order");
Code: Select all
$results = $database->getRows("select c.category_id, cd.name from category c left join category_description cd on (c.category_id = cd.category_id) where parent_id = '0' and language_id = '" . (int)$language->getId() . "' and c.sort_order = '0' order by c.category_id");
Regards, Fido-X.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Thanks, that's already half the solution ...
The menu on the left is now OK but all the categories are still showing up on the right side
(The reason why i couldn't figure out the menu part is becuase i was working on the wrong category.php file
Cheers
The menu on the left is now OK but all the categories are still showing up on the right side
(The reason why i couldn't figure out the menu part is becuase i was working on the wrong category.php file
Cheers
Make a similar change to "catalog/controller/category.php" - somewhere around line 50.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
I have a suspicion that hacking one file to do two jobs will not work.
Instead, change the category.php to produce the left hand list with 0 sort order then...
Create a new module using copies of all the files used by category in the catalog area only and give it a new name. Then you can have a completely independant dataset.
With what I am showing you, the module does not even need to be installed in the admin and so will not appear on each page.
In the controller you want it to display from, put something similar to the following line.
add the following to library\cart\module.php
and in the target template, at the desired location, something like
Instead, change the category.php to produce the left hand list with 0 sort order then...
Create a new module using copies of all the files used by category in the catalog area only and give it a new name. Then you can have a completely independant dataset.
With what I am showing you, the module does not even need to be installed in the admin and so will not appear on each page.
In the controller you want it to display from, put something similar to the following line.
Code: Select all
$template->set('workflow_steps', $module->fetchOne('workflowstep')); // Experimental call to a single module, not necessarily installed.
$template->set($module->fetch());
$response->set($template->fetch('layout.tpl'));
Code: Select all
//
// Experimental, to fetch a module that exists but is not actually installed.
//
function fetchOne($code)
{
$file = DIR_EXTENSION . 'module' . '/' . $code . '.php';
$class = 'Module' . str_replace('_', '', $code);
if (file_exists($file))
{
require_once($file);
$obj = new $class($this->locator);
}
$module_data = array();
$module = $obj->fetch();
if ($module)
{
$module_data = $module;
}
return $module_data;
}
Code: Select all
<?php if (isset($workflow_steps)) { ?>
<?php echo $workflow_steps; ?>
<?php } ?>
Who is online
Users browsing this forum: No registered users and 1 guest