Zurück   xt:Commerce Webshop Shop Support > xt:Commerce Shopsoftware Community Area > Shopbereich

Antwort
 
LinkBack Themen-Optionen Ansicht
  #1 (permalink)  
Alt 30.08.2008, 14:25
Benutzer
 
Registriert seit: 10.11.2006
Beiträge: 11
Standard hersteller dropdown durch liste ersetzen - product-listing

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:

Code:
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:

Code:
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
dropdown, ersetzen, hersteller, liste, productlisting

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Kategorie Dropdown nach Hersteller Dropdown mbdesign Shopbereich 0 21.01.2007 18:42


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:24 Uhr.

Copyright © 2011 xt:Commerce GmbH / xt:Commerce International Ltd. - All Rights Reserved

xt:Commerce is a SafeCharge brand