I think I've see the Yahoo javascript/dhtml version of it used on zen-cart:
http://developer.yahoo.com/yui/examples ... klist.html
A good contrib for you to make
I had been trying to figure a way to sort the subcategories at their own level, while keeping the relevant-only part. It proved to be a bit harder than planned, but after working with bruce, I combined his use of the GPL Tree class api with my relevant-only code to basically create a hybrid of our two Category contribs.
- Supports the sort order set in the admin, but will still only show the relevant subcategories (also sorted).
- Cleaned up the code a bit
- Tree Class API code included
DOWNLOAD
FYI, I came across a nice example of what you are talking about. Figured I'd post it here for future reference:JNeuhoff wrote:Yes, like that. As an example, seeQphoria wrote: You mean to toggle open and close?
Like:
Cat 1
Cat 2
Cat 3
*Click Cat 1*
Cat 1
- Cat1sub1
- Cat1sub2
Cat2
Cat3
*Click Cat 1 again*
Cat 1
Cat 2
Cat 3
Like that?
http://www.histpop.org/ohpr/servlet/Bro ... active=yes
While it is not OpenCart (in fact it's a Java servlet) it illustrates the toggling mechanism of sub-trees.
Its behavior is similar to what the user knows from Windows or Linux file explorers.
The toggling of sub-trees should only be triggered by clicking on the icon
(which could be a plus or minus icon, or of a small tri-angular shape).
The content pane should only be re-freshed after clicking on the category name link.
http://www.karlnelson.net/nestedlists/
Is it possible to mod this sub cat menu so that Level_0 and Level_1 stay opened while Level_3, Level_4 collapses and expands
Like this:
When first viewed
Cat 1
- Cat1sub1
- Cat1sub2
Cat2
Cat3
*Click Cat1sub1 * becomes
Cat 1
- Cat1sub1
--- Cat1sub1sub-sub1
--- Cat1sub1sub-sub2
- Cat1sub2
Cat2
Cat3
* Click Cat 2 and it becomes back to
Cat 1
- Cat1sub1
- Cat1sub2
Cat2
Cat3
I would like Level_0 AND Level_1 to always stay open
Am I asking for too much
I'd like to use this module to implement an horizontal dropdown menu on my OC website, something like this http://www.nmmedical.fr/, but maybe using JQuery to add an effect when droping down for subcategories when the mouse hover over the menu (category).
Thanks for help,
Set the margin as follows:-
Code: Select all
if ($result['parent_id'] == 0 && $i == 0) {
$class = 'lvl_0';
// inserted by Fido-X
$margin = $i; // sets margin to 0 at top level
} elseif ($result['parent_id'] == $level[$i]) {
$class = 'lvl_' . ($i+1);
// inserted by Fido-X
$margin = (($i+1) * 15); // increase margin by 15 pixels for each level
}
Code: Select all
$category_data[$result['category_id']] = array(
'name' => $result['name'],
'href' => $url->href('category', false, array('path' => $result['path'])),
'class' => $class,
'margin' => $margin, // inserted by Fido-X
'sort_order' => (int)$result['sort_order'],
);
Code: Select all
<a class="<?php echo $category['class']; ?>" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
Code: Select all
<a style="margin-left: <?php echo $category['margin']; ?>px;" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
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 really was torn on the styling because I was thinking that what if people wanted a different bullet for each level, or different font or something, thats why i made it use a diff style per level. But your way is good too.
I was actually thinkin about removing the Tree class and using the inline functions that I used for the db-admin menu. But I should really look at the performance times first.
That can still be done, as long as the padding for each level is the same (ie. leave it up to the margin to determine the amount of indent), eg.:Qphoria wrote: I really was torn on the styling because I was thinking that what if people wanted a different bullet for each level, or different font or something, thats why i made it use a diff style per level.
Code: Select all
<a style="margin-left: <?php echo $category['margin']; ?>px;" class="<?php echo $category['class']; ?>" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
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!
In admin category, after you add a category, look on the left for the foldermrshabah wrote: how we can add sub categories in the backend??? Am i missing anything?
Click on that folder on the left and then you can add sub cats for that category
The same with options for products and other areas, look for the folder on the left
It's not intuitive but it becomes natural after awhile
PS. Welcome to Open Cart
I found many posts regarding to sub categories and I was really confuse.
But when I downloaded the file here: http://www.opencart.com/contribution/in ... tion_id/59
it works perfectly fine!
I downloaded V1 of this great thing you did but i have a problem.
The pictures asigned to the sub category are not showing. Please take a look and tell me what can i do about it: Click on "Interfete VAG" www.autodts.com
Thank you!
id i do something rong ? do i have 2 delete the files & replace? not 2 overwrite ? ..or something ?
Here Are Your Options :
1st Option: Web3DesignStudio
More Options ? - What More Do You Need ? !
any news about how can i make the buy now , singleproduct checkout process?
Here Are Your Options :
1st Option: Web3DesignStudio
More Options ? - What More Do You Need ? !
Users browsing this forum: No registered users and 2 guests