# Varianten-Auswahlfelder als Farbmuster (evtl. vollflächig)

**URL:** <https://forum.shopware.com/t/varianten-auswahlfelder-als-farbmuster-evtl-vollflachig/52023>\
**Category:** Programmierung\
**Created:** [26. März 2018 um 11:42 UTC](https://forum.shopware.com/t/varianten-auswahlfelder-als-farbmuster-evtl-vollflachig/52023 "2018-03-26T11:42:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanny](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@Tanny](https://forum.shopware.com/u/Tanny)\
**Post date:** [26. März 2018 um 11:42 UTC](https://forum.shopware.com/t/varianten-auswahlfelder-als-farbmuster-evtl-vollflachig/52023/1 "2018-03-26T11:42:16Z")

</div>

Hallo Gemeinde,

gibt es noch immer nicht die Möglichkeit den Variantenauswahlfeldern in den Artikeldetails eigene Farbmusterbilder zuzuordnen?

Ich kann in den (Backend) Artikeldetails -\> Varianten -\> Konfiguration eine Option erstelle und diese dann auch bearbeiten. Wenn ich eine solche Option bearbeite kann ich dieser auch ein Bild zuordnen. Kann man dieses Bild nicht im Variantenauswahlfeld im Frontend anzeigen lassen?

Ich habe z.B. Strümpfe, alle gleich bis auf die Farbe. Jetzt möchte ich gerne im Frontend in den Artikeldetails die Variantenauswahlfelder (wenn möglich vollflächig) als Farbmuster (also nur die Farbe der Strümpfe) abbilden. Wie geht das? Ich bekomme das nicht angezeigt, sondern nach Zuordnung der Strümpfe-Bilder zu den Varianten immer nur die Strümpfe!?

Danke im Voraus.

Grüße

---

<div class="post-metadata">

**Author:** ![cocons](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@cocons](https://forum.shopware.com/u/cocons)\
**Post date:** [31. März 2018 um 16:12 UTC](https://forum.shopware.com/t/varianten-auswahlfelder-als-farbmuster-evtl-vollflachig/52023/2 "2018-03-31T16:12:46Z")

</div>

Danach habe ich auch ewig gesucht und bin dann auf&nbsp;

[Artikeleigenschaften als Bild anzeigen lassen - (Detailansicht) | shopware agentur](https://www.shopware-agentur.at/artikeleigenschaften-als-bild-anzeigen-lassen-detailansicht/) und den dort unten gegebenen Link&nbsp;[https://www.shopware-agentur.at/wp-content/uploads/2017/11/buy\_container.txt](https://www.shopware-agentur.at/wp-content/uploads/2017/11/buy_container.txt)&nbsp;&nbsp;

gelandet. Diese foreach - schleifen habe ich dann in die MYSITE/frontend/detail/config\_variant.tpl gepackt und mit viel rumprobieren

```
{extends file="parent:frontend/detail/config_variant.tpl"}
    {block name='frontend_detail_configurator_variant_group_option_label'}
        

            {if $option.media}
                {$media = $option.media}
                {block name='frontend_detail_configurator_variant_group_option_label_image'}
                    
                        
                            
                                    {foreach $sArticle.sProperties as $sProperty}
                                        {* Property label *}
                                        {block name='frontend_detail_description_properties_label'}
                                        {* {$sProperty.name|escape} *}
                                        {/block}

                                         {* Property content *}
                                         {block name='frontend_detail_description_properties_content'}
                                           {foreach $sProperty.values as $fkey => $fvalue}
                                                {if ($sProperty.values[$fkey] == $option.optionname) }
                                                    {if ($sProperty.media[$fkey].source)}
                                                      
                                                    {else}
                                                         {$sProperty.value|escape}
                                                    {/if}
                                                {/if}
                                           {/foreach}
                                         {/block}
                                    {/foreach}
                            
                        
                    
                {/block}
            {else}
                {block name='frontend_detail_configurator_variant_group_option_label_text'}
                    {$option.optionname}

               {/block}
            {/if}
        
    {/block}

```

&nbsp;

&nbsp;

erhalten.

Die Ausnahmebedingungen habe ich noch nicht getestet und die Schönheit auch nicht …

Hoffe das hilft

Cocons&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

---

<div class="post-metadata">

**Author:** ![npmt](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@npmt](https://forum.shopware.com/u/npmt)\
**Post date:** [1. August 2018 um 18:21 UTC](https://forum.shopware.com/t/varianten-auswahlfelder-als-farbmuster-evtl-vollflachig/52023/3 "2018-08-01T18:21:15Z")

</div>

Funktioniert für mich leider nicht, statt dem Bild steht dann nur “Farbe” im Feld. Hast du eine Ahnung woran das liegen kann?

&nbsp;

**EDIT:&nbsp;** nach einer langen Suche und vielen aufgefundenen _unbeantworteten_ Beiträgen habe ich mich für eine etwas “improvisierte” Lösung entschieden:

```
{extends file="parent:frontend/detail/config_variant.tpl"}

{block name='frontend_detail_configurator_variant_group_option_label'}
  
      {block name='frontend_detail_configurator_variant_group_option_label_image'}
        
            
                
            
        
      {/block}

  
{/block}

```

Etwas unsauber, vor allem weil ich die Bilder die ich verwenden möchte bereits für die Option (damit sie im Filter im Listing angezeigt werden) hochgeladen habe. Mit meiner Lösung kann ich nicht auf diese Bilder zugreifen - das habe ich versucht umzusetzen - sondern muss sie ein weiteres Mal hochladen (ins Template Verzeichnis) und sie nach dem Optionsnamen benennen.

Aber hey - es funktioniert - und ist für meine Anforderungen absolut ausreichend 😉

lg npmt
