Latest News: (loading..)
kymation

[Addon] Categories Accordion Box for 2.3.1

383 posts in this topic

That looks good. I'll play with the code a bit and see what it's doing.

 

Regards

JIm

Share this post


Link to post
Share on other sites

@@kymation

@@mpalasis

 

I installed this bm_categories.php v1.03 20120511 on a shop and testing in Firefox, Chrome and IE 9, all appears to be working well, but noting that with no page reload I have a couple of top categories in the accordion menu that have no sub categories, therefore when you select one of these categories with no page reload, you don't see the products. Just the plus/minus icon changes on those.

 

So with a top category of "shirts" which has no subcategories, you don't get to see the shirts products and the top shirts category box does not expand (nothing to expand to of course)

 

With a top category of "pants", with "short pants" and "long pants" as subcategories, the box expands to show the two subcategories.

 

I could get around this be changing my category structure, but just FYI on that and thanks

Edited by altoid

Share this post


Link to post
Share on other sites

I installed this bm_categories.php v1.03 20120511 on a shop.............

 

Another follow up..I like the feel of what @@mpalasis provided, The smoothly expanding category is nice and the page doesn't "jump" on reload.

 

On the other hand, my original file (latest by@@kymation) will go to the category page when the top category in the accordion is clicked, thus giving the customer two places to look for sub categories, one in the accordion box, and then in the body of the page where all the sub categories are presented.

 

I appreciate the opportunity to compare the differences.

Share this post


Link to post
Share on other sites

So with a top category of "shirts" which has no subcategories, you don't get to see the shirts products and the top shirts category box does not expand (nothing to expand to of course)

 

Ahm, yes I'm aware. Sorry I forgot to mention it but I thought it was a given with the different, no-reload, effect. ;)

 

I too will have to re-arrange my category structure a bit when I am done with my move from 2.2 to 2.3.1 ...

Share this post


Link to post
Share on other sites

@@kymation

@@mpalasis

 

I installed this bm_categories.php v1.03 20120511 on a shop and testing in Firefox, Chrome and IE 9, all appears to be working well,

 

I checked this on IE 8 and found the categories would not expand, so I am rolling back to the latest version by Jim for now.

Share this post


Link to post
Share on other sites

@@altoid

 

I would normally say something like, 'time to move the internet forward and forget about IE8' ... but ~13% of my traffic this month is from IE8 users G@%#^#*(#)(*&! ...

 

*sigh* trying to fix it now...

 

first I need to install a VM with winXP in it so I can actually run IE8 ... lol...

Edited by mpalasis

Share this post


Link to post
Share on other sites

@@altoid

 

I would normally say something like, 'time to move the internet forward and forget about IE8' ... but ~13% of my traffic this month is from IE8 users G@%#^#*(#)(*&! ...

 

*sigh* trying to fix it now...

 

first I need to install a VM with winXP in it so I can actually run IE8 ... lol...

 

It was on my computer at work I caught this, during breaktime :- ...anyway, I wouldn't want to deprive my co-workers who all use IE8 there of a chance to by from the shop on their breaktime would I??

 

Thanks

Share this post


Link to post
Share on other sites

@@kymation

 

By the way Jim, the + / - icons are still futzed up on IE8, but IE9, chrome and firefox display correctly. I have your latest update installed.

Share this post


Link to post
Share on other sites

Facepalm...

The fix was actually easy, bug of the I'm stupid kind... cause by a misplaced </div> tag ( the js script that triggers the 'creation' was inside the div tag, and it is supposed to be outside of it...)

 

so, here's my latest code. However, since my last post, I have added the two things previously on my TODO list.

TODO: Move the styling in the children elements to a style-sheet. Make the accordion "Close-able".

 

so it's slightly different.

 

PHP Code: bm_categories_accordion.php v1.0.4 20120518 (also on pastebin)

 

Also, add this to your stylesheet.css:

CSS: CSS for bm_categories_accordion.php v1.0.4 20120518 (also on pastebin)

 

 

The customize-able areas are:

 

~line 113:

  • ' collapsible: true,' . PHP_EOL .
    change this to false if you don't want the menu to be collapsible (=close-able).

~line 129:

  • ' class="ui-priority-primary"' . // Optional: this makes top menu elements be bold.

~line 154

  • now has ' class="menu_' . $node->depth . '"' .
  • it used to be something like: 'style="margin: 0 -15px 0 ' . $indent . 'em; border-top: 1px solid #cccccc; padding-top:0.2em; padding-bottom: 0.2em;"'
  • NOTE: this moves the styling off to a stylesheet... see the CSS file linked above.

 

I highly suggest you customize the css to your liking (especially the css in menu_content div { } )

Share this post


Link to post
Share on other sites

@@altoid That is caused by IE being in Compatibility mode. You can fix* that by adding this line to the head in template_top.php:

 

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

 

*For certain values of "fix." Microsoft says this will always work. Everyone else, including my personal experience, says "sometimes."

 

@@mpalasis I had the same error in my code, so don't blame yourself. Every browser except IE is smart enough to deal with it. Oh well.

 

I suggest that you make all of the options either menu items in the module install method or CSS classes. Editing the code to make a style change is messy and difficult for people who don't understand PHP.

 

Regards

Jim

Share this post


Link to post
Share on other sites

@@altoid That is caused by IE being in Compatibility moe. You can fix* that by adding this line to the head in template_top.php:

 

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

 

*For certain values of "fix." Microsoft says this will always work. Everyone else, including my personal experience, says "sometimes."

 

 

Jim, I had that in my template top, I saw that in an eariler post, but at least on my computer at my day job, running IE8, it still didn't fix that. At home here, IE9 handles that fine, as a couple other browsers I have

 

here's what I have in the head section, another line of code included to show where it's situated.

 

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

 

Thanks

Share this post


Link to post
Share on other sites

As I mentioned, it doesn't always work. Try turning off Compatibility mode manually in the browser. It's the "broken page" icon in the toolbar, next to the reload icon. I think many people hit it by mistake when they're trying to hit reload.

 

You can also try adding the following to your root .htaccess file:

 

# ----------------------------------------------------------------------
# Better website experience for IE users
# ----------------------------------------------------------------------
# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_setenvif.c>
 <IfModule mod_headers.c>
   BrowserMatch MSIE ie
   Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
 </IfModule>
</IfModule>
<IfModule mod_headers.c>
#
# Because X-UA-Compatible isn't sent to non-IE (to save header bytes), we need to inform proxies that content changes based on UA
#
 Header append Vary User-Agent
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
</IfModule>

 

Regards

Jim

Share this post


Link to post
Share on other sites

Hi,

 

Recently I added a sixth subcategory, but it sin't showing on Categories Accordion. Only if I directly go to a product in the missing category (by searching or however), it shows.

 

Other than that the default category box shows the subcategory without any issue as well.

 

Please help.

Share this post


Link to post
Share on other sites

minor visual fix (no 'lone horizontal border' at the top of the children categories)

 

.menu_content div:first-child { border-top: 0px; }

 

CSS for bm_categories_accordion.php v1.0.4 20120519: http://pastebin.com/xayk1sEe

Share this post


Link to post
Share on other sites

@@oxwivi Clear the cache in your store, then your browser's cache.

 

@@mpalasis Thanks for the code. Here's what I did to make mine look better:

 

#categoriesMenu .ui-accordion-content div:first-child {
 border-top: 0px !important;
 margin-top: -12px !important;
}

 

Regards

Jim

Share this post


Link to post
Share on other sites

@@oxwivi Clear the cache in your store, then your browser's cache.

 

It did not work. A little amendment on when the category shows itself - going to any product will show all categories, not just the product with hidden category.

Share this post


Link to post
Share on other sites

Using your FTP program, delete all of the files in your cache directory.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Installed the latest update by @@mpalasis, works well, looks nice.

 

As well I inserted the style sheet code provided by @@kymation on this.

 

See above for both.....

 

Much appreciated.

Share this post


Link to post
Share on other sites

You can also try adding the following to your root .htaccess file:

 

# ----------------------------------------------------------------------
# Better website experience for IE users
# ----------------------------------------------------------------------
# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_setenvif.c>
 <IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
 </IfModule>
</IfModule>
<IfModule mod_headers.c>
#
# Because X-UA-Compatible isn't sent to non-IE (to save header bytes), we need to inform proxies that content changes based on UA
#
 Header append Vary User-Agent
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
</IfModule>

 

Regards

Jim

 

Jim, this has fixed the issue on IE8. Thanks much.

Share this post


Link to post
Share on other sites

I had an IE8 problem. + Icons overlay the text

 

In bm_categories_accordion.php (from1.1.2)

Moved the </div> line from 115 to after 127 (after the javascript)

No doubt there's a better solution.

Share this post


Link to post
Share on other sites

I had an IE8 problem. + Icons overlay the text

 

In bm_categories_accordion.php (from1.1.2)

Moved the </div> line from 115 to after 127 (after the javascript)

No doubt there's a better solution.

 

@@pchelpwebshop I had the same issue, see above in this thread, Jim has a couple solutions to try. The .htaccess solution worked for me., There's another fix to try a page or two earlier.

Share this post


Link to post
Share on other sites

Hi Jim,

 

It's Lyn again. Before asking questions, like to thank you for all your addons. I installed quite few of them and they are very useful, even though I still have some problems need to be solved.

 

I had installed this 1.1.2 version after CKEditor / PDF Datasheet / Products Specifications, and it seems works fine in the front page.

The only problem is when I go to Modules / Box / Categories Accordion, click on Edit, it doesn't show anything. I can remove it, but I can not edit the details for left or right column, sort order, selected Icon, unslected icon at all.

 

I then do another test install in brand new 2.3.3 and 2.3.1 oscommerce, it is the same result that I couldn't edit the modules.

 

I had open firefox and try to do it there, it is the same problem. (with IE i am using IE9 version)

 

I didn't modify any file, just copy and paste....what should I do now?

 

Thank you very much in advance.

 

Lyn

Share this post


Link to post
Share on other sites

You have an error of some sort. The error is not showing because you have error messages turned off. Go into your admin/includes/application_top.php and change this line

 

  error_reporting(E_ALL & ~E_NOTICE);

 

and change it to

 

  error_reporting(E_ALL);

 

Then try to edit the module again. Sometimes you have to use View Source in your browser to see the error message.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Hi Jim,

 

I had modified the admin/includes/application_top.php,

and went to modules/boxes again

 

this first error message right away:

 

Notice: Undefined variable: mInfo in /admin/modules.php on line 247

Notice: Trying to get property of non-object in /admin/modules.php on line 247

Notice: Undefined variable: mInfo in /admin/modules.php on line 249

Notice: Trying to get property of non-object in admin/modules.php on line 249

 

 

this is the error message I got when I tried to remove the module:

 

Notice: Use of undefined constant MODULE_BOXES_CATEGORIES_ACCORDION_TITLE - assumed 'MODULE_BOXES_CATEGORIES_ACCORDION_TITLE' in /includes/modules/boxes/bm_categories_accordion.php on line 25

 

Notice: Use of undefined constant MODULE_BOXES_CATEGORIES_ACCORDION_DESCRIPTION - assumed 'MODULE_BOXES_CATEGORIES_ACCORDION_DESCRIPTION' in /includes/modules/boxes/bm_categories_accordion.php on line 26

 

Warning: Cannot modify header information - headers already sent by (output started at /includes/modules/boxes/bm_categories_accordion.php:25) in /admin/includes/functions/general.php on line 35

 

 

No idea why this happened as it is a brand new osc 2.3.3 and 2.3.1 oscommerce....

(BTW, the host company use PHP 5.2.17)

 

What have I done wrong?

 

thanks in advance.

 

Lyn

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