Page 2 of 2

Re: Sub-Category Listing: 100% Complete - Released

Posted: Sat Aug 09, 2008 11:13 pm
by Qphoria
eek java-servlet! (::shudders::  :-X)

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  ;D

Re: Sub-Category Listing: 100% Complete - RELEASED

Posted: Fri Aug 15, 2008 11:30 am
by Qphoria
UPDATE v0.2 !

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
Special Thanks to bruce for his help with the sort order!


DOWNLOAD

Re: Sub-Category Listing: 100% Complete - Released

Posted: Thu Aug 21, 2008 12:05 am
by Qphoria
JNeuhoff wrote:
Qphoria 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?
Yes, like that. As an example, see
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.
FYI, I came across a nice example of what you are talking about. Figured I'd post it here for future reference:
http://www.karlnelson.net/nestedlists/

Re: Sub-Category Listing: 100% Complete - RELEASED

Posted: Sat Sep 06, 2008 3:32 pm
by psionics
Thank You so much for this  ;)

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Fri Oct 17, 2008 1:50 pm
by jty
I am wondering ...........
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  ::)

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Fri Oct 17, 2008 7:22 pm
by Qphoria
jty wrote: Am I asking for too much  ::)
usually :P

But because it's you, jty, I'll take a look.  ;)

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Fri Oct 17, 2008 7:26 pm
by jty
LOL  ;D
It's good to have some laughter in here.
I had a look myself but it went way over my head.

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Sat Oct 18, 2008 12:49 pm
by Heilong
Hi,

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,

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Fri Nov 07, 2008 10:48 pm
by fido-x
Here's an idea Q - by setting a margin value in the controller and passing that through to the template, you can have unlimited subcategories using the existing style.

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
}
Add this value to the category_data array:

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'],
);
And in the template file, change

Code: Select all

<a class="<?php echo $category['class']; ?>" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
to

Code: Select all

<a style="margin-left: <?php echo $category['margin']; ?>px;" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Fri Nov 07, 2008 11:20 pm
by Qphoria
looks like a good idea.

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.

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Fri Nov 07, 2008 11:32 pm
by fido-x
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.
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.:

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>
Set up 3 or 4 different styles and use some mathematical function to rotate between them based on the level (eg. odd or even, divisible by 3, etc.).

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Wed Nov 26, 2008 6:19 pm
by mrshabah
how we can add sub categories in the backend??? Am i missing anything?

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Wed Nov 26, 2008 7:36 pm
by jty
mrshabah wrote: how we can add sub categories in the backend??? Am i missing anything?
In admin category, after you add a category, look on the left for the folder
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

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Mon Dec 01, 2008 8:48 am
by mlorac
Thanks for everything!

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!

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Wed Dec 10, 2008 1:38 am
by AutoDTS
Hello,

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!

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Wed Dec 10, 2008 2:23 am
by Qphoria
I will take a look

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Thu Feb 05, 2009 2:36 am
by wolfsteritory
guys, how does one add a subcategory from the c panel ? coz i dont get anything new ?

id i do something rong ? do i have 2 delete the files & replace? not 2 overwrite ? ..or something ?

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Thu Feb 05, 2009 2:45 am
by Qphoria
ehh?
FAQ

Re: [RELEASED] - Cascading Subcategory Listing

Posted: Thu Feb 05, 2009 5:10 am
by wolfsteritory
thank u verry much

any news about how can i make the buy now , singleproduct checkout process?