diff --git a/README.md b/README.md index b3f4e3c..9c7dfc7 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,15 @@ Das Zeilen-Bild nutzt einen **Marker+Post-Processing-Workaround**, weil Dolibarr ## Bild-Auswahl -Das „Hauptbild" eines Produkts ist das **alphabetisch erste** in `documents/produit//photos/`. Wer steuern will, welches Bild Hauptbild ist: Dateien mit Nummernprefix benennen, z.B. `01_front.jpg`, `02_detail.jpg`, … +Das „Hauptbild" eines Produkts (Zeilen-Bild und großes Detailbild) wird **genau in der Reihenfolge gewählt, die Dolibarr im Produktkärtchen anzeigt** — nicht alphabetisch. Sortiert wird wie in `Product::show_photos()`: + +1. **Cover** (falls im ECM gesetzt — im Produkt-UI normalerweise nicht setzbar, daher meist ohne Wirkung) +2. **Position** aus `llx_ecm_files` (die per Drag&Drop festgelegte Galerie-Reihenfolge) +3. alphabetisch als Fallback (nicht indexierte Dateien landen am Ende) + +**So steuerst du, welches Bild im Angebot erscheint:** Produkt öffnen → Reiter **„Dokumente"** → das gewünschte Bild per Hoch-/Runter-Pfeil bzw. Drag&Drop **an Position 1** ziehen. Danach ggf. im Modul-Setup den **Cache leeren**, damit nicht eine ältere skalierte Kopie greift. + +> Quelle der Reihenfolge ist `dol_dir_list_in_database()` auf `llx_ecm_files` (`position`, `cover`) in `class/productimage.class.php::listSourceImages`. Vor v0.1.1 wurde rein alphabetisch nach Dateiname sortiert — dadurch landete ein willkürliches Bild im PDF. ## Bekannte Limitationen diff --git a/core/modules/modProductImageTags.class.php b/core/modules/modProductImageTags.class.php index 2c0a735..3aa86b4 100644 --- a/core/modules/modProductImageTags.class.php +++ b/core/modules/modProductImageTags.class.php @@ -57,7 +57,7 @@ class modProductImageTags extends DolibarrModules $this->editor_url = 'https://git.data-it-solution.de/data-it/productimagetags'; $this->editor_squarred_logo = ''; - $this->version = '0.1.0'; + $this->version = '0.1.1'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);