Ankündigung

Einklappen
Keine Ankündigung bisher.

Ausgabe der Varianten

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Ausgabe der Varianten

    Hallo,
    ich versuche gerade, die Varianten (als tags hinterlegt) im Frontend als Radio-Buttons anstelle der Checkbox auszugeben. Der Hintergrund ist, dass ein Produkt mehrere tags besitzen darf, jedoch nur ein einer variante angefragt werden soll.
    Des weiteren wird eben dieser Tag bei der Anfrage via Mail (efg und notificationcenter) mit mit ausgegeben.
    Hättet ihr einen Tipp, wie ich diese beiden Veränderungen durchführen kann?

    Viele Dank

  • #2
    Hallo,
    in den Einstellungen des Merkliste-Attributes müssen Varianten aktiviert sein. Erlaubt sind standardmäßig Select-Felder.

    Die Formular-/ und E-Mail-Ausgabe erfolgt durch die Templates eingestellt im jeweiligen Merkliste-Formularfeld. Darin können auch Manipulationen der Ausgabe vorgenommen werden.

    ps. die EFG-Erweiterung ist unter Contao 4 obsolet.
    Zuletzt geändert von Tim; 14.04.2021, 08:19.
    http://www.premium-contao-themes.com

    Kommentar


    • #3
      Hallo,
      vielen Dank für die Hilfestellung. Nur ist bei der Verwendung eines Filters Auswahl, Einfach (select, radio) es nicht möglich im Backend zwei Optionen anzugeben (Checkbox) bzw. im Frontend als eine (radio) ausgeben zu lassen.

      Im konkreten Beispiel gibt es für Flaschen unterschiedliche Sprühköpfe / Aufsätze welche bestellt werden können.
      Einstellungen: Auswahl, einfach (select, radio), Mehrfachauswahl (ausgewählt), Als Radio-Button darstellen (ausgewählt)
      Backend: Ausgabe als Radio-Button, keine mehrfachauswahl möglich
      Frontend: Ausgabe als Radio-Button, es werden alle Sprühköpfe bei den Varianten ausgegeben (Aufruf über das Widget), im Template jedoch nur die hinterlegten.

      Sobald der Button bei "Als Radio-Button darstellen" nicht auswähle, ist im BE eine Mehrfachauswahl möglich, im Frontend ebenfalls (Select). Es werden weiterhin alle Einträge und nicht die für das Produkt hinterlegten ausgegeben.

      Wenn ich dieses über Tag-Löse ist im BE und FE die Ausgabe korrekt, jedoch wird die Variante nicht über die E-Mail mit übergeben. Hier ist dann der Eintrag der Variante nicht vorhanden.

      Zur Verdeutlichung noch die Einstellungen / Ein und Ausgabe als Bild

      Einstellungen:
      Klicke auf die Grafik für eine vergrößerte Ansicht

Name: BE-Einstellungen.jpg
Ansichten: 266
Größe: 80,3 KB
ID: 22215

      Auswahl beim Produkt:
      Klicke auf die Grafik für eine vergrößerte Ansicht

Name: BE-Eingabe.jpg
Ansichten: 142
Größe: 9,5 KB
ID: 22216

      Ausgabe im FE
      Klicke auf die Grafik für eine vergrößerte Ansicht

Name: FE-Ausgabe.jpg
Ansichten: 128
Größe: 17,8 KB
ID: 22217

      Kommentar


      • #4
        Mehrfachauswahlen in Varianten wird standardmäßig nicht unterstützt. Es gibt quasi nicht mehrere additive Varianten eines Produkt in einem Varianten-Feld, sondern nur eine Abweichung je Varianten Feld. *

        Sprich, ein Pullover existiert in den Farben Rot und Grün. Die Variante erlaubt also die klare Auswahl entweder Rot oder Grün, aber nicht Rot + Grün.

        * Es können beliebig viele Varianten-Felder eingesetzt werden, für weitere Varianten.

        (Die Darstellung des Auswahl-Feldes als Radio-Buttons setzt keine Mehrfachauswahl voraus.)
        ---
        Felder ungleich Select-Auswahlen können im mail_customelementnotelist Template individuell ausgegeben werden.
        Zuletzt geändert von Tim; 15.04.2021, 13:02.
        http://www.premium-contao-themes.com

        Kommentar


        • #5
          Ja, so sollte es in diesen konkreten Beispiel ebenfalls sein.
          Hier wäre jedoch die Logik, dass wir generell 4 Farben führen wobei ein Männerpulli nur in rot oder grün vorhanden ist, das T-Shirt in allen vier Farben und das Frauen T-Shirt nur in weiß. Dementsprechend sollte man im Backend einem Produkt mehrere Farben zuweisen können aber der Kunde nur eine bestellen.

          Ist dieser Fall nicht mit den Varianten abzubilden?

          Kommentar


          • #6
            Welche Auswahlen der Benutzer im Auswahl-Feld der Variante eines Produkt wählen kann unterliegt den bereitgestellten Optionen des Selects (und der Ausgabe im Attribut-Template).
            Wenn ein Frauen T-Shirt nur die Option weiss hat, muss die Auswahl im Frontend entsprechend reduziert werden (oder man schaltet optionen auf disabled usw.) (oder man nutze ein eigenes Auswahl-Feld nur für das Frauen T-shirt (das ist etwas overkill ))

            Ich würde es wie folgt aufbauen:
            - Die Produkte unterscheidet man nach einem auswählbaren Typ z.B. ein Select-Feld mit den Optionen: Männerpulli, T-shirt, Frauen-Tshirt usw.
            - Die möglichen Farben werden alle in einem Select-Feld angelegt und im Ausgabe-Template dieses Select-Feldes reduziert man die ausgegebenen Auswahl-Optionen (siehe Select-Attribut Template) in Abhängigkeit des Produkttyps.
            http://www.premium-contao-themes.com

            Kommentar


            • #7
              Anbei ein Beispiel wie man die Ausgabe der Varianten-Auswahl in Abhängigkeit ändern kann.

              Mein Beispiel ändert die Auswahl in Abhängigkeit der ID des Datensatzes z.B. ID=1 (Option #1 raus), ID=2 (Option #2 raus). Diese Logik kann frei geändert werden.

              (Merkliste-Attribute Template)
              customelement_attr_notelist

              Code:
                [COLOR=#333333][FONT=Monaco][SIZE=11px] [COLOR=#878787]<?php[/COLOR]
                  [COLOR=#0045aa]use[/COLOR] PCT\CustomElements\Plugins\Notelist\Notelist;
                  [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]if[/COLOR][COLOR=#000000](![/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->includeNotelist)[/COLOR] [COLOR=#0045aa]return[/COLOR] [COLOR=#dd2400]''[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                  [COLOR=#0045aa]<div [/COLOR][COLOR=#007ab7]class=[/COLOR][COLOR=#5d8f00]"customelements_notelist notelist [/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->focus):[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]focus[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]endif[/COLOR][COLOR=#000000];[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->statusMessage)[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#0045aa]<p [/COLOR][COLOR=#007ab7]class=[/COLOR][COLOR=#5d8f00]"info"[/COLOR][COLOR=#0045aa]>[/COLOR][COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]echo[/COLOR] [COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->statusMessage[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#0045aa]</p>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endif[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                  [COLOR=#0045aa]<form [/COLOR][COLOR=#007ab7]method=[/COLOR][COLOR=#5d8f00]"post"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]id=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->formID;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]action=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->action;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa]>[/COLOR]
                [COLOR=#0045aa]<input [/COLOR][COLOR=#007ab7]type=[/COLOR][COLOR=#5d8f00]"hidden"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]name=[/COLOR][COLOR=#5d8f00]"FORM_SUBMIT"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]value=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->formID;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa] />[/COLOR]
                [COLOR=#0045aa]<input [/COLOR][COLOR=#007ab7]type=[/COLOR][COLOR=#5d8f00]"hidden"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]name=[/COLOR][COLOR=#5d8f00]"REQUEST_TOKEN"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]value=[/COLOR][COLOR=#5d8f00]"{{request_token}}"[/COLOR][COLOR=#0045aa] />[/COLOR]
                [COLOR=#0045aa]<input [/COLOR][COLOR=#007ab7]type=[/COLOR][COLOR=#5d8f00]"hidden"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]name=[/COLOR][COLOR=#5d8f00]"ITEM_ID"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]value=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->itemID;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa] />[/COLOR]
                [COLOR=#0045aa]<input [/COLOR][COLOR=#007ab7]type=[/COLOR][COLOR=#5d8f00]"hidden"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]name=[/COLOR][COLOR=#5d8f00]"SOURCE"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]value=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->source;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa] />[/COLOR]
                [COLOR=#0045aa]<div [/COLOR][COLOR=#007ab7]class=[/COLOR][COLOR=#5d8f00]"notelistamount input_container"[/COLOR][COLOR=#0045aa]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]echo[/COLOR] [COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->amountLabel[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]><?php[/COLOR] [COLOR=#0045aa]echo[/COLOR] [COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->amountInput[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#0045aa]</div>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#400080]count[/COLOR]([COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->variants[/COLOR]) [COLOR=#000000]>[/COLOR] [COLOR=#007ab7]0[/COLOR][COLOR=#000000])[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#0045aa]<div [/COLOR][COLOR=#007ab7]class=[/COLOR][COLOR=#5d8f00]"notelistvariants"[/COLOR][COLOR=#0045aa]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]foreach[/COLOR][COLOR=#000000]([/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->variants[/COLOR] [COLOR=#000000]as[/COLOR] [COLOR=#8735a5]$name[/COLOR] [COLOR=#000000]=>[/COLOR] [COLOR=#8735a5]$widget[/COLOR][COLOR=#000000])[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR]
                [COLOR=#8735a5]$objAttribute[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#8735a5]$widget[/COLOR][[COLOR=#dd2400]'attribute'[/COLOR]];
                [COLOR=#8735a5]$objOrigWidget[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#8735a5]$widget[/COLOR][[COLOR=#dd2400]'raw'[/COLOR]];
                [COLOR=#8735a5]$arrFieldDef[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#8735a5]$objAttribute[/COLOR][COLOR=#000000]->[/COLOR][COLOR=#3f6e7d]getFieldDefinition[/COLOR]();
                 
                [COLOR=#8735a5]$objVariant[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#0045aa]new[/COLOR] PCT\CustomElements\Plugins\NoteList\Variants[COLOR=#000000]()[/COLOR];
                 
                [COLOR=#8735a5]$objWidget[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#8735a5]$objVariant[/COLOR][COLOR=#000000]->[/COLOR][COLOR=#3f6e7d]loadFormField[/COLOR]( [COLOR=#8735a5]$arrFieldDef[/COLOR], [COLOR=#8735a5]$objAttribute[/COLOR] );
                [COLOR=#8735a5]$objWidget[/COLOR][COLOR=#000000]->name[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#8735a5]$objOrigWidget[/COLOR][COLOR=#000000]->name[/COLOR];
                [COLOR=#8735a5]$objWidget[/COLOR][COLOR=#000000]->id[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#8735a5]$objOrigWidget[/COLOR][COLOR=#000000]->name[/COLOR];
                 
                [COLOR=#8735a5]$arrOptions[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#8735a5]$objWidget[/COLOR][COLOR=#000000]->[/COLOR][COLOR=#3f6e7d]__get[/COLOR]([COLOR=#dd2400]'options'[/COLOR]);
                 
                [COLOR=#197020]// Auswahl in Abhängigkeit der ID des CC Eintrags[/COLOR]
                [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR] [COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->activeRecord->id[/COLOR] [COLOR=#000000]==[/COLOR] [COLOR=#007ab7]1[/COLOR] [COLOR=#000000])[/COLOR]
                [COLOR=#000000]{[/COLOR]
                [COLOR=#0045aa]unset[/COLOR]([COLOR=#8735a5]$arrOptions[/COLOR][[COLOR=#007ab7]1[/COLOR]]);
                [COLOR=#000000]}[/COLOR]
                [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR] [COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->activeRecord->id[/COLOR] [COLOR=#000000]==[/COLOR] [COLOR=#007ab7]2[/COLOR] [COLOR=#000000])[/COLOR]
                [COLOR=#000000]{[/COLOR]
                [COLOR=#0045aa]unset[/COLOR]([COLOR=#8735a5]$arrOptions[/COLOR][[COLOR=#007ab7]2[/COLOR]]);
                [COLOR=#000000]}[/COLOR]
                  [COLOR=#8735a5]$objWidget[/COLOR][COLOR=#000000]->[/COLOR][COLOR=#3f6e7d]__set[/COLOR]([COLOR=#dd2400]'options'[/COLOR],[COLOR=#8735a5]$arrOptions[/COLOR]);
                [COLOR=#0045aa]echo[/COLOR] [COLOR=#8735a5]$objWidget[/COLOR][COLOR=#000000]->[/COLOR][COLOR=#3f6e7d]generate[/COLOR]();
                [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endforeach[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#0045aa]</div>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endif[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#0045aa]<div [/COLOR][COLOR=#007ab7]class=[/COLOR][COLOR=#5d8f00]"submit_container"[/COLOR][COLOR=#0045aa]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]if[/COLOR][COLOR=#000000](![/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->added)[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#0045aa]<input [/COLOR][COLOR=#007ab7]type=[/COLOR][COLOR=#5d8f00]"submit"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]class=[/COLOR][COLOR=#5d8f00]"submit add"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]name=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->submitName;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]value=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->submit;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa] />[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]else[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#0045aa]<input [/COLOR][COLOR=#007ab7]type=[/COLOR][COLOR=#5d8f00]"submit"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]class=[/COLOR][COLOR=#5d8f00]"submit update"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]name=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->updateName;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]value=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->update;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa]>[/COLOR]
                [COLOR=#0045aa]<input [/COLOR][COLOR=#007ab7]type=[/COLOR][COLOR=#5d8f00]"submit"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]class=[/COLOR][COLOR=#5d8f00]"submit remove"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]name=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->removeName;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa] [/COLOR][COLOR=#007ab7]value=[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#878787]<?php[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#0045aa]echo[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->remove;[/COLOR][COLOR=#5d8f00] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#5d8f00]"[/COLOR][COLOR=#0045aa]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endif[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#0045aa]</div>[/COLOR]
                [COLOR=#0045aa]</form>[/COLOR]
                [COLOR=#0045aa]</div>[/COLOR]
                  [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->focus)[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#0045aa]<script [/COLOR][COLOR=#007ab7]type=[/COLOR][COLOR=#5d8f00]'text/javascript'[/COLOR][COLOR=#0045aa]>[/COLOR]
                [COLOR=#197020]/* <![CDATA[ */[/COLOR]
                  [COLOR=#197020]/**[/COLOR]
                [COLOR=#197020]* Scroll to id[/COLOR]
                [COLOR=#197020]*/[/COLOR]
                [COLOR=#3f6e7d]jQuery[/COLOR]([COLOR=#000000]document[/COLOR]).[COLOR=#3f6e7d]ready[/COLOR]([COLOR=#0045aa]function[/COLOR]()
                {
                [COLOR=#3f6e7d]jQuery[/COLOR]([COLOR=#dd2400]"html, body"[/COLOR]).[COLOR=#3f6e7d]animate[/COLOR]({scrollTop: [COLOR=#3f6e7d]jQuery[/COLOR]([COLOR=#dd2400]'#[/COLOR][COLOR=#878787]<?=[/COLOR][COLOR=#dd2400] [/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->formID;[/COLOR][COLOR=#dd2400] [/COLOR][COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][COLOR=#dd2400]'[/COLOR]).[COLOR=#3f6e7d]offset[/COLOR]().[COLOR=#000000]top[/COLOR] [COLOR=#006ff8]-[/COLOR] [COLOR=#007ab7]0[/COLOR]}, [COLOR=#007ab7]500[/COLOR]);
                });
                  [COLOR=#197020]/* ]]> */[/COLOR]
                [COLOR=#0045aa]</script>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endif[/COLOR]; [COLOR=#878787]?>[/COLOR]
               [/SIZE][/FONT][/COLOR]
              Zuletzt geändert von Tim; 15.04.2021, 15:03.
              http://www.premium-contao-themes.com

              Kommentar


              • #8
                ps. Ich hatte selbst einen Denkfehler. Tags als Quelle geht und wird sogar standardmäßig in Abhängigkeit ausgewählt. Allerdings existiert aktuell ein Fehler in der Ausgabe dieser Konstellation im Formularfeld. Ich habe das bereits in der dev-Version 1.5.1 korrigiert.
                https://github.com/timgatzky/pct_cus...elist/tree/dev

                Die Ausgabe in der Mail erfolgt durch den Wert des Tags. In der Regel die ID.


                mail_notelist_customelements

                Mit lesbarer Ausgabe der Tags.

                Code:
                [COLOR=#333333][FONT=Monaco][SIZE=11px][COLOR=#878787]<?php[/COLOR]
                [COLOR=#197020]/**[/COLOR]
                [COLOR=#197020]* Template for customelements notelist email output[/COLOR]
                [COLOR=#197020]*/[/COLOR]
                [COLOR=#0045aa]use[/COLOR] Contao\PCT_TagsModel;
                [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#400080]count[/COLOR]([COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->entries[/COLOR]) [COLOR=#000000]>[/COLOR] [COLOR=#007ab7]0[/COLOR][COLOR=#000000])[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]foreach[/COLOR][COLOR=#000000]([/COLOR][COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->entries[/COLOR] [COLOR=#000000]as[/COLOR] [COLOR=#8735a5]$entry[/COLOR][COLOR=#000000])[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]echo[/COLOR] [COLOR=#8735a5]$entry[/COLOR][[COLOR=#dd2400]'amount'[/COLOR]]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]x
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]foreach[/COLOR][COLOR=#000000]([/COLOR][COLOR=#8735a5]$entry[/COLOR][[COLOR=#dd2400]'fields'[/COLOR]] [COLOR=#000000]as[/COLOR] [COLOR=#8735a5]$field[/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]echo[/COLOR] [COLOR=#8735a5]$field[/COLOR][COLOR=#000000]->[/COLOR][COLOR=#3f6e7d]value[/COLOR](); [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endforeach[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#400080]count[/COLOR]([COLOR=#8735a5]$entry[/COLOR][[COLOR=#dd2400]'variants'[/COLOR]]) [COLOR=#000000]>[/COLOR] [COLOR=#007ab7]0[/COLOR][COLOR=#000000])[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                ([COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]foreach[/COLOR][COLOR=#000000]([/COLOR][COLOR=#8735a5]$entry[/COLOR][[COLOR=#dd2400]'variants'[/COLOR]] [COLOR=#000000]as[/COLOR] [COLOR=#8735a5]$name[/COLOR] [COLOR=#000000]=>[/COLOR] [COLOR=#8735a5]$data[/COLOR][COLOR=#000000])[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#8735a5]$data[/COLOR][[COLOR=#dd2400]'value'[/COLOR]][COLOR=#000000])[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#197020]// Tags-Titel ausgeben[/COLOR]
                [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR] [COLOR=#8735a5]$data[/COLOR][[COLOR=#dd2400]'attribute'[/COLOR]][COLOR=#000000]->type[/COLOR] [COLOR=#000000]==[/COLOR] [COLOR=#dd2400]'tags'[/COLOR] [COLOR=#000000])[/COLOR]
                [COLOR=#000000]{[/COLOR]
                [COLOR=#8735a5]$v[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#8735a5]$data[/COLOR][[COLOR=#dd2400]'value'[/COLOR]];
                [COLOR=#0045aa]if[/COLOR] [COLOR=#000000]([/COLOR] [COLOR=#000000]![/COLOR][COLOR=#400080]is_array[/COLOR]([COLOR=#8735a5]$v[/COLOR]) [COLOR=#000000])[/COLOR]
                [COLOR=#000000]{[/COLOR]
                [COLOR=#8735a5]$v[/COLOR] [COLOR=#000000]=[/COLOR] [COLOR=#400080]explode[/COLOR]([COLOR=#dd2400]','[/COLOR],[COLOR=#8735a5]$v[/COLOR]);
                [COLOR=#000000]}[/COLOR]
                [COLOR=#8735a5]$objTags[/COLOR] [COLOR=#000000]=[/COLOR] PCT_TagsModel[COLOR=#000000]::[/COLOR][COLOR=#3f6e7d]findMultipleByIds[/COLOR]([COLOR=#8735a5]$v[/COLOR]);
                [COLOR=#8735a5]$data[/COLOR][[COLOR=#dd2400]'value'[/COLOR]] [COLOR=#000000]=[/COLOR] [COLOR=#8735a5]$objTags[/COLOR][COLOR=#000000]->[/COLOR][COLOR=#3f6e7d]fetchEach[/COLOR]([COLOR=#dd2400]'title'[/COLOR]);
                [COLOR=#000000]}[/COLOR]
                [COLOR=#197020]// convert array values to comma separated string[/COLOR]
                [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#400080]is_array[/COLOR]([COLOR=#8735a5]$data[/COLOR][[COLOR=#dd2400]'value'[/COLOR]])[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR][COLOR=#8735a5]$data[/COLOR][[COLOR=#dd2400]'value'[/COLOR]] [COLOR=#000000]=[/COLOR] [COLOR=#400080]implode[/COLOR]([COLOR=#dd2400]', '[/COLOR], [COLOR=#8735a5]$data[/COLOR][[COLOR=#dd2400]'value'[/COLOR]]);[COLOR=#000000]}[/COLOR]
                [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]echo[/COLOR] [COLOR=#8735a5]$data[/COLOR][[COLOR=#dd2400]'value'[/COLOR]]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endif[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endforeach[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR])
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endif[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endforeach[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]else[/COLOR]: [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]echo[/COLOR] [COLOR=#8735a5]$this[/COLOR][COLOR=#000000]->empty[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR]
                [COLOR=#878787]<?php[/COLOR] [COLOR=#0045aa]endif[/COLOR]; [COLOR=#878787]?[/COLOR][COLOR=#878787]>[/COLOR][/SIZE][/FONT][/COLOR]
                http://www.premium-contao-themes.com

                Kommentar


                • #9
                  Hallo Tim,
                  vielen dank für deine ausführliche Antwort.
                  Die Variante mit der Erweiterung des Tag-Typs im Mailformular scheint mir die effektivste und auch zukunftssicherte, da dieses schon für die zukünftigen Versionen mit aufgenommen wurde.
                  Nur leider wird bei mir im Mailtemplate der Bereich
                  PHP-Code:
                  <?php if(count($entry['variants']) > 0): ?> ( ... ) <?php endif; ?>
                  gar nicht ausgeführt.

                  Kommentar


                  • #10
                    Die Varianten-Felder müssen veröffentlicht sein und in den Einstellungen des Merkliste-Attributes als Varianten angewählt sein und es müssen Varianten gewählt sein in den gemerkten Einträgen.
                    Zuletzt geändert von Tim; 20.04.2021, 12:31.
                    http://www.premium-contao-themes.com

                    Kommentar


                    • #11
                      Hallo, das ist alles aktiviert und definiert. In der Frontendausgabe auf der Seite werden diese Daten auch korrekt übergeben - nur im E-Mail Template wird die entsprechende If-Abfrage nicht ausgeführt.
                      Sobald ich im Form die Merkliste via CSS sichtbar mache, sind die Varianten dort nicht hinterlegt - diese werden durch das Feld "Merkliste" aktiviere, wodurch das Formular nicht mehr funktioniert.

                      Kommentar


                      • #12
                        Zitat von GlaeserTo Beitrag anzeigen
                        Hallo, das ist alles aktiviert und definiert. In der Frontendausgabe auf der Seite werden diese Daten auch korrekt übergeben - nur im E-Mail Template wird die entsprechende If-Abfrage nicht ausgeführt.
                        Sobald ich im Form die Merkliste via CSS sichtbar mache, sind die Varianten dort nicht hinterlegt - diese werden durch das Feld "Merkliste" aktiviere, wodurch das Formular nicht mehr funktioniert.
                        Bitte die vorab die Version 1.5.1 aus Github laden.
                        http://www.premium-contao-themes.com

                        Kommentar


                        • #13
                          Ich hatte die dev-Version von git via ftp auf den Webspace hochgeladen. Leider erhalte ich dann einen 500er Server-Fehler. Sind weitere Schritte notwendig bzw. gibt es einen anderen Weg die dev-Version zu installieren?
                          Vielen Dank für die Hilfe

                          Kommentar


                          • #14
                            Wie lautet denn der Fehler?

                            Nach dem Hochladen sollte der Symfony Cache geleert werden.
                            http://www.premium-contao-themes.com

                            Kommentar


                            • #15
                              Nun klappt alles - vielen Dank für den Support.

                              Kommentar

                              Lädt...
                              X