Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jlramirez

Archived
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Real Name
    Jose Ramirez

jlramirez's Achievements

  1. It has been solved here: http://www.oscommerce.com/forums/viewtopic.php...tart=340#224066 If that doesn't solve your problem check the whole thread above.
  2. jlramirez, your method adds an extra database quary, but none is needed. There's a faster and easier way, that has been documented in this thread too: here's my version of it (catalog/includes/coolmenu.php): $categories = tep_get_categories(''); $height = -21; $depth=0; $blank_length; $depth_size; $depth_parentid; for($i=0; $i<count($categories); $i++) { // don't insert 1st entry ("please choose ...") $blank_length = blank_length($categories[$i]['text']); if($blank_length == $depth) { $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length > $depth) { $depth++; $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } else if ($blank_length < $depth) { for ($j=$depth; $j>$blank_length; $j--) { $depth_size[$j] = 0; $depth--; } $categories[$i]['depth'] = $depth; $depth_size[$depth]++; } $depth_parentid[$categories[$i]['depth']] = $categories[$i]['id']; // remove blanks $categories[$i]['text'] = substr($categories[$i]['text'], 12*$blank_length); if ($depth == 0) { $height += 17; // use oCMenu.level[0].height + 1 !! } print_menu_line($categories[$i], $depth_size,$depth_parentid, $depth); } Comments: $height = -21; //I don't know why -21, but i found out it works for me. maybe someone can explain? if ($depth == 0) //then it's a top level category, no db query needed $height += 17; // use what you took as oCMenu.level[0].height + 1 !! plus one because of the border For me, the above code works perfectly for all numbers of categories and all sizes of oCMenu.level[0].height . Nils Exactly!!, when i wrote my hack i was in such a hurry that i didn't even notice what the for() was (or at least i don't remember giving it a look). And it is exactly what i was looking for, a way to tell how many top-level categories there are, and of course if($depth == 0).... duh!!. Well i'm very sorry for that sorry piece of code. I'll have to link yours when someone else asks the same question. Is there a FAQ/Tips and Tricks for this one, its asked quite frequently. Cheers!!!
  3. Page 32, or you could click this: http://www.oscommerce.com/forums/viewtopic.php...tart=310#220529
  4. Please read this post to see a solution: http://www.oscommerce.com/forums/viewtopic.php...tart=290#217634 The file you have to edit is catalog/includes/coolmenu.php. Look for the line that says: $height.= 2.65*count($categories); That's were you have to include the code from the link above. Good luck!
  5. In the file catalog/includes/coolmenu.php, you would do this: for ($i=1; $i<SUB_CATEGORIES; $i++) { ......... oCMenu.level[' . $i . '].borderX=0 oCMenu.level[' . $i . '].borderY=0 ......... }
  6. You would basically do something like this. Insert the code below the logo column in header.php: <td valign="middle" align="right" class="boxText" rowspan="3"> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SEARCH); $info_box_contents = array(); $info_box_contents[] = array( 'form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'), 'align' => 'left', 'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"class="smallLink"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>'); new infoBox($info_box_contents); ?> </td>
  7. You should look at the source code of the generated page to see if there are any errors there. You should look first for the array declarations of the coolMenu (it sould be almost to the top, if you did everything correctly), and then keep looking for any messages like "function not found" or something. When i first installed MS2 with CoolMenu i kind of remember that i got a blank infoBox like you, and after searching the source code i found that MS2 had one function missing. So i copy and pasted it from MS1 to MS2, and that got the job done.
  8. What i did to make it fully autoadjust is just add these three lines (substituting the original line: $height.= 2.65*count($categories)) //With this line i read the top categories $categories_query = tep_db_query("select count(*) as count_top_categories from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); //i grab the array (actually its only one value, but i'm too lazy right now //to check if there is a function to grab only one value in the API $count_top_categories = tep_db_fetch_array($categories_query); //I multiply by 28(pixels) the number of top categories there are $height.= 28*$count_top_categories['count_top_categories'];
×
×
  • Create New...