francosdad Posted August 30, 2008 Report Share Posted August 30, 2008 hallo, ich habe ein großes problem, denn ich möchte gern, dass die hersteller auf der productlisting seite nicht als dropdown sondern als liste ausgegeben werde, die ich mir selbst formatieren kann. in der default.php wird das dropdown menu wie folgt erzeugt: if (PRODUCT_LIST_FILTER > 0) { if (isset ($_GET['manufacturers_id'])) { $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '".(int) $_SESSION['languages_id']."' and p.manufacturers_id = '".(int) $_GET['manufacturers_id']."' order by cd.categories_name"; } else { $filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_MANUFACTURERS." m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '".$current_category_id."' order by m.manufacturers_name"; } $filterlist_query = xtDBquery($filterlist_sql); if (xtc_db_num_rows($filterlist_query, true) > 1) { $manufacturer_dropdown = xtc_draw_form('filter', FILENAME_DEFAULT, 'get'); if (isset ($_GET['manufacturers_id'])) { $manufacturer_dropdown .= xtc_draw_hidden_field('manufacturers_id', (int)$_GET['manufacturers_id']); $options = array (array ('text' => TEXT_ALL_CATEGORIES)); } else { $manufacturer_dropdown .= xtc_draw_hidden_field('cat', $_GET['cat']); $options = array (array ('text' => TEXT_ALL_MANUFACTURERS)); } $manufacturer_dropdown .= xtc_draw_hidden_field('sort', $_GET['sort']); $manufacturer_dropdown .= xtc_draw_hidden_field(xtc_session_name(), xtc_session_id()); while ($filterlist = xtc_db_fetch_array($filterlist_query, true)) { $options[] = array ('id' => $filterlist['id'], 'text' => $filterlist['name']); } $manufacturer_dropdown .= xtc_draw_pull_down_menu('filter_id', $options, $_GET['filter_id'], 'onchange="this.form.submit()"'); $manufacturer_dropdown .= '</form>'."\n"; } } ich habe nun schon versucht das als ganz normale <a href> links auszugeben, das sieht dann wie folgt aus: if (PRODUCT_LIST_FILTER > 0) { if (isset ($_GET['manufacturers_id'])) { $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '".(int) $_SESSION['languages_id']."' and p.manufacturers_id = '".(int) $_GET['manufacturers_id']."' order by cd.categories_name"; } else { $filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_MANUFACTURERS." m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '".$current_category_id."' order by m.manufacturers_name"; } $filterlist_query = xtDBquery($filterlist_sql); if (xtc_db_num_rows($filterlist_query, true) > 1) { //$manufacturer_dropdown = xtc_draw_form('filter', FILENAME_DEFAULT, 'get'); if (isset ($_GET['manufacturers_id'])) { $manufacturer_dropdown_manu .= ('manufacturers_id'. (int)$_GET['manufacturers_id'].'&'); $options = array (array ('text' => TEXT_ALL_CATEGORIES)); } else { $manufacturer_dropdown_cat .= ('cat'. $_GET['cat']); $options = array (array ('text' => TEXT_ALL_MANUFACTURERS)); } $manufacturer_dropdown_sort .= ('sort'. $_GET['sort']); $manufacturer_dropdown_session .= (xtc_session_name(). xtc_session_id()); while ($filterlist = xtc_db_fetch_array($filterlist_query, true)) { $options[] = array ('id' => $filterlist['id'], 'text' => $filterlist['name']); } $manufacturer_dropdown .= '<a href="'.xtc_href_link(FILENAME_DEFAULT, $manufacturer_dropdown_manu.$manufacturer_dropdown_cat.'&'.$manufacturer_dropdown_sort.'&'.$manufacturer_dropdown_session.'&'.'filter_id='.$filterlist['id']).'">'.$options['text'].'</a>'; //$manufacturer_dropdown .= '</form>'."\n"; } } aber das funktioniert nicht so richtig, da entweder nur ARRAY ausgegeben wird oder gar nichts. bitte, bitte helft mir, ich bin schon völlig an verzweifeln. ich habe das auch schon mit dem code aus der box-hersteller versucht, was auch funktioniert hat, jedoch wenn ich eine hersteller angeklickt habe, dann hat er danach alle angezeigt, auch die die keine produkte in der gewählten kategorie haben. es ist zum mäuse melken. danke schon mal im voraus. beste grüsse francosdad Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.