Do you mean something like http://www.fido-x.net/demostore/?
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 try this example, but its dont work.
category/controller/category.php
---------------------------------------------
$request =& $this->locator->get('request');
if ($config->get('category_status')) {
$selected = $request->get('path');
}
....
$category_data[] = array(
'selected' => ($selected == $result['category_id']),
....
catalog/template/module/category.tpl
-------------------------------------------
' . $category['name'] . '';
else
echo '' . $category['name'] . '!';
} ?>
After I set in category.php test variable in array like 'a' => "aaa", and echo it in category.tpl like echo $category[a]; I have this error:
Undefined index: a
I think its is the same problem because when I try to echo selected same error.
Can anyone help me?
category/controller/category.php
---------------------------------------------
$request =& $this->locator->get('request');
if ($config->get('category_status')) {
$selected = $request->get('path');
}
....
$category_data[] = array(
'selected' => ($selected == $result['category_id']),
....
catalog/template/module/category.tpl
-------------------------------------------
' . $category['name'] . '';
else
echo '' . $category['name'] . '!';
} ?>
After I set in category.php test variable in array like 'a' => "aaa", and echo it in category.tpl like echo $category[a]; I have this error:
Undefined index: a
I think its is the same problem because when I try to echo selected same error.
Can anyone help me?
Last edited by inets on Thu Nov 13, 2008 5:06 pm, edited 1 time in total.
OK. Here we go, giving away trade secrets.
In "catalog/extension/module/category.php" insert the following (around line 20 in 0.7.9RC3):-
In "catalog/template/default/css/default.css", look for (around line 331)-
and add after this-
Then, in "catalog/template/default/module/category.tpl", change_
to
This should give you an "active state" for your category links. Do the same in your information files for the same effect.
Fido-X.
In "catalog/extension/module/category.php" insert the following (around line 20 in 0.7.9RC3):-
Code: Select all
// active state inserted by Fido-X
if ($request->get('controller') == 'category') {
if ($request->get('path') == $result['path']) {
$state = 'active';
} else {
$state = 'inactive';
}
} else {
$state = 'inactive';
}
// end of insert
foreach ($results as $result) {
$category_data[$result['category_id']] = array(
// active state inserted by Fido-X
'state' => $state,
// end of insert
Code: Select all
.box .category a {
background: url('../image/bullet_1.png') no-repeat 15px 5px;
padding: 0px 0px 0px 25px;
display: block;
text-decoration: none;
margin-bottom: 8px;
}
Code: Select all
/* active class inserted by Fido-X */
.box .category a.active {
background: url('../image/bullet_1.png') no-repeat 15px 5px;
padding: 0px 0px 0px 25px;
display: block;
text-decoration: none;
margin-bottom: 8px;
color: #0000FF; // set color to whatever you want in this case blue
}
/* end of insert */
Code: Select all
<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
Code: Select all
<a class="<?php echo $category['state']; ?>" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
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!
Who is online
Users browsing this forum: No registered users and 3 guests