Post by Qphoria » Sat Aug 09, 2008 11:13 pm

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
Last edited by Qphoria on Sat Aug 09, 2008 11:19 pm, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Fri Aug 15, 2008 11:30 am

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Thu Aug 21, 2008 12:05 am

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/

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by psionics » Sat Sep 06, 2008 3:32 pm

Thank You so much for this  ;)

New member

Posts

Joined
Tue Apr 01, 2008 4:49 pm

Post by jty » Fri Oct 17, 2008 1:50 pm

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  ::)

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Fri Oct 17, 2008 7:22 pm

jty wrote: Am I asking for too much  ::)
usually :P

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Fri Oct 17, 2008 7:26 pm

LOL  ;D
It's good to have some laughter in here.
I had a look myself but it went way over my head.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Heilong » Sat Oct 18, 2008 12:49 pm

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,

New member

Posts

Joined
Mon Sep 01, 2008 5:57 pm

Post by fido-x » Fri Nov 07, 2008 10:48 pm

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>

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Fri Nov 07, 2008 11:20 pm

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.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Fri Nov 07, 2008 11:32 pm

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.).

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by mrshabah » Wed Nov 26, 2008 6:19 pm

how we can add sub categories in the backend??? Am i missing anything?

Newbie

Posts

Joined
Wed Nov 26, 2008 6:09 pm

Post by jty » Wed Nov 26, 2008 7:36 pm

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

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by mlorac » Mon Dec 01, 2008 8:48 am

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!

Newbie

Posts

Joined
Sat Nov 15, 2008 2:42 pm

Post by AutoDTS » Wed Dec 10, 2008 1:38 am

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!

Newbie

Posts

Joined
Wed Dec 10, 2008 12:17 am

Post by Qphoria » Wed Dec 10, 2008 2:23 am

I will take a look

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by wolfsteritory » Thu Feb 05, 2009 2:36 am

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 ?

Here Are Your Options :
1st Option: Web3DesignStudio
More Options ? - What More Do You Need ? !


User avatar
New member

Posts

Joined
Sun Feb 01, 2009 2:08 am

Post by Qphoria » Thu Feb 05, 2009 2:45 am

ehh?
FAQ

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by wolfsteritory » Thu Feb 05, 2009 5:10 am

thank u verry much

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 ? !


User avatar
New member

Posts

Joined
Sun Feb 01, 2009 2:08 am
Who is online

Users browsing this forum: No registered users and 10 guests