Anpassung der Filter in der Kategorie Ansicht

Thema wurde von Garnelion, 25. April 2019 erstellt.

  1. Garnelion
    Garnelion Erfahrener Benutzer
    Registriert seit:
    4. Oktober 2011
    Beiträge:
    82
    Danke erhalten:
    3
    Danke vergeben:
    33
    Hallo zusammen,

    ich schreibe jetzt USERMOD's ins blocks um und einige funktionieren wo ich was vorher oder nachher einfügen soll.

    Leider muss ich was aus original ausschneiden und da geht jetzt nicht.
    Beispiel:
    \templates\Honeygrid\snippets\product_listing\product_listing_filter.html

    wird in folgendem GXModules überschrieben:
    \GXModules\ScHunter\ListingFilter\Shop\Template\Honeygrid\snippets\product_listing\product_listing_filter.html

    Dann möchte ich zum Beispiel einen Block überschreiben und mache es so:


    HTML:
    {block name="snippets_product_listing_filter_dropdown_button"}
        <button type="button" class="btn btn-default dropdown-toggle">
            <span class="dropdown-name">
                {if !$SORT || $SORT === ''}{$txt.label_sort}
                {elseif $SORT === 'price_asc'}{$txt.option_price_asc}
                {elseif $SORT === 'price_desc'}{$txt.option_price_desc}
                {elseif $SORT === 'name_asc'}{$txt.option_name_asc}
                {elseif $SORT === 'name_desc'}{$txt.option_name_desc}
                {/if}
            </span>
            <span class="caret"></span>
        </button>
    {/block}
    Original Block:

    HTML:
    {block name="snippets_product_listing_filter_dropdown_button"}
        <button type="button" class="btn btn-default dropdown-toggle">
                <span class="dropdown-name">
                              {if !$SORT || $SORT === ''}{$txt.label_sort}
                              {elseif $SORT === 'price_asc'}{$txt.option_price_asc}
                              {elseif $SORT === 'price_desc'}{$txt.option_price_desc}
                             {elseif $SORT === 'name_asc'}{$txt.option_name_asc}
                             {elseif $SORT === 'name_desc'}{$txt.option_name_desc}
                             {elseif $SORT === 'date_asc'}{$txt.option_date_asc}
                            {elseif $SORT === 'date_desc'}{$txt.option_date_desc}
                           {elseif $SORT === 'shipping_asc'}{$txt.option_shipping_asc}
                          {elseif $SORT === 'shipping_desc'}{$txt.option_shipping_desc}
                         {/if}
                  </span>
                 <span class="caret"></span>
         </button>
     {/block}
    Es sollte wie über USERMOD die Suche nur nach Preis und Name bleiben. Aber es sind immer noch alle drin (Datum etc).

    Was mache ich da falsch?

    MfG
    Alex
     
  2. Garnelion
    Garnelion Erfahrener Benutzer
    Registriert seit:
    4. Oktober 2011
    Beiträge:
    82
    Danke erhalten:
    3
    Danke vergeben:
    33
    Leider ist schon erledigt, wie IMMER besser lesen und nicht Template sonder noch ein 's' am Ende dazu schreiben :D
     
  3. Garnelion
    Garnelion Erfahrener Benutzer
    Registriert seit:
    4. Oktober 2011
    Beiträge:
    82
    Danke erhalten:
    3
    Danke vergeben:
    33
    Dann eine andere Frage fast zur Thema

    wie kann ich folgendes überladen?
    HTML:
    {block name="snippets_product_listing_product_grid_only"}
        {block name="snippets_product_listing_product_grid_only_rating"}
            {product_rating id=$p_id out='OVERALL_RATING'}
        {/block}
      
        <div class="product-container{if $is_swiper === 'true'} swiper-slide {/if}{if $p_imgs} has-gallery{/if}"
    muss sein:

    HTML:
    {block name="snippets_product_listing_product_grid_only"}
        {block name="snippets_product_listing_product_grid_only_rating"}
            {product_rating id=$p_id out='OVERALL_RATING'}
        {/block}
      
        <div class="product-container{if $is_swiper === 'true'} swiper-slide {/if}"
    es wird eine IF Anweisung entfernt ('{if $p_imgs} has-gallery{/if}')

    Das {block}-Tag is Haupt-Tag in der Datei: \templates\Honeygrid\snippets\product_listing\product_grid_only.html