Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Support thread for Categories navbar v2.3.4.1CE


Recommended Posts

Support thread for Categories navbar v2.3.4.1CE

This is an update and mod of an old addon so all credit goes to original author.

A simple addon to let you place a Categories menu in the navbar.

You have 2 option

a) simple based on stock bootstrap


image.png.cf239709d2839705dc2938dfd3f7f634.png

b) fancy based on additional css.


image.png.b24400cc862c2b84f5ba8d0c67b9426e.png

 

In……….. /includes/modules/navbar_modules/templates……… You have 2 files,

tpl_nb_horizontal_multi_menu.php

and

tpl_nb_horizontal_multi_menu.fancy

The simple version is installed as stock. If you wan the fancy version then rename the files as required (change .fancy to .php)

Simply install all the files and install Horizontal multi menu addon and turn on in admin.

You can play around with the css to get the look as you like but best to do this in user.css and not the responsivemultimenu.css.

Fancy option will only work if you install all the files.

It has been tested on the v2.3.4.1 CE Only.

 

Link to comment
Share on other sites

  • Replies 65
  • Created
  • Last Reply

Hi @JcMagpie

Thank you for your contribution. I have installed this on my website and need some CSS help perhaps? On the homepage I get just the top categories show and all is ok, but any other page the subcats pop out and go way off the lower screen and I cannot scroll to see all of the items in the box. Can I make the wording space wider so it will not go so far down or I guess I can just have the top cats show on all pages as at least those will be shown.

Thanks for any advice.

navbar-cats-homepage.jpg

navbar-cats-offscreen.jpg

Link to comment
Share on other sites

Ok I see your problem :biggrin:,  Long lists of cat's have always been a problem. Yes you can change the size in css so the line is longer. Just right click in browser and inspect elements and just make the changes in user.css

or just add to your user.css and play with it until your happy.

.dropdown-menu {
    width: 300px !important;
    height: 400px !important;
}

Alternatively  ask one of the developers if they have a better cat’s addon. I am sure they probably do. Mine are just simple quick ones done for my sites.

 

Link to comment
Share on other sites

Try this instead, set the width and max hight to what you need. It will make any over flow scroll. Just be careful messing with too much css can make your site less mobile friendly.

Bootstrap is a bit clunky but it’s a comprise between large screens and small.

.dropdown-menu{
    width: 250px;
    white-space: normal;
    max-height: 100px;
    overflow-x: hidden;
}

image.png.211dbc380f56baac9a5a86bf0c18ec62.png

 

 

Link to comment
Share on other sites

Had a play with the css and I think its better to change the code a little, so try this file and see, just replace in

includes/modules/navbar_modules/templates/

You can see how it behaves on the test site, I think this is beter for the mobile view.

https://www.justfastfood.com/

 

tpl_nb_horizontal_multi_menu.php

 

Link to comment
Share on other sites

  • 5 months later...

It has been updated make it works with BS4 and allow styling to be configured in admin.

A simple addon to let you place dynamic categories into the Navbar.

Again totally stand alone with no core code changes. Simply copy all files into relevant sections and go to admin modules /content and install.

Enjoy.

As allways can be seen on the test sites.

BS4 https://chilleddisplays.co.uk/

BS3 https://www.justfastfood.com/

image.png.46309cc5f53ce4e304716978aafd50b4.png

 

Link to comment
Share on other sites

Hi, I am slowly in the process of rebuilding my shop with the latest CE version of OSC and have just installed your contribution as the very first addon after a clean install  on my XAMP testing server

I am using the latest version of the addon that you just uploaded:

PHP Version: 7.2.12 (Zend: 3.2.0)

The zip file also appears to be missing the fancy version of the file for the schmick looking menu.

Any help or suggestions would be great, I do not have any coding experience as such, but managed to muddle my way through my last rebuild in 2014 to a shop that is still working on php5.6, but obviously would like to rebuild with the latest.

Cheers!

   

navbar error.PNG

Link to comment
Share on other sites

You are using too high a version of php! drop to 7.2 and it should be ok. But I will have a look, it was tested on 7.2 and did not show any issues. The fix is simple simply define the constant. This is a trend with the higher php version they will cause more and more errors on old code. It will not affect the working of the add-on.

Also there is no fancy in the new update 😊 you can change all the styling in the admin config. You can make it as fancy as you like.

 

Link to comment
Share on other sites

4 hours ago, nedragdnuos said:

Hi, I am slowly in the process of rebuilding my shop with the latest CE version of OSC and have just installed your contribution as the very first addon after a clean install  on my XAMP testing server

I am using the latest version of the addon that you just uploaded:

PHP Version: 7.2.12 (Zend: 3.2.0)

The zip file also appears to be missing the fancy version of the file for the schmick looking menu.

Any help or suggestions would be great, I do not have any coding experience as such, but managed to muddle my way through my last rebuild in 2014 to a shop that is still working on php5.6, but obviously would like to rebuild with the latest.

Cheers!

   

navbar error.PNG

If I am not mistaken you just need to find the code and add a ' and ' so that the code that is causing the error looks like the assumed code.

Correct me if I am wrong.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

4 hours ago, nedragdnuos said:

Any help or suggestions would be great

I have not been able to recreate the error you are getting on 2 live site both running PHP7.2 The line in question is,

if (SHOW_COUNTS == 'true') {

Perhaps you have your warnings set too high on your local host, but I'm no php expert! I'm sure  someone will let us know if there is an error that needs fixing.

 

 

Link to comment
Share on other sites

The fix is:

if ( defined('SHOW_COUNTS') && SHOW_COUNTS == 'true' ) { 

 

Link to comment
Share on other sites

In application_top.php:

  error_reporting(E_ALL);
  ini_set('display_errors','1'); 

Only during development, not for production/live site!

Link to comment
Share on other sites

Then there may be something wrong in Steve's @14steve14 installation. Uninstall/reinstall the module?

 

Edit: Just checked,

SHOW_COUNTS

is not defined anywhere in your module.

It maybe defined somewhere else in your test store and therefore you do not get this error.

Link to comment
Share on other sites

Looks like my fingers were lazy again! Sorry

find line

/includes/modules/navbar_modules/templates/tpl_nb_horizontal_multi_menu.php on line 119

MODULE_NAVBAR_HORIZONTAL_MULTI_MENU_BORDERTBOTTOM

and change to MODULE_NAVBAR_HORIZONTAL_MULTI_MENU_BORDERBOTTOM

:blush:

 

Link to comment
Share on other sites

To clear this up:

SHOW_COUNTS

was used in standard oscommerce, but has been removed in the actual CE BS EDGE FROZEN series and was never in use in BS.

The output where you use it in cat_navbar_responsive.php anyway is empty:

        if (SHOW_COUNTS == 'true') {
            $products_in_category = tep_count_products_in_category($key);
            if ($products_in_category > 0) {
                $output .= '';
            }
        }

so it should be removed or the configuration constant should be added to your module.

It seems the code base used to create the category tree is outdated.

It would be much easier (and efficient/faster) to use the core category_tree class or a variant of it like it has been done in this contribution:

https://apps.oscommerce.com/42x4C&horizontal-categories-menu-bs

Link to comment
Share on other sites

 

16 minutes ago, raiwa said:

It would be much easier (and efficient/faster) to use the core category_tree class

Not in a position to pass jugment on this so thank for the feedback. :thumbsup: something to consider for the next update if and when I have time.

I already have a add-on that uses the stock cat's class 😊 I find this one is quicker and smother but hey thats just my view.

https://apps.oscommerce.com/nytlE&jcm-header-categories

 

Link to comment
Share on other sites

10 hours ago, raiwa said:

if ( defined('SHOW_COUNTS') && SHOW_COUNTS == 'true' ) {

The above fixed it............ and the spelling mistake in

7 hours ago, JcMagpie said:

/includes/modules/navbar_modules/templates/tpl_nb_horizontal_multi_menu.php on line 119

MODULE_NAVBAR_HORIZONTAL_MULTI_MENU_BORDERTBOTTOM

and change to MODULE_NAVBAR_HORIZONTAL_MULTI_MENU_BORDERBOTTOM

Thank you all for your help, it is greatly appreciated!

 

Enjoy your weekend!

Link to comment
Share on other sites

Glad you got it sorted. I have updated it to cover the errors and fix a few warnings being given on scripts.

JcM-categories-navbar-V1.3 for v2.3.4.1 CE BS4 and BS3

Has been updated to fix errors. Also updated to replace js script for hover with css hover. This has required new files for BS3.

Also BS3 setup for fancy as this was causing confusion.

image.png.c7464af63d2835ec8c7fb6a5a8df6a63.png

 

Link to comment
Share on other sites

Some things to consider when reporting a problem with add-ons (this is for mine others may have different opinions)

 

1) I’m not a developer. I do this in what little spare time I have mainly for my own sites.

So please understand although it may be urgent for you, I will not be able to drop things and look at the problem straight away.

 

2) Not everything you see as a problem is that urgent! You need to understand the errors and respond accordingly. It’s just a fact of life that if you have code you will have bugs and updates that need to be done. I don’t know any one professional or not that produces perfect code! I know I definitely don’t!

So with osC the PHP will normally give you 3 main types of errors. ( many others but 3 main ones)

 

a) E_ERROR

Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted.

Hopefully you should never see these as the code is broken and will not run, hence I will not have a successful test on my test site. There may be occasions when one is seen especially if you run the add-on on the wrong version of PHP.

 

b) E_WARNING

Run-time warnings (non-fatal errors). Execution of the script is not halted.

A warning is a message saying "You are doing something wrong and it is very likely to cause errors in the future, so please fix it."

I do my best to catch these but they will and do slip through the testing. Most of these will not stop the code running so you have to check the error logs to see them.

Many are just what the word says warnings that can and are on many occasions ignored until the next update.

 

c)E_NOTICE

Run-time notices. Indicate that the script encountered something that could indicate an error, but could also happen in the normal course of running a script.

A notice is an advisory message meaning "You probably shouldn't be doing what you're doing, but I'll let you do it anyway"

These can be ignored and again will normally be dealt with in the next update.

So hopefully this will help alleviate any panic you may have when looking at your error logs. I’ll do my best to fix issues that are posted.

 

Link to comment
Share on other sites

  • 1 month later...
Quote
Version Checker pixel_trans.gif

Installed Version: osCommerce Online Merchant v2.3.4.1 CE

PHP 7.1.25

 

Downloaded 1.3 and installed the files in their respective directories. Checked for the stray 'T' in /includes/modules/navbar_modules/templates/tpl_nb_horizontal_multi_menu.php and did that fix.

Instructions are:

Quote

go to admin modules /content and install

As there is nothing to install in /Content

But going to Module / Navbar Modules creates a bunch of errors

Quote

Warning: include(/includes/languages/english/modules/navbar_modules/nb_horizontal_multi_menu-BS3.php): failed to open stream: No such file or directory in /admin/modules.php on line 142

Warning: include(/includes/languages/english/modules/navbar_modules/nb_horizontal_multi_menu-BS3.php): failed to open stream: No such file or directory in /admin/modules.php on line 142

Warning: include(): Failed opening '/includes/languages/english/modules/navbar_modules/nb_horizontal_multi_menu-BS3.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /admin/modules.php on line 142

Fatal error: Cannot declare class nb_horizontal_multi_menu, because the name is already in use in /includes/modules/navbar_modules/nb_horizontal_multi_menu.php on line 18

Hopefully I gave enough information that someone can steer me in the right direction.

 

Thanks

Link to comment
Share on other sites

Warning: include(/includes/languages/english/modules/navbar_modules/nb_horizontal_multi_menu-BS3.php

If using the BS3 files you need to rename them by removing the -BS3 from the end! so

nb_horizontal_multi_menu-BS3.php

will become

nb_horizontal_multi_menu.php

 

 

 

Link to comment
Share on other sites

10 minutes ago, JcMagpie said:

Warning: include(/includes/languages/english/modules/navbar_modules/nb_horizontal_multi_menu-BS3.php

If using the BS3 files you need to rename them by removing the -BS3 from the end! so

nb_horizontal_multi_menu-BS3.php

will become

nb_horizontal_multi_menu.php

 

 

Thank you

 

From the Readme file I am using

Responsive-osCommerce-master.zip

osCommerce 2.3.4.1
+ Bootstrap v4 (Shop Side)  
+ jQuery
+ other external scripts

Since it says Bootstrap 4 I deleted the BS3 file and the error went away, installed but nothing shows on site.

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...