Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * - - 2 votes

CSS Menu


251 replies to this topic

#221 avillagra@adinet.com.uy

  • Community Member
  • 2 posts
  • Real Name:Aldo

Posted 17 November 2008, 15:41

Hello,

sorry, my english es bad ...

Your contribution es very nice an i try install it, but not run.

First install 1st version of 6 oct 2006 but not run.

After install last version of CSS menu but not run yet.

I follow all steps in the "installation_notes_0.4.1.txt".

Run in IIS PHP and oscommerce-2.2rc2a.

The error is:

0 ) { $returnval .= "

* "; } if ( $productsDisplay > $cssMenuConfig['maxProductsInMenu'] ) { $productsDisplay=$cssMenuConfig['maxProductsInMenu']; $addMore= true; } $count_string = ''; if (SHOW_COUNTS == 'true') { if ($totalitemsincategory > 0) { $count_string = ' (' . $totalitemsincategory . ')'; } } $i=0; while ($i < $productsDisplay) { $products = tep_db_fetch_array($products_query); $product_query = tep_db_query("select products_name from products_description where products_id = " . $products['products_id'] . " AND language_id = ".$languageID ); $product = tep_db_fetch_array($product_query); $returnval .= "".$product['products_name']."
* \n"; $i++; } if ( $addMore ) { $returnval .= "".$cssMenuConfig['moreText']."
\n"; } if ( $productsDisplay > 0 || !$includeul ) { $returnval .= "

"; } return $returnval; } function PrintSubMenus( $parentID, $languageID, $start_path ){ global $cssMenuConfig, $categories_subs, $categories_start; $returnval = ''; if (($start_path == '') && ($parentID > 0)) { $start_path = $parentID; } else { if ($parentID > 0) $start_path .= "_" . $parentID; } if ($parentID != 0) { $returnval .= "

"; } else { $returnval .= "
"; $returnval .= "
o "; } // $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '".$parentID."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languageID ."' order by sort_order, cd.categories_name"); $cat_subs = array(); foreach($categories_start as $key => $value) { if(strstr($key, '_' . $parentID . '_E')) { $cat_subs[$parentID][] = substr($key, 2, strpos($key, "_", 2) - 2); } } // if (!isset($_GET['cPath'])) { foreach ($cat_subs[$parentID] as $v) { //$categories = tep_db_fetch_array($categories_query) $categories = $categories_start['S_' . $v . '_' . $parentID . '_E']; if ($start_path == "") { $grouppath = $categories['categories_id']; } else { $grouppath = $start_path . "_" . $categories['categories_id']; } $cPath_new = 'cPath=' . $grouppath; $categories_string = tep_href_link(FILENAME_DEFAULT, $cPath_new); $totalitemsincategory = tep_count_products_in_category($categories['categories_id']); $count_string = ''; if ((SHOW_COUNTS == 'true') && ($totalitemsincategory > 0) ){ $count_string = ' (' . $totalitemsincategory . ')'; } if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) { $returnval .= "".$categories['categories_name'].$count_string."\n"; } if (array_key_exists($categories['categories_id'], $categories_subs)) { //tep_has_category_subcategories($categories['categories_id']) $returnval .= PrintSubMenus( $categories['categories_id'], $languageID, $start_path ); if ( $cssMenuConfig['includeProducts'] ) { $returnval .= PrintProducts($categories['categories_id'],$categories_string, false, $languageID); } } else { if ( $cssMenuConfig['includeProducts'] ) { $returnval .= PrintProducts($categories['categories_id'],$categories_string, true, $languageID); } } if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) { $returnval .= "
"; } } // } if ( !$cssMenuConfig['includeProducts'] ) { $returnval .= ""; } if ($parentID == 0) $returnval .= "
"; return $returnval; } function cssMenu_ShowCategory( $switch, $products) { if ( $switch == 1 ) { return true; } else { if ($products > 0) { return true; } else { return false; } } } ?>

Categorias
PHP Fatal error: Call to undefined function PrintSubMenus() in C:\Inetpub\wwwroot\catalog_menu\includes\boxes\categories_css.php on line 318

#222 menelrana

  • Community Member
  • 3 posts
  • Real Name:Joel Garcin
  • Gender:Male
  • Location:Avignon

Posted 17 November 2008, 18:23

View Postavillagra@adinet.com.uy, on Nov 17 2008, 04:41 PM, said:

The error is:

0 ) { $returnval .= "

* "; } if ( $productsDisplay > $cssMenuConfig['maxProductsInMenu'] ) { $productsDisplay=$cssMenuConfig['maxProductsInMenu']; $addMore= true; } $count_string = ''; if (SHOW_COUNTS == 'true') { if ($totalitemsincategory > 0) { $count_string = ' (' . $totalitemsincategory . ')'; } } $i=0; while ($i <

...

PHP Fatal error: Call to undefined function PrintSubMenus() in C:\Inetpub\wwwroot\catalog_menu\includes\boxes\categories_css.php on line 318
I've got the same problem when I run it under php5, on php4 everything works fine, but my knowledge of php is few

Anyone know how to solve this problem under this great contrib ?

#223 avillagra@adinet.com.uy

  • Community Member
  • 2 posts
  • Real Name:Aldo

Posted 18 November 2008, 03:23

This error corrected to:

1. uninstall php 5
2. install XAMPP

then run ok.

View Postavillagra@adinet.com.uy, on Nov 17 2008, 02:41 PM, said:

Hello,

sorry, my english es bad ...

Your contribution es very nice an i try install it, but not run.

First install 1st version of 6 oct 2006 but not run.

After install last version of CSS menu but not run yet.

I follow all steps in the "installation_notes_0.4.1.txt".

Run in IIS PHP and oscommerce-2.2rc2a.

The error is:

0 ) { $returnval .= "

* "; } if ( $productsDisplay > $cssMenuConfig['maxProductsInMenu'] ) { $productsDisplay=$cssMenuConfig['maxProductsInMenu']; $addMore= true; } $count_string = ''; if (SHOW_COUNTS == 'true') { if ($totalitemsincategory > 0) { $count_string = ' (' . $totalitemsincategory . ')'; } } $i=0; while ($i < $productsDisplay) { $products = tep_db_fetch_array($products_query); $product_query = tep_db_query("select products_name from products_description where products_id = " . $products['products_id'] . " AND language_id = ".$languageID ); $product = tep_db_fetch_array($product_query); $returnval .= "".$product['products_name']."
* \n"; $i++; } if ( $addMore ) { $returnval .= "".$cssMenuConfig['moreText']."
\n"; } if ( $productsDisplay > 0 || !$includeul ) { $returnval .= "

"; } return $returnval; } function PrintSubMenus( $parentID, $languageID, $start_path ){ global $cssMenuConfig, $categories_subs, $categories_start; $returnval = ''; if (($start_path == '') && ($parentID > 0)) { $start_path = $parentID; } else { if ($parentID > 0) $start_path .= "_" . $parentID; } if ($parentID != 0) { $returnval .= "

"; } else { $returnval .= "
"; $returnval .= "
o "; } // $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '".$parentID."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languageID ."' order by sort_order, cd.categories_name"); $cat_subs = array(); foreach($categories_start as $key => $value) { if(strstr($key, '_' . $parentID . '_E')) { $cat_subs[$parentID][] = substr($key, 2, strpos($key, "_", 2) - 2); } } // if (!isset($_GET['cPath'])) { foreach ($cat_subs[$parentID] as $v) { //$categories = tep_db_fetch_array($categories_query) $categories = $categories_start['S_' . $v . '_' . $parentID . '_E']; if ($start_path == "") { $grouppath = $categories['categories_id']; } else { $grouppath = $start_path . "_" . $categories['categories_id']; } $cPath_new = 'cPath=' . $grouppath; $categories_string = tep_href_link(FILENAME_DEFAULT, $cPath_new); $totalitemsincategory = tep_count_products_in_category($categories['categories_id']); $count_string = ''; if ((SHOW_COUNTS == 'true') && ($totalitemsincategory > 0) ){ $count_string = ' (' . $totalitemsincategory . ')'; } if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) { $returnval .= "".$categories['categories_name'].$count_string."\n"; } if (array_key_exists($categories['categories_id'], $categories_subs)) { //tep_has_category_subcategories($categories['categories_id']) $returnval .= PrintSubMenus( $categories['categories_id'], $languageID, $start_path ); if ( $cssMenuConfig['includeProducts'] ) { $returnval .= PrintProducts($categories['categories_id'],$categories_string, false, $languageID); } } else { if ( $cssMenuConfig['includeProducts'] ) { $returnval .= PrintProducts($categories['categories_id'],$categories_string, true, $languageID); } } if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) { $returnval .= "
"; } } // } if ( !$cssMenuConfig['includeProducts'] ) { $returnval .= ""; } if ($parentID == 0) $returnval .= "
"; return $returnval; } function cssMenu_ShowCategory( $switch, $products) { if ( $switch == 1 ) { return true; } else { if ($products > 0) { return true; } else { return false; } } } ?>

Categorias
PHP Fatal error: Call to undefined function PrintSubMenus() in C:\Inetpub\wwwroot\catalog_menu\includes\boxes\categories_css.php on line 318


#224 wormington

  • Community Member
  • 81 posts
  • Real Name:Mark Warren

Posted 27 November 2008, 20:21

Can anyone explain why this menu and Dynamenu don't work in Google Chrome and Safari? I've tried everything on the coding side to no effect.

Thanks for an otherwise great contribution.

Mark

#225 SimonWard

  • Community Member
  • 37 posts
  • Real Name:Simon Ward
  • Gender:Male

Posted 02 December 2008, 08:59

Does anyone know how to change the script so that it generates the links required for the categories with https rather than just http...

Its getting quite annoying when i enter the site and i have to click yes or no due to the allow unsecure items.

Cheers

#226 zozzoozzz

  • Community Member
  • 219 posts
  • Real Name:JUN

Posted 27 March 2009, 14:01

I installed the ADD-ON, and I think IT is a great CONTRIBUTION.

BUT I want to konw how to cancel the border and header of the CATAGORIES BOX?

THANKS

#227 trozyiop

  • Community Member
  • 2 posts
  • Real Name:troz yiop

Posted 07 April 2009, 11:56

first of all, thank you for this great contribution.

as a noob I am trying to modify this so that the categories are displayed horizontally. But so far not much of a succes.

So far what I could come up with are getting rid of the listing, so that I can position the categories, but then the hovering does not work, the subcategories are all displayed.

has anyone tried it yet or is possible to help me?


Thanks in advance

Edited by trozyiop, 07 April 2009, 12:00.


#228 trozyiop

  • Community Member
  • 2 posts
  • Real Name:troz yiop

Posted 07 April 2009, 14:57

View Posttrozyiop, on Apr 7 2009, 01:56 PM, said:

first of all, thank you for this great contribution.

as a noob I am trying to modify this so that the categories are displayed horizontally. But so far not much of a succes.

So far what I could come up with are getting rid of the listing, so that I can position the categories, but then the hovering does not work, the subcategories are all displayed.

has anyone tried it yet or is possible to help me?


Thanks in advance

because I cannot edit my own post I'm posting a reply:

what I did was catch up some reading about css and I changed the 'display:none' to 'display:inline' what should do the trick and set the menu to horizontal, but for some reason the top categories do not move to one line.

help?

#229 Cyburg

  • Community Member
  • 67 posts
  • Real Name:Paul Burgess
  • Gender:Male
  • Location:Leicester

Posted 11 May 2009, 16:01

Hi all,

Hope someone can help me; if I wanted to restrict this contribution, so that the menu only displayed items from a single parent category, how would I do that? I have tried editing the second SQL statement in the categories_css.php file to limit the records that are returned to only a single parent category; however, when I view the page, I get the following error:

"Warning: Invalid argument supplied for foreach() in /home/galaxi/public_html/cat_css_test.php on line 143"


Cheers,
Paul

#230 Cyburg

  • Community Member
  • 67 posts
  • Real Name:Paul Burgess
  • Gender:Male
  • Location:Leicester

Posted 12 May 2009, 13:15

Hi again,

I have changed the two queries that appear at the top of the categories_css.php file to read as follows:
$categories_subs_query = tep_db_query("select count(*) as count, c.parent_id from " . TABLE_CATEGORIES . " c where " . $categories_to_process . " GROUP BY c.parent_id");

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' and " . $categories_to_process . " order by sort_order, cd.categories_name");

The variable $categories_to_process contains a string of SQL which limits the categories that are returned by the queries:
$categories_to_process = "c.categories_id = '27' or c.categories_id = '87' or c.categories_id = '84'";

After making these changes, the structure of the menu that I get returned is as expected; all of the links in the menu work as expected, and if I choose to display products, the correct products are displayed within categories which contain them. Here's the odd thing: When I limit the categories that are returned in this way, all of the category names which fall below the top level of my category/subcategory hierarchy are being given the same display name.

For example, in the image below, all of the second level categories have been given the name "Used Telegraph Poles" when in fact neither of these two product categories are called "Used Telegraph Poles"; however, as explained above, the links actually work as expected, taking you to the correct category listing page when clicked.

[img]http://www.lpgdirectltd.org.uk/categories_css.jpg[/img]

Could anyone that knows this code well, please point me in the right direction to get the correct names assigned to the list items; I am modifying this contribution, in order to produce another contribution which will allow the admin to create multiple category infoboxes, which I will release to the community (the contribution will be compatible with the Infobox Admin contribution #1175).

Cheers,
Paul

#231 Cyburg

  • Community Member
  • 67 posts
  • Real Name:Paul Burgess
  • Gender:Male
  • Location:Leicester

Posted 12 May 2009, 13:34

SOLVED; expect to see my contribution released soon™!!!!

Cheers,
Paul

#232 whpash

  • Community Member
  • 6 posts
  • Real Name:Matt
  • Gender:Male
  • Location:Switzerland

Posted 07 June 2009, 11:03

Hello,

I installed the latest contribution for CSS menu, and it works as anticipated....on all pages except for the main page (front page)...

I have removed "top" from my breadcrumbs...so when I go to the top level.."catalog"...the categories infobox with the css menu shows this error:

Quote

Notice: Undefined variable: foo in /mnt/w0308/d35/s40/b01a9a05/www/warmheartpashmina.com/catalog/includes/boxes/categories.php on line 90

I can find line 90 in the file specified, and see the foo variable...but do not know why the error is occuring...the menu works normally on all the other pages of the site...

Any one have some ideas?
http://www.warmheartpashmina.com/catalog

Thanks,

Matt

#233 tpp

  • Community Member
  • 6 posts
  • Real Name:Martin

Posted 26 June 2009, 13:00

Hi All,

Does anyone know how to limit the category depths displayed?

eg:

Main Categories> Sub Category1> Sub Category2

I have a Sub Category3 and 4 for some items but I don't want to be able to drill down to these categories in the css menu.


Any help on this would be much appreciated.

Thanks, Martin

#234 Gazonice

  • Community Member
  • 91 posts
  • Real Name:Garry
  • Gender:Male
  • Location:Bradford, UK

Posted 05 November 2009, 16:23

Hi,

I would like to split the sort orders on the menu so that the Top Level Categories sort alphabetically, but the Sub Categories sort by sort_order.

Does anyone know how I would achieve this?

Many Thanks,

Garry
Garry

#235 TheBeginner

  • Community Member
  • 3 posts
  • Real Name:Rabia

Posted 04 February 2010, 16:17

Hi,

I installed the CSS Menu successfully... Very nice and easy... what I was looking for....
... no errors but a strange problem...
The menu displays fine on the home page but there are three links BOX_INFORMATION_ALLPRODS, BOX_SPECIALS_ALLPRODS, BOX_WHATSNEW_ALLPRODS under the menu. When I click on any link in the css Menu, the oscommerce default menu appears again...
Made all the required chanhges to the files as per the documentation....

any help???

Edited by TheBeginner, 04 February 2010, 16:18.


#236 vescera

  • Community Member
  • 1 posts
  • Real Name:Michael

Posted 01 March 2010, 13:37

View Postzozzoozzz, on 27 March 2009, 14:01, said:

I installed the ADD-ON, and I think IT is a great CONTRIBUTION.

BUT I want to konw how to cancel the border and header of the CATAGORIES BOX?

THANKS

Same here css menu is great but I cant cancel white border around categories box there is no setings in css to change this?

#237 Dandon

  • Community Member
  • 24 posts
  • Real Name:Daniel Donate
  • Gender:Male
  • Location:Madrid, Spain

Posted 10 March 2010, 16:32

View PostTheBeginner, on 04 February 2010, 16:17, said:

Hi,

I installed the CSS Menu successfully... Very nice and easy... what I was looking for....
... no errors but a strange problem...
The menu displays fine on the home page but there are three links BOX_INFORMATION_ALLPRODS, BOX_SPECIALS_ALLPRODS, BOX_WHATSNEW_ALLPRODS under the menu. When I click on any link in the css Menu, the oscommerce default menu appears again...
Made all the required chanhges to the files as per the documentation....

any help???

Hi,

I just installed CSS Menu and had the same problems, but version 0.3 works fine. You can see it here. V 0_4 and 0_4_1 both give errors. Also, on localhost with XAMPP and PHP 5.3.1 it doesn't work, but it does on my online store.

#238 Dandon

  • Community Member
  • 24 posts
  • Real Name:Daniel Donate
  • Gender:Male
  • Location:Madrid, Spain

Posted 10 March 2010, 18:14

View PostTheBeginner, on 04 February 2010, 16:17, said:

Hi,

I installed the CSS Menu successfully... Very nice and easy... what I was looking for....
... no errors but a strange problem...
The menu displays fine on the home page but there are three links BOX_INFORMATION_ALLPRODS, BOX_SPECIALS_ALLPRODS, BOX_WHATSNEW_ALLPRODS under the menu. When I click on any link in the css Menu, the oscommerce default menu appears again...
Made all the required chanhges to the files as per the documentation....

any help???

I have just found how to solve this issue, I also had that problem with 0_4_1.
Edit the categories_css.php file. Go to the PHP section at the end of the file:

Quote

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

new infoBoxHeading($info_box_contents, true, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => PrintSubMenus( 0, $languages_id, '' ));
$info_box_contents[] = array('align' => 'center',
'text' => '<a href="' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLPRODS . '</a>');
$info_box_contents[] = array('align' => 'center',
'text' => '<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '">' . BOX_SPECIALS_ALLPRODS . '</a>');
$info_box_contents[] = array('align' => 'center',
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . BOX_WHATSNEW_ALLPRODS .'</a>');

new infoBox($info_box_contents);

?>
</td>
</tr>
<!-- MenuConfigategories_eof //-->

DELETE the red highlighted part. Now it should look like this:

Quote

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

new infoBoxHeading($info_box_contents, true, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => PrintSubMenus( 0, $languages_id, '' ));

new infoBox($info_box_contents);

?>
</td>
</tr>
<!-- MenuConfigategories_eof //-->

The menu now looks and works OK.

#239 Dandon

  • Community Member
  • 24 posts
  • Real Name:Daniel Donate
  • Gender:Male
  • Location:Madrid, Spain

Posted 12 March 2010, 12:47

Hi,
I have found a tiny glitch that is causing trouble with CSS Menu 0_4_1. When I browse the categories from a main or subcategory page, e.g. My store front, it works fine. But if I'm on a product info page (e.g This product, there are small gaps between the categories and products in the drop down menu. This causes the menu to close when the mouse cursor goes over the gaps. Can you help me to solve this?

#240 Dandon

  • Community Member
  • 24 posts
  • Real Name:Daniel Donate
  • Gender:Male
  • Location:Madrid, Spain

Posted 12 March 2010, 14:41

View PostDandon, on 12 March 2010, 12:47, said:

Hi,
I have found a tiny glitch ...

Problem solved, it wasn't a CSS menu issue, but a small problem with Simple Multiple Images Add-on and inconsistent Doctype defs.