Advanced Article Search

Inhaltsverzeichnis

Introduction

Introduction

The Advanced Article Search is a PepperShop module that can dynamically use various restriction criteria and independently presents information filled in dropdowns for selection.

Module Structure

[shop/config.inc.php] (Activation)
 shop/advancedsuche.php
 shop/suchresultat_modul.def.php
 shop/language/html_templates/advancedsuche.tpl.html

Display: The associated template can be found in the file advancedsuche.tpl.html in the HTML templates.

Logic: The implementation of the Advanced Search can be found in the file advancedsuche.php. This file is included in USER_ARTIKEL_HANDLING_AUFRUF.php. The file suchresultat_modul.def.php enables various additional operations on the search result display (sorting, …). This file does not need to be configured. Activation: The Advanced Search is only used when it is adequately activated in config.inc.php. For more details, see the Activation chapter.

Which Advanced Search module version is compatible with which PepperShop version can be found at the very bottom in the History display.

Definition and Use of Advanced Article Search

You define in the file shop/advancedsuche.php in the function get_advanced_suche_config() the fields by which the search should be restricted. There are two categories of fields: Category-DB fields and Article-DB fields. The category DB fields should be arranged at the beginning if possible, directly after the category tree fields (Main cat. / Sub cat.). The first field lists all possibilities including comments on the individual field components. Depending on the field type (dropdown, string, …), specific data can be specified in the field component ‘options’.

Localization

So that the identifiers before the fields can be displayed localized, labels are used. These labels must now be inserted in the corresponding translation files (shop/language/xy/localetext.inc.php) and the respective translated term defined. If the shop does not find a translated term, it displays the term specified here in the label instead.

Installation / Activation

To activate the Advanced Article Search, you must assign the name of this file as the value to the constant with the designation FILENAME_ADVANCED_SEARCH in the file shop/config.inc.php (constant definitions) (Default: advancedsuche.php). This file must be copied to the {shop_root}/shop directory and the template file advancedsuche.tpl.html to the shop/language/html_templates directory. Only now is the Advanced Article Search recognized and used by the shop. The standard PepperShop article search is no longer used. In the administration area → ‘View Shop Configuration’ you can now see the integrated search module including version display after the constant definitions.

Technical Integration

  • Activation via constant in config.inc.php (for more details, see Activation chapter)
  • Search query mask: Logic → advancedsuche.php, Display: advancedsuche.tpl.php
  • Integration of Advanced Search: shop/USER_ARTIKEL_HANDLING_AUFRUF.php, darstellen == 3 and darstellen == 30 (Search mask / Search run + Search result display)
  • The Advanced Article Search goes through the same USER_ARTIKEL_HANDLING_AUFRUF.php darstellen area and is included and used there as needed, even the result presentation is the same as with the standard article search

Customizing

The adjustments for a respective customer are made exclusively in the file advancedsuche.php. Here you edit the elements of the search mask to be displayed in the first function: get_advanced_suche_config(). There are global settings in this function that are independent of individually displayed elements and there are the individually described elements of the search mask. To simplify the implementation, you should definitely have read the Tips chapter below (see further below, after the examples).

Actually it’s quite simple. You simply set the required elements in the existing array $adv_config['adv_felder'] that should be displayed in the Advanced Search mask and specify for each element what its data basis is, how it should look and what it should be called - this is roughly the overview of what needs to be done. Changes of this kind should be able to satisfy 80%-90% of all requirements.

The customizing of the global parameters $adv_config['adv_global'] is not further discussed here. In the source code there is an info comment for each.

Display Additional Field as Dropdown (Simple Example)

Most of the time, only one article additional field needs to be displayed as a dropdown. A possible implementation can be seen in the following small example from an existing project:

$adv_config['adv_felder'][0] = array('label'    => 'artikel_zusatzfeld1',// in jeder localetext.inc.php übersetzen
                                      'var_name'  => 'weintyp',// Name der Variable, die ueber POST uebertragen wird
                                      'feldnamen' => LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_1', // Name des Datenbankfeldes (fuer Einschraenkung)
                                     'tabelle'   => 'artikel', // Name der Tabelle wo das DB-Feld vorkommt
                                     'typ'       => 'dropdown',// Darstellungsart = dropdown
                                     'options'   => array('dropdown_parent' => -1, // Parent-Dropdown bei verschachtelten Dropdown-Typen (-1 = deaktiviert)
                                                          'feldnamen_auslesen' => LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_1',// Feldname in der Tabelle, welche als Option-Tag Label angezeigt werden
                                                          'feldnamen_einschraenkung' => LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_1', // Feldname der bei den Einschränkungen als Vergleich benutzt wird
                                                          'einschraenkungen'=>LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_1 != \'\''// SQL-Einschraenkungen, hier damit keine Leereinträge zur Auswahl angezeigt werden
                                                         ),
                                    );

Display Types

The following display types (elements) exist, which can be queried and processed as a search input parameter of a shop customer in the form of a field configuration.

  • Text input (string)
  • Boolean operator (boolean)
  • Interval specifications (von_bis)
  • Not older than (datetime)
  • Sorting (order)
  • Dropdown selection (dropdown)

Possibilities (Demo Entry)

What is all possible? → There is a commented out array entry ($adv_config['adv_felder'][0]) at the beginning of the function get_advanced_suche_config(). This entry explains all possibilities that exist in the currently used Advanced Search version:

    // Demofeld → Nach Auskommentieren unbedingt die Nummerierung des adv_felder-Keys korrigieren
    $adv_config['adv_felder'][0] = array('label' => 'neues_feld', // Label, das angezeigt wird, sollte in jeder localetext.inc.php übersetzen worden sein (hier angegebener Wert = key im Array in localetext.inc.php)
                                         'var_name' => 'neues_feld', // Name der Variable, die ueber POST übertragen wird, damit man beim Debugging weiss, um was es sich handelt
                                         'feldnamen' => 'neues_feld', // Name des Datenbankfeldes (Datenbasis eines Dropdowns und /oder Vergleichskriterium bei Suchdurchfuehrung), ACHTUNG: Bei LANGUAGE_DB_FIELD_MODE Mehrsprachigkeit, muss man hier die Konstante LANGUAGE_DB_FIELD_MODE_PREFIX vor dem Feldnamen anfuegen!
                                         'tabelle' => 'artikel', // Name der Tabelle wo das DB-Feld vorkommt (artikel oder kategorien)
                                         'typ' => 'string', // string | dropdown | boolean | von_bis | von_bis_felder | datetime | order (→ Art der Darstellung eines Suchmaskenelements)
                                         'options'   => array('value' => '',// string: Vorausgefuellter Wert eines String-Typs
                                                              'size' => 20, // string:   Laenge des Texteingabefelds
                                                              'maxlength' => 255, // string:   Max. Textlaenge der Kundeneingaben (Texteingabefeld)
                                                              'boolean_checked' => true, // boolean:  Def. ob die Boolean-Checkbox vorausgewaehlt sein soll
                                                              'boolean_true' => '= \'Y\'',  // boolean:  Defaultwert von true bei Boolean-Typen (Operator plus Wert)
                                                              'label_danach' => 'Zusatzinfos...', // boolean:  Text, der rechts neben der Checkbox dargestellt wird. Falls es ein Label in der aktuellen Uebersetzungsdatei gibt, welches strtolower() dem angegebenen Text entspricht, wird der uebersetzte Text angezeigt. Es wird html_coding::htmlentities() angewendet.
                                                              'von' => 150, // von_bis:  Beim Typ von_bis, ab welchem Wert (Voreinstellung)
                                                              'bis' => 990, // von_bis:  Beim Typ von_bis, bis zu welchem Wert (Voreinstellung)
                                                              'datetime_values' => array('1 Woche' => 7), // datetime: Hier wird dem Shopkunden ein Dropdown mit den hier angegebenen Werten als Sucheinschraenkung angeboten. Die Werte werden als Array key=>value Paerchen uebergeben. Dabei wird als Key jeweils ein Label uebergeben, z.B. 1 Woche und als value der Wert in Tagen (7) als Integerwert. Das angegebene Label wird in der Uebersetzungsdatei gesucht, falls nicht vorhanden wird der hier angegebene Wert angezeigt. Fuer Werte: Siehe auch Beispiel weiter unten...
                                                              'order_values' => array('label'=>LANGUAGE_DB_FIELD_MODE_PREFIX.'feldname'), // order:    Hierbei werden zwei Dropdowns erstellt. Im ersten werden mit Labels angezeigt, nach welchen Feldern die Suchausgabe sortiert ausgegeben werden kann. Die Feldangaben sollten immer einen Tabellennamenprefix haben: a. fuer Tabelle artikel, ak. fuer Tabelle artikel_kategorie, k. fuer Tabelle kategorie, da es sonst unter Umstaenden zu einem ambigues field SQL-Fehler kommen kann. Im zweiten Dropdown kann man auf- oder absteigend waehlen. (Bei Feldnamen LANGUAGE_DB_FIELD_MODE_PREFIX nicht vergessen!)
                                                              'dropdown_parent'  => -1,                                                   // dropdown: Parent-Dropdown bei verschachtelten Dropdown-Typen (-1, wenn es keine Abhängigkeiten gibt, ansonsten wird hier die Feld-Nr. des Suchelements angegeben, von dessen Werten dieses Dropdown abhängt)
                                                              'dropdown_reload'  => true,                                                 // dropdown: Wenn Dropdowns miteinander verknuepft sind (dropdown_parent), so ist es oft sinnvoll, wenn nach dem Aendern eines Wertes gleich ein Reload geschieht, so dass die abhaengigen Dropdowns gleich mit weiteren Einschraenkungskriterien neu geladen werden. Hier kann man dieses Verhalten steuern: true = sofort nach jeder Aenderung neu nachladen, false = nicht nachladen (Default ist true). Diese Einstellung kann auch fuer den Typ datetime verwendet werden.
                                                              'dropdown_order'   => LANGUAGE_DB_FIELD_MODE_PREFIX.'neues_feld ASC',       // dropdown: Feldnamen fuer die Sortierung der Werte im Dropdown, die den globalen Wert dropdown_order und das Sortierfeld neues_fled ueberschreibt
                                                              'feldnamen_auslesen' => LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_1',       // dropdown: Feldname in der Tabelle, welche als Option-Tag Label angezeigt werden
                                                              'feldnamen_einschraenkung' => LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_1', // dropdown: Feldname der bei den Einschraenkungen als Vergleich benutzt wird (String) oder als Array (Key: Feld-Nr, Value: Name des Einschraenkungsfeldes (pro Dropdown einstellbar)). Wenn der Wert '*none*' angegeben wird, so wird die Einschraenkung fuer das Dropdown mit der angegebenen Feld-Nr. nicht mehr verwendet!
                                                              'einschraenkungen' =>'',                                                    // dropdown: Ev. gibt es noch SQL-Einschraenkungen... (Beispiel: Siehe Demo-Implemenentierungen Felder 0-2), Achtung: Werte hier muessen schon geaddslashed angegeben werden.
                                                              'dropdown_ignore_if_parent_value_set' => false,                             // dropdown: Moegliche Werte: true|false: Wenn dieses Flag auf true gesetzt wird, ignoriert dieses Feld, ob der Parent zuvor in der Suchmaske ausgewaehlt worden ist. Das Dropdown wird dann somit nicht disabled.
                                                              'dropdown_decode_values'=>'',                                               // dropdown: Wenn pro ausgelesenes Feld mehrere zu decodierende Werte enhalten sind, so wird hier die Methode der Dekodierung angegeben oder ein Zeichen, welches als Wertedelimiter gilt. ACHTUNG: Wenn dieses Element benutzt wird, generiert die Suche SQL-Elemente mit LIKE '%string%'
                                                              'dropdown_sort_decode_values'=>'',                                          // dropdown: Wenn pro ausgelesenes Feld mehrere zu decodierende Werte enhalten sind, kann hier eine PHP-Arraysortierungsfunktion angegeben werden um die neu erfassten Daten zu sortieren. Diese Einstellung macht nur in Zusammenhang mit dropdown_decode_values Sinn. Beispielfunktionen: natsort, natcasesort, sort, rsort
                                                              'dropdown_filters' =>'',                                                    // dropdown: Wenn die Dropdown-Werte vor der Verwendung und Anzeige gefiltert werden sollen, kann man hier Komma-separiert die Filter-Funktionsnamen angeben (z.B. trim,strtoupper - bitte kein Komma am Ende stehen lassen!). ACHTUNG: Wenn dieses Element benutzt wird, generiert die Suche SQL-Elemente mit LIKE '%string%'
                                                              'dropdown_width'   =>'800px',                                               // dropdown: Angabe der fixen Breite eines Dropdowns. Der Wert wird als CSS-Styleangabe verarbeitet
                                                              'dropdown_additional_values'=> array(array('label'=>'label1','value'=>'value1'),array('label'=>'label2','value'=>'value2'),array('label'=>'label_n','value'=>'value_n')), // dropdown: Vordefinierte, zusaeztliche Werte (je ein Label und ein Wert) definieren. Diese ergaenzen das Set der ausgelesenen Werte und koennen mit SQL-Like Operationen zusaetzliche Auswahlmoeglichkeiten erschaffen, welche mit direkten Werten nicht so einfach moeglich sind, z.B. alle Werte mit Zeichenfolge xyz => %xyz%. Wenn das Label als key eines Uebersetzten Wertes in localetext.inc.php vorhanden ist, wird der uebersetzte Wert angezeigt.
                                                              'feldnamen_bis'    => LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_1',         // von_bis_felder: Feldnamen fuer den Maximalwert auf den die Abfrage geprueft wird
                                                              'string_cmp_op'    => 'LIKE',                                                // string:   Welcher Vergleichsoperator soll verwendet werden? LIKE oder der = Operator?
                                                              'string_like_pattern'=> '%{string}%',                                        // string:   Falls der string_cmp_op = LIKE ist, kann man hier noch optional ein Pattern definieren, welches eine unscharfe Suche erlaubt. Das %-Zeichen steht fuer alle moeglichen Zeichen vor / nach dem Suchtstring ({string}).
                                                             ), // Optionen
                                        );

Some option settings only apply in connection with the selected type (typ). You must always read the comment behind the option to understand its meaning correctly.

Demo Implementations / Ready Examples

The following examples help to visualize more complex relationships.

  • The first fields show interdependent dropdowns (see also option dropdown_parent):

    • Fields 0 to 2: Main categories → Sub categories → Groupings
  • Field No. 3 shows how easy it is to implement a restrictive price search (price from-to)

  • Fields 4, 5 and 6 show the display of boolean checkboxes including definition of the true state

  • In field 7 we see a dropdown menu that accesses the data stock of an article additional field and decodes comma-separated values there and displays them for selection

  • In field 8 there is an example for an ‘Article is in shop since’ query

  • In field 9 you can see a sorting display. In addition to the display in the input mask, it can be specified via global control parameter order_in_results whether the sorting can also be changed in the search result display (recommended)

    $adv_config['adv_felder'][0] = array('label'    => 'Hauptkategorie',
                                        'var_name'  => 'hkat_Name',
                                        'feldnamen' => 'Kategorie_ID',
                                        'tabelle'   => 'kategorien',
                                        'typ'       => 'dropdown',
                                        'options'   => array('value'           => '',
                                                             'dropdown_parent' => -1, // Parent-Dropdown bei verschachtelten Dropdown-Typen
                                                             'feldnamen_auslesen' => LANGUAGE_DB_FIELD_MODE_PREFIX.'name', // Feldname in der Tabelle, welche als Option-Tag Label angezeigt werden
                                                             'feldnamen_einschraenkung' => array(1=>'Parent_ID',2=>'*none*'), // Feld-Nr → Name des Einschraenkungsfeldes (pro Dropdown einstellbar)
                                                             'einschraenkungen'=>'kategorien.Parent_ID = 0' // Bei Dropdown: Ev. gibt es noch SQL-Einschraenkungen...
                                                            ),
                                       );

    $adv_config['adv_felder'][1] = array('label'    => 'Unterkategorie 1',
                                        'var_name'  => 'ukat1_Name',
                                        'feldnamen' => 'Kategorie_ID',
                                        'tabelle'   => 'kategorien',
                                        'typ'       => 'dropdown',
                                        'options'   => array('value'           => '',
                                                             'dropdown_parent' => 0,   // Parent-Dropdown bei verschachtelten Dropdown-Typen
                                                             'feldnamen_auslesen' => LANGUAGE_DB_FIELD_MODE_PREFIX.'name', // Feldname in der Tabelle, welche als Option-Tag Label angezeigt werden
                                                             'feldnamen_einschraenkung' => array(2=>'Parent_ID'), // Feld-Nr → Name des Einschraenkungsfeldes (pro Dropdown einstellbar)
                                                             'einschraenkungen'=>'kategorien.Parent_ID > 0', // Bei Dropdown: Ev. gibt es noch SQL-Einschraenkungen...
                                                            ),
                                       );

    $adv_config['adv_felder'][2] = array('label'    => 'Unterkategorie 2',
                                        'var_name'  => 'ukat2_Name',
                                        'feldnamen' => 'Kategorie_ID',
                                        'tabelle'   => 'kategorien',
                                        'typ'       => 'dropdown',
                                        'options'   => array('value'           => '',
                                                             'dropdown_parent' => 1,   // Parent-Dropdown bei verschachtelten Dropdown-Typen
                                                             'feldnamen_auslesen' => LANGUAGE_DB_FIELD_MODE_PREFIX.'name', // Feldname in der Tabelle, welche als Option-Tag Label angezeigt werden
                                                             'einschraenkungen'=>'kategorien.Parent_ID > 0', // Bei Dropdown: Ev. gibt es noch SQL-Einschraenkungen...
                                                            ),
                                       );

    $adv_config['adv_felder'][3] = array('label'    => 'preis',
                                        'var_name'  => 'preis',
                                        'feldnamen' => 'Preis',
                                        'tabelle'   => 'artikel',
                                        'typ'       => 'von_bis',
                                        'options'   => array('value'           => '',
                                                             'von'             => 0, // Beim Typ von_bis, ab welchem Wert
                                                             'bis'             => 0, // Beim Typ von_bis, bis zu welchem Wert
                                                             'size'            => 9, // Laenge des Texteingabefelds
                                                             'maxlength'       => 9, // Max. Textlaenge der Kundeneingaben (Texteingabefeld)
                                                            ),
                                       );

    $adv_config['adv_felder'][4] = array('label'    => 'promo',
                                        'var_name'  => 'promo',
                                        'feldnamen' => 'promo',
                                        'tabelle'   => 'artikel',
                                        'typ'       => 'boolean',
                                        'options'   => array('value'           => '',
                                                             'boolean_checked' => false,     // Def. ob die Boolean-Checkbox vorausgewaehlt sein soll
                                                             'boolean_true'    => '= \'Y\'', // Def. von true bei Boolean-Typen
                                                            ),
                                       );

    $adv_config['adv_felder'][5] = array('label'    => 'knallerangebot',
                                        'var_name'  => 'knallerangebot',
                                        'feldnamen' => LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_4',
                                        'tabelle'   => 'artikel',
                                        'typ'       => 'string',
                                        'options'   => array('value'     => '',
                                                             'size'      => 16,
                                                             'maxlength' => 255
                                                            ),
                                       );

    $adv_config['adv_felder'][6] = array('label'    => 'ab_lager_lieferbar',
                                        'var_name'  => 'ab_lager_lieferbar',
                                        'feldnamen' => 'Lagerbestand',
                                        'tabelle'   => 'artikel',
                                        'typ'       => 'boolean',
                                        'options'   => array('value'           => '',
                                                             'boolean_checked' => false, // Def. ob die Boolean-Checkbox vorausgewaehlt sein soll
                                                             'boolean_true'    => '> 0',  // Def. von true bei Boolean-Typen
                                                            ),
                                       );

    $adv_config['adv_felder'][7] = array('label'    => 'farbe',
                                        'var_name'  => 'farbe',
                                        'feldnamen' => LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_8',
                                        'tabelle'   => 'artikel',
                                        'typ'       => 'dropdown',
                                        'options'   => array('value'           => '',
                                                             'dropdown_parent' => -1, // Parent-Dropdown bei verschachtelten Dropdown-Typen
                                                             'dropdown_reload' => false, // Nicht nach jeder Aenderung der Auswahl im Dropdown durch den Shopkunden sofort die Suchmaske neu nachladen
                                                             'einschraenkungen'=> LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_8 <> \'\'',
                                                             'dropdown_decode_values'=>',',
                                                             'dropdown_sort_decode_values'=>'sort',
                                                             'dropdown_filters'=> 'trim'
                                                            ),
                                       );

    $adv_config['adv_felder'][8] = array('label'    => 'Im Shop seit',
                                        'var_name'  => 'datum',
                                        'feldnamen' => 'erstellt',
                                        'tabelle'   => 'artikel',
                                        'typ'       => 'datetime',
                                        'options'   => array('value'           => '', // Vorausgewaehltes Element
                                                             'datetime_values' => array('egal'=>-1,'heute'=>0,'gestern'=>1,'1 '.£('woche')=>7,'2 '.£('wochen')=>14,'3 '.£('wochen')=>21,'1 '.£('monat')=>30,'6 '.£('monate')=>180,'1 '.£('jahr')=>365), // Label (wird uebersetzt) und Anzahl Tage in der Vergangenheit
                                                             'dropdown_reload' => false, // Nicht nach jeder Aenderung der Auswahl im Dropdown durch den Shopkunden sofort die Suchmaske neu nachladen
                                                            ),
                                       );

    $adv_config['adv_felder'][9] = array('label'    => 'sortierung',
                                        'var_name'  => 'order',
                                        'typ'       => 'order',
                                        'options'   => array('value'           => '', // Vorausgewaehltes Element
                                                             'order_values'    => array('artikelname'=>'a.'.LANGUAGE_DB_FIELD_MODE_PREFIX.'Name','preis'=>'a.Preis','artikel_zusatzfeld1'=>'a.'.LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_1'), // Label (wird uebersetzt) und Feldname inkl. Tabellenreferenz (a. = artikel, ak. = artikel_kategorie, k. = kategorien), Lokalisierte Feldnamen mit LANGUAGE_DB_FIELD_MODE_PREFIX. versehen.
                                                             'dropdown_reload' => false, // Nicht nach jeder Aenderung der Auswahl im Dropdown durch den Shopkunden sofort die Suchmaske neu nachladen
                                                            ),
                                       );

    $adv_config['adv_felder'][10] = array('label'    => 'Hersteller Artikel-Nr.',
                                        'var_name'  => 'hersteller_artikel_nr',
                                        'feldnamen' => 'hersteller_artikel_nr',
                                        'tabelle'   => 'artikel',
                                        'typ'       => 'dropdown',
                                        'options'   => array('value'           => '',
                                                             'dropdown_parent' => 1, // Parent-Dropdown bei verschachtelten Dropdown-Typen
                                                             'einschraenkungen'=>LANGUAGE_DB_FIELD_MODE_PREFIX.'zusatzfeld_1 <> \'\'', // Einschraenkungen selbst addslashen
                                                             'dropdown_ignore_if_parent_value_set'=>true, // Dropdown nicht disablen, bloss weil noch keine Hauptkategorie gewaehlt worden ist..
                                                            ),
                                       );

//     $adv_config['adv_felder'][11] = array('label'    => 'Alter',
//                                         'var_name'  => 'alter',
//                                         'feldnamen' => 'zusatzfeld_2',
//                                         'tabelle'   => 'artikel',
//                                         'typ'       => 'von_bis_felder',
//                                         'options'   => array('von'              => 0,
//                                                              'bis'              => 99,
//                                                              'size'             => 2,
//                                                              'maxlength'        => 2,
//                                                              'feldnamen_bis' => 'zusatzfeld_3',
//                                                             ),
//                                        );

    global $my_session;
    if (intval($my_session→get_session_var('kat_aktiv')) > 0) {
        $adv_config['adv_felder'][]  = array('label'    => 'Nur in aktueller Kategorie suchen',
                                            'var_name'  => 'nur_aktuelle_kategorie',
                                            'feldnamen' => 'Kategorie_ID',
                                            'tabelle'   => 'kategorien',
                                            'typ'       => 'boolean',
                                            'options'   => array('value'           => '',
                                                                 'boolean_checked' => false,     // Def. ob die Boolean-Checkbox vorausgewaehlt sein soll
                                                                 'boolean_true'    => '= '.intval($my_session→get_session_var('kat_aktiv')), // Def. von true bei Boolean-Typen
                                                                 'label_danach'    => ' (es werden keine Unterkategorien berücksichtigt)'
                                                                ),
                                           );
    }

Tips

  • As var_name you should not use the database field names of the article additional fields (zusatzfeld_1 to zusatzfeld_n).
  • The numbering in $adv_config['adv_felder'] must have the increment 1 and must not have gaps. Especially after moving elements, an error that often happens…
  • If you want the specialized search fields of the Advanced Article Search to be displayed below the normal search field (or the additional fields + keywords search field), you can do this by placing the Search element block in the template shop/language/html_templates/advancedsuche.tpl.html either before or after the blocks of the specialized elements.
  • memory allocation error occurs: Possibly dropdown fields were moved (different position) but the options fields dropdown_parent were forgotten to update…
  • Article additional fields are not displayed in the search mask. Comment out the desired fields in the array $adv_config['adv_global']['zusatzfelder_nicht_verwenden'].
  • If you have changed the display order, the values are no longer displayed / filled in a subordinate dropdown: This can be because you forgot to also update the field number of the referenced dropdown in the option feldnamen_einschraenkung at the superordinate dropdown and the Advanced Search therefore does not take this field into account in the query generator.

Multilingualism

  • Since Advanced Search module version 1.1, multilingual articles are supported (usable without bugs since v.1.2). The search then only shows values of articles in dropdowns that correspond to the currently active language chosen by the shop customer. Since many operations are only based on article fields, this is equivalent to a major performance cut, since now in addition to each article it must also be checked which language it is assigned to. This assignment (Artikel_ID, Sprachcode_iso_639_1) runs via the following tables: artikel → artikel_kategorie → kategorien → kategorie_locale → locale which of course makes the SQLs quite a bit more complex and slower.
  • The labels that are translated have no influence on this.
  • Normal multilingualism: An optimization of the accesses would be the additional storage of the ISO-639-1 language codes in the article table (like back then with the Architronic language patch).
  • The multilingualism mode LANGUAGE_DB_FIELD_MODE (from shop version 3.0 the standard mode, previously activatable in shop/config.inc.php) is supported for the first time from Advanced Search version 1.3. When customizing, you must be careful not to forget the language constant (LANGUAGE_DB_FIELD_MODE_PREFIX) in the right places.

Further Help

Do you have questions or need assistance? Do you have special requirements or desire a custom solution for your system? Our support team is happy to help. Support services are charged based on time and material at CHF 195.- / hour. Here is how to reach us:

Other Useful Pages

🌶️
🔥
🌶️