feat(catalog): make the product page complete #52

Merged
csaeum merged 1 commit from feature/produktseite into main 2026-09-15 17:28:20 +00:00
Owner

Die Produktseite zeigt jetzt, was zum Kaufentscheid nötig ist: Bildergalerie, Auswahl der Ausführung, Preis und Verfügbarkeit der gewählten Variante sowie die Produktangaben.

Der Variantenwechsel kostet weder Seitenwechsel noch Anfrage. Die Shop-API liefert alle Varianten eines Produkts in einem Aufruf — sie stehen deshalb vollständig im Markup. Ohne JavaScript bleibt dieselbe Auswahl als Formular bedienbar (?option[gruppe]=wert), womit die Tastaturbedienung der Normalfall ist und keine Zutat.

Inhalt

  • ProductOption, ProductOptionValue und ProductAttribute als typisierte Modelle
  • ProductOptionRepository holt die Wertnamen — begrenzt auf die Werte, die in den Varianten wirklich vorkommen — und legt sie in den Katalog-Cache
  • VariantSelector antwortet immer: eine halbe oder erfundene Auswahl fällt auf die Standardvariante zurück, statt die Seite zu zerstören
  • Attribute kommen von /products/{code}/attributes — ein Pfad, den das Produkt selbst nicht erwähnt

Die Warenkorb-Schaltfläche ist vorhanden, aber deaktiviert: der Warenkorb folgt in Phase 5 (#25 ff.).

Nachgewiesen am laufenden Shop

  • /p/ethereal-drift-t-shirt → fünf Grössen, 4 Bilder, 4 Angaben; ?option[t_shirt_size]=t_shirt_size_xxl → 24,69 USD statt 3,75 USD
  • /p/beach-bonfire-beauty → zwei Gruppen (Grösse und Höhe), beide Auswahlen greifen
  • /p/adventurous-aurora-cap → keine leere Auswahl
  • erfundener Optionswert → weiterhin HTTP 200 mit der Standardvariante
  • 10 Shop-Anfragen beim ersten Aufruf, 0 beim zweiten

Gates lokal grün: php-cs-fixer, PHPStan Level 8, 183 Tests / 496 Assertions.

closes #17

🤖 Generated with Claude Code

Die Produktseite zeigt jetzt, was zum Kaufentscheid nötig ist: Bildergalerie, Auswahl der Ausführung, Preis und Verfügbarkeit der gewählten Variante sowie die Produktangaben. **Der Variantenwechsel kostet weder Seitenwechsel noch Anfrage.** Die Shop-API liefert alle Varianten eines Produkts in einem Aufruf — sie stehen deshalb vollständig im Markup. Ohne JavaScript bleibt dieselbe Auswahl als Formular bedienbar (`?option[gruppe]=wert`), womit die Tastaturbedienung der Normalfall ist und keine Zutat. ## Inhalt - `ProductOption`, `ProductOptionValue` und `ProductAttribute` als typisierte Modelle - `ProductOptionRepository` holt die Wertnamen — begrenzt auf die Werte, die in den Varianten wirklich vorkommen — und legt sie in den Katalog-Cache - `VariantSelector` antwortet immer: eine halbe oder erfundene Auswahl fällt auf die Standardvariante zurück, statt die Seite zu zerstören - Attribute kommen von `/products/{code}/attributes` — ein Pfad, den das Produkt selbst nicht erwähnt Die Warenkorb-Schaltfläche ist vorhanden, aber **deaktiviert**: der Warenkorb folgt in Phase 5 (#25 ff.). ## Nachgewiesen am laufenden Shop - `/p/ethereal-drift-t-shirt` → fünf Grössen, 4 Bilder, 4 Angaben; `?option[t_shirt_size]=t_shirt_size_xxl` → 24,69 USD statt 3,75 USD - `/p/beach-bonfire-beauty` → zwei Gruppen (Grösse und Höhe), beide Auswahlen greifen - `/p/adventurous-aurora-cap` → keine leere Auswahl - erfundener Optionswert → weiterhin HTTP 200 mit der Standardvariante - 10 Shop-Anfragen beim ersten Aufruf, 0 beim zweiten Gates lokal grün: php-cs-fixer, PHPStan Level 8, 183 Tests / 496 Assertions. closes #17 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(catalog): make the product page complete
All checks were successful
CI / cs-check (push) Successful in 22s
CI / phpstan (push) Successful in 38s
CI / phpunit (push) Successful in 32s
CI / build-release (push) Has been skipped
2cd230f261
The page now shows what a customer needs to decide: an image gallery,
the selection of a variant, the price and stock of the chosen one, and
the product's own data.

Switching a variant costs neither a page change nor a request — the shop
API delivers all variants of a product in one call, so they all sit in
the markup. Without JavaScript the same selection stays usable as a form
(?option[group]=value), which makes keyboard operation the normal case
rather than an addition.

- ProductOption, ProductOptionValue and ProductAttribute as typed models
- ProductOptionRepository reads the value names, limited to the values
  the variants actually use, and caches them
- VariantSelector always answers: a half or invented choice falls back
  instead of breaking the page
- attributes come from /products/{code}/attributes, a path the product
  itself does not mention

The cart button is present but disabled: the cart follows in phase 5.

closes #17

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
csaeum merged commit af06471210 into main 2026-09-15 17:28:20 +00:00
csaeum deleted branch feature/produktseite 2026-09-15 17:28:20 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Sulu-Bundles/wsc_sulubundle_syliusheadless!52
No description provided.