#1 (permalink)  
Alt 22.04.2004, 22:30
nom nom ist offline
 
Registriert seit: 19.02.2004
Beiträge: 596
Standard

Hallo,

brauche Rat, wie kann man Produkte nach Preis sortieren mit Dropdownmenu? Habe folgendes:

default.php
Code:
  // optional Product List Filter Price
  if (PRODUCT_LIST_FILTER > 0) {
   if (isset($_GET['products_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.products_id = '" . (int)$_GET['products_id'] . "' order by cd.products_price";
   } else {
    $filterlist_sql = "select distinct m.products_id as id, m.products_price as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_PRODUCTS . " m where p.products_status = '1' and p.products_id = m.products_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by m.products_price";
   }
   $filterlist_query = xtc_db_query($filterlist_sql);
   if (xtc_db_num_rows($filterlist_query) > 1) {
    $price_dropdown= xtc_draw_form('filter', FILENAME_DEFAULT, 'GET') .'';
    if (isset($_GET['products_id'])) {
     $price_dropdown.= xtc_draw_hidden_field('products_id', $_GET['products_id']);
     $options = array(array('text' => TEXT_ALL_CATEGORIES));
    } else {
     $price_dropdown.= xtc_draw_hidden_field('cPath', $cPath);
     $options = array(array('text' => TEXT_AUFSTEIGEND));
    }
    $price_dropdown.= xtc_draw_hidden_field('sort', $_GET['sort']);
    while ($filterlist = xtc_db_fetch_array($filterlist_query)) {
     $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
    }
    $price_dropdown.= xtc_draw_pull_down_menu('filter_id', $options, $_GET['filter_id'], 'onchange="this.form.submit()"');
    $price_dropdown.= '</form>' . "\n";
   }
  }
Habe das Menu aber mit Preisen drin.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
absteigend, aufsteigend, sortieren

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



Alle Zeitangaben in WEZ +1. Es ist jetzt 07:59 Uhr.

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

xt:Commerce is a SafeCharge brand