Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

DHTML Category Drop Down Fly Out Menu


nollaf126

Recommended Posts

DHTML Category Drop Down Fly Out Menu

 

I've got a dilemma. I've built several websites, but I'm very new to PHP, osCommerce, and MySQL. I've learned a lot in the last couple weeks via PHP and MySQL for Dummies and many online references.

 

I'm building an osCommerce site named retroswag.com. I developed a PHP script to generate a javascript drop down menu that is populated from the site's osCommerce database of products. The problem is that the menu doesn't show up at all. The rest of the page loads perfectly. And as far as I can see from viewing the source code, the menu should show up just fine.

 

A working version of the menu is located here:

menu_tmp2.php

 

Here is the actual code that generates the above link: menu_tmp2.txt

 

The javascript menu include file for the DHTML menu is here: rsmenu.js

 

I'm using the sts simple template system and the file into which I've inserted my PHP code is here: sts_template.html

 

The menu is designed to only go two subcategories deep.

 

 

The navmaker database from which I'm pulling the category info is in this format:

 

Table name is nav_category_structure:

//category ID number

catNo varchar(6)

//category name

catName varchar(30)

//the Parent ID of the category (0 if it's a top-level category)

catPID varchar(6)

//the category's level, i.e., main category is 0, 1st level subcategory is 1, sub-subcategory is 2

catLvl char(1)

//a seven digit number indicating the ID of category's grandparent

lvl0 varchar(7)

//a seven digit number indicating the ID of category's parent

lvl1 varchar(7)

//a seven digit number indicating the ID of category

lvl2 varchar(7)

 

 

example:

 

navtableexample.gif

 

 

Troubleshooting:

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

I inserted some basic javascript into the sts_template.html file to ensure that javascript is indeed enabled and working properly for the site and it passed perfectly.

 

I know that PHP can be picky, so I thought maybe it could be an issue of where the jpg files are located. So I tried referencing the files directly with a full path reference as well as using the $templatepath variable. I also tried placing the graphic files into the same directory with the sts_template.html file as well as in the root directory of the site (http://www.retroswag.com/catalog/). I've tried every combination of graphic placement and reference method of which I could think. So that doesn't seem to be the problem.

 

I know that the working version on my hypnozebra.com server is just a straight, unparsed-by-osCommerce html/PHP combo and it works just fine. I also realize that the sts_template.html file is included from somewhere else in my osCommerce structure to be inserted into the http://www.retroswag.com/catalog/index.php page via PHP. The only thing I can think of is that somewhere in that process the rsmenu.js file is not being referenced properly. I'm really not sure. I compare the source code of the working version against that of the sts_template.html source and the rsmenu.js file is called in the same way in both files and the javascript produced by my PHP code appears to turn out just the same.

 

Between having seemingly no problems with the javascript code, no problem with the inclusion of the rsmenu.js file, and no discrepancy with relation to the placement and referencing of the graphics files for the menu, I'm at a complete loss.

 

Those are the only possible problems of which I can perceive, other than somehow the PHP in osCommerce is screwing with the functionality of my javascript code somewhere between the sts_template.html file and the final destination of the retroswag.com/catalog/index.php file.

 

Any shedding of any kind of light on the situation would be unbelievably appreciated. Thanks so much in advance.

 

-Fallon

Link to comment
Share on other sites

UPDATE:

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

I have done more testing and found that the rsmenu.js file is being called properly. And I firmly believe that there is nothing regarding the referencing of any images that is causing the problem. The problem may very well be with the content of the rsmenu.js file. I still can't figure out why the menu would work properly in one location on a server and not in another. Especially considering that when the page source is viewed, the entire javascript menu structure is intact and formatted properly, just as it is in the working version. I'm still at a loss.

 

Thanks again,

Fal

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...