Trade Republic - Provisionsfrei Aktien handeln
Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Bei Klick auf Kategorie nur Unterkategorien ausklappen, main_content jedoch nicht ändern

    Donco

    • Schreiberling
    • Beiträge: 258
    @hpzeller

    Die Zeile steht nicht im Thread.

    Ich habe mir die Datei xtc_show_category.inc.php angesehen.

    Die + - Buttons werden dort über diese Zeile eingebunden.

    Ich habe es so probiert:

    Code: PHP  [Auswählen]
    $subcategories_button = '<div class="category_button" data-value="'.($foo[$counter]['path']).'">' . ($in_path ? ''<i class="fas fa-minus-circle">' : '<i class="fas fa-plus-circle">') . '</div>';

    Das hat nicht funktioniert.
    Trade Republic - Provisionsfrei Aktien handeln

    hpzeller

    • Experte
    • Beiträge: 4.130
    • Geschlecht:
    Hallo Donco ,

    Versuch es mal so,

    Code: PHP  [Auswählen]
    ($in_path ? '<i class="fas fa-chevron-up"></i>' : '<i class="fas fa-chevron-down"></i>')

    aber das reicht nicht, es sind noch mehr stellen die angepasst werden müssen.

    Gruss
    Hanspeter

    Donco

    • Schreiberling
    • Beiträge: 258
    @hpzeller

    Vielen Dank, dass hat funktioniert.

    Wenn ich jetzt das Font Awesome Icon einer Hauptkategorie anklicke und diese öffne werden an dieser Stelle allerdings wieder + - Icons angezeigt.

    Weiß jemand welche Stelle noch abgeändert werden muss damit die Font Awesome Icons auch bei geöffneter Hauptkategorie angezeigt werden?

    Donco

    • Schreiberling
    • Beiträge: 258
    Ich glaube es ist die Datei includes/extra/ajax/get_subcat.php
    Hier steht folgender Code
    Code: PHP  [Auswählen]
            $subcategories_button = '<div class="category_button" data-value="'.($in_path ? ($my_foo[$counter-1]['path'] != '' ? $my_foo[$counter-1]['path'] : 0) : $my_foo[$counter]['path']).'">' . ($in_path ? '-' : '+') . '</div>';

    Ich habe die Stelle abgeändert in
    Code: PHP  [Auswählen]
            $subcategories_button = '<div class="category_button" data-value="'.($in_path ? ($my_foo[$counter-1]['path'] != '' ? $my_foo[$counter-1]['path'] : 0) : $my_foo[$counter]['path']).'">' . ($in_path ? '<i class="fas fa-chevron-up"></i>' : '<i class="fas fa-chevron-down"></i>') . '</div>';

    Das hat nicht funktioniert.  Scheinbar muss in der ajax.menu.js.php folgende Stelle abgeändert werden

    Code: PHP  [Auswählen]
      }(jQuery));

            $('.box_category').on('click', '.category_button', function() {
                    var $this = $(this);
                    if($this.next('ul').length > 0) {
                            $this.next('ul').slideToggle();
                            $this.text($this.text() == "+" ? "-" : "+");
                    } else {
                            var path = $this.data("value");
                            var lang = '<?php echo $_SESSION['languages_id']; ?>';
                            $.get('<?php echo xtc_href_link('ajax.php') ?>', {ext: 'get_subcat', type: 'html', cPath: path, language: lang}, function(data) {
                                    if (data != '' && data != undefined) {
                                            $this.after(data);
                                            $this.next('ul').slideToggle();
                                            $this.text($this.text() == "+" ? "-" : "+");
                                    } else {
                                            $this.insertAfter('AJAX-FEHLER');
                                    }
                            });
                    }
            });

    Ich habe die eine Zeile so abgeändert:

    Code: PHP  [Auswählen]
            $this.text($this.text() == "<i class="fas fa-chevron-up"></i>" ? "<i class="fas fa-chevron-down"></i>" : "<i class="fas fa-chevron-up"></i>");

    Das hat nicht funktioniert.

    hpzeller

    • Experte
    • Beiträge: 4.130
    • Geschlecht:
    Hallo Donco ,

    also jetzt ist mir klar, du hast den Code er Ajax Version, woher auch immer, und nicht den Code den ich hier gepostet habe in deinen Shop eingebaut.

    Für diesen Code findest du nachfolgend drei Varianten von denen jeweils eine in die untenstehenden Dateien eingebaut bzw. geändert werden muss.

    /tpl_modified_responsive/source/inc/xtc_show_category.inc.php Zeile 58
    Code: PHP  [Auswählen]
    Var1 (Standard)
    $subcategories_button = '<div class="category_button" data-value="'.($foo[$counter]['path']).'">' . ($in_path ? '-' : '+') . '</div>';

    Var2
    $subcategories_button = '<div class="category_button" data-value="'.($foo[$counter]['path']).'">' . ($in_path ? '<i class="fas fa-chevron-up"></i>' : '<i class="fas fa-chevron-down"></i>') . '</div>';

    Var3
    $subcategories_button = '<div class="category_button" data-value="'.($foo[$counter]['path']).'">' . ($in_path ? '<i class="fas fa-minus-circle"></i>' : '<i class="fas fa-plus-circle"></i>') . '</div>';

    /templates/tpl_modified_responsive/javascript/extra/ajax_menu.js.php kommt zweimal vor, Zeile 31 und 41
    Code: PHP  [Auswählen]
    Var1 (Standard)
    $this.text($this.text() == "+" ? "-" : "+");

    Var2
    $this.html($this.html() == "<i class=\"fas fa-chevron-down\"></i>" ? "<i class=\"fas fa-chevron-up\"></i>" : "<i class=\"fas fa-chevron-down\"></i>");

    Var3
    $this.html($this.html() == "<i class=\"fas fa-plus-circle\"></i>" ? "<i class=\"fas fa-minus-circle\"></i>" : "<i class=\"fas fa-plus-circle\"></i>");

    /includes/extra/ajax/get_subcat.php Zeile 119
    Code: PHP  [Auswählen]
    Var1 (Standard)
    $subcategories_button = '<div class="category_button" data-value="'.($in_path ? ($my_foo[$counter-1]['path'] != '' ? $my_foo[$counter-1]['path'] : 0) : $my_foo[$counter]['path']).'">' . ($in_path ? '-' : '+') . '</div>';

    Var2
    $subcategories_button = '<div class="category_button" data-value="'.($in_path ? ($my_foo[$counter-1]['path'] != '' ? $my_foo[$counter-1]['path'] : 0) : $my_foo[$counter]['path']).'">' . ($in_path ? '<i class="fas fa-chevron-up"></i>' : '<i class="fas fa-chevron-down"></i>') . '</div>';

    Var3
    $subcategories_button = '<div class="category_button" data-value="'.($in_path ? ($my_foo[$counter-1]['path'] != '' ? $my_foo[$counter-1]['path'] : 0) : $my_foo[$counter]['path']).'">' . ($in_path ? '<i class="fas fa-minus-circle"></i>' : '<i class="fas fa-plus-circle"></i>') . '</div>';

    Gruss
    Hanspeter

    Donco

    • Schreiberling
    • Beiträge: 258
    @hpzeller

    Mit deinen Code Varianten funktioniert es.
    Vielen Dank für deine Hilfe.
    13 Antworten
    10525 Aufrufe
    15. Juli 2011, 18:42:21 von dr4g0nstyle
               
    anything