Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Categories Accordion Box for 2.3.1


kymation

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
Link to comment
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.

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...

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.

 

Link to comment
Share on other sites

  • 6 months later...

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

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
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.

Link to comment
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!!

Link to comment
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.

Link to comment
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!!!

Link to comment
Share on other sites

  • 6 months later...

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

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...