Jump to content
Latest News: (loading..)
kymation

[Addon] Categories Accordion Box for 2.3.1

Recommended Posts

Thats why i was hoping you would be able to add the $("#menu").menu(); function to this contribution as in the above code. That does the fly out function on the accordion menu. But unfortunately i am not a coder .. only a follower of instructions.

 

This way people can have the choice of just the accordion menu or they can also have the fly out function if they wish.

 

I can hardcode the categories and sub-categories into the above code but pulling data from the database and making categories is the right way to go.

Edited by CGhoST

Share this post


Link to post
Share on other sites

It's not anywhere near that simple. If you just add the Superfish menu to a Categories menu, you get the Superfish menu addon I mentioned. To apply that to only subcategories would be much more complicated, as each top-level category now becomes a separate Superfish menu. You also have to keep each one of those Superfish menus from interfering with the others by assigning them each a unique ID.

 

Feel free to code this up if you want to.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

hi

 

i am getting Undefined variable: data includes/modules/boxes/bm_categories_accordion.php on line 237

 

line 237 reads as this

 

$data .= $categories_string . PHP_EOL;

 

regards

 

naf

Share this post


Link to post
Share on other sites

That's a bug. Find this code in the bm_categories_accordion.php module:

 

function getData() {
  global $categories_string, $tree, $languages_id, $cPath, $cPath_array;

 

and add after that:

 

 $data = '';

 

Thanks for the bug report.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

That's a bug. Find this code in the bm_categories_accordion.php module:

 

function getData() {
 global $categories_string, $tree, $languages_id, $cPath, $cPath_array;

 

and add after that:

 

 $data = '';

 

Thanks for the bug report.

 

Regards

Jim

 

thanks

Share this post


Link to post
Share on other sites

Are there any sites I can see that are using this contribution?

 

superfish is -> here

 

Categories Accordion is =>here

 

Regards

Joli


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

Install the Categories Accordion addon. See the link below.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I have installed the Categories Accordion Box, and Theme Switcher ,

Both works together ,

 

Is it Possible to hide specific category name from Category box with using above add-one ?

 

 

Thanks ,

Share this post


Link to post
Share on other sites

Hi Dinesh,

 

yes working on 2.3x relatively easy install most of the work is in the admin/categories.php

 

As always backup your site and database before any changes.

 

I have upoaded a bm_categories_accordion.php but would suggest you compare with yours and use a compare tool like winmerge to see the changes

 

he is just adding a and c.categories_status = 1 in x 2 places about line 150 and line 200

 

Better to compare with your bm_categories_accordion.php and merge as I believe Jim as updated the contribution several times since I installed

 

The rest is pretty straight forward

 

Regards

Joli

bm_categories_accordion.php


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

Ok not sure, but your demo site and my site both are like this

If you hover over a category, any category, all you see as the link (all of them) is

http://mydomainname.com/#

Why always "#" and not the actual link? This seems bad. Is this just the way this menu is? is this fixable?

Google sees every category link as a link back to home page / and not to a category.... yikes

Any insight on this appreciated.


-Dave

Share this post


Link to post
Share on other sites

That's the way the jQuery Accordion works. You could write your own Accordion, but what would be the point?

 

The actual links are done with Javascript. Both Google and Bing have no trouble reading the links in Javascript, so it's not much of an issue. You could add a plain HTML link section to the bottom of the page if you wanted a backup.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

You're welcome. I don't mind explaining, but my answers may sometimes be short. That's usually due to time constraints, not a problem with you asking a question.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Awesome addon!!  I do have a couple of questions though. 

 

1.  In Admin, there is a drop down to choose your "selected" and "unselected" icons.  I do not have any choices when clicking the drop down.  Do I need to do anything to add them, or should they be there by default?

 

2.  On the store side, if I click a category that does not have any subcategories, what is supposed to happen?  For me, the box still expands but is empty...just wondering if that is correct. 

 

I am using a custom themeroller theme.  I'll admit that I got a bit confused by all the jquery version information I read in the forums.  The themeroller files I downloaded were version 1.9.2, but they didn't work at first, so I renamed to 1.10.4 and they worked (for styling anyway).  Might that be affecting the accordion box?

 

Thanks!!!

Share this post


Link to post
Share on other sites

1. You missed a file: catalog/ext/jquery/ui/icons.txt.

 

2. Yes, that's correct. The jQuery UI Accordion code that this box uses is supposed to have content in the boxes. There is no provision in the code to not have the boxes. It could be hacked in, but that defeats the purpose of using the Accordion in the first place. Might as well just use a standard box and style the links as buttons.

 

Mixing different versions of jQuery and jQuery UI can cause problems. If it works, leave it alone. If it doesn't, get compatible versions and use those. The Themeroller download page gives you the version numbers and the version of jQuery that each is compatible with. Just don't use jQueryUI version 1.11x -- that doesn't work with osCommerce without modifications.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

1. You missed a file: catalog/ext/jquery/ui/icons.txt.

 

Hmmm...I double checked that the file is there.  Any idea what would be preventing it from showing up in the drop down?

 

Thanks again!!

Share this post


Link to post
Share on other sites

It may be something in your setup. Try changing line 296 of the module file from this:

 

 

      $file = '/ext/jquery/ui/icons.txt';

 

to this:

 

 

      $file = DIR_FS_CATALOG . 'ext/jquery/ui/icons.txt';

 

Please let me know if that helps.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

It may be something in your setup. Try changing line 296 of the module file from this:

      $file = '/ext/jquery/ui/icons.txt';

to this:

      $file = DIR_FS_CATALOG . 'ext/jquery/ui/icons.txt';

Please let me know if that helps.

 

Regards

Jim

 

Worked like a charm!  Thanks, Jim...you're the best!!!

Share this post


Link to post
Share on other sites

I like this add-on, except for catagories that don't have sub-catagories.
 
I changed the last line of the following bit starting at about line 63 :

        $categories_string .= '<a href="#">';
        $categories_string .= $tree[$counter]['name'];
        $categories_string .= '</a>';

        $categories_string .= '</span>' . PHP_EOL;
        $categories_string .= '<div><b>' . $tree[$counter]['name'] .'  → </b>' . PHP_EOL;

This helps, but isn't perfect. 

 


------------------------------------------------------------------------

The first panacea for a mismanaged nation is inflation

of the currency; the second is war. Both bring a
temporary prosperity; both bring permanent ruin.
Ernest Hemingway
------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

The accordion doesn't work very well with no content. Others have remarked on this, but it's built into jQueryUI, so not much that can be done about it.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×