Mache den Lizenzartikel zur Produktseite und leite die Seite aus dem Angebot ab
CI Feature / test (push) Failing after 3m16s

Die Produktseite ist die Seite des Artikels (/shop/{id}), den die Option als einzige
Position verkauft, oder die Paketseite. Sie wird nicht mehr einem Programm zugeordnet.
Ein Kauf braucht genau eine Position und einen Preis, sonst lässt er sich nicht aktivieren.
Module und Programme werden dadurch nicht öffentlich (Karten und /programme unverändert).

Tests: Die Tests, die eine Programmseite als Produktseite voraussetzten, prüfen jetzt die
Artikelseite; die Zuordnung „eigene Paketseite oder Programmseite“ entfällt (ADR-52).
Ein Altbestandstest sichert die Programmseite für Angebote mit mehreren Positionen.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-25 17:39:20 +01:00
1 parent 1950dc377b
commit 08f7d0c63d
22 files changed
+544 -275

No files matched your search

+10 -26
View File
@@ -15,7 +15,6 @@
use App\Domain\Catalog\OfferVersion;
use App\Domain\Catalog\ReleaseStatus;
use App\Domain\Catalog\StatusValue;
use App\Domain\Cms\Catalog\PublicCatalogReader;
use App\Domain\Commerce\Money;
use App\Domain\Commerce\ProductOptions;
use App\Filament\Resources\LicenseArticles\LicenseArticleResource;
@@ -35,7 +34,6 @@ class PublicationReadiness
public function __construct(
private readonly BundleService $bundles,
private readonly OfferService $offers,
private readonly PublicCatalogReader $catalog,
) {}
/** Ein Artikel ist verwendbar, wenn sein aktueller Stand veröffentlicht ist. */
@@ -227,10 +225,7 @@ public function forOffer(Offer $offer): array
$articleIds = $hasActive ? $active->resolvedScopes()->pluck('license_article_id')->map(fn ($id): int => (int) $id)->all() : [];
$missing = $this->unusableArticles($articleIds);
$buyable = $hasActive && $this->offers->purchasableVersion($offer) !== null;
$page = $offer->composition;
$own = (bool) $offer->standalone_bundle;
$shown = $own || ($page !== null && $this->catalog->shownVersion($page) !== null);
$pageName = $page !== null ? (string) ($page->display_title ?: $page->designation) : '';
$pageUrl = app(ProductOptions::class)->pageUrl($offer);
$activate = ['label' => $hasActive ? 'Geänderte Fassung aktivieren' : 'Angebot konfigurieren', 'wire' => "mountAction('activate')"];
return $this->result([
@@ -272,26 +267,15 @@ public function forOffer(Offer $offer): array
'pflicht' => false,
],
[
'titel' => 'Produktseite zuordnen',
'text' => $own
? 'Eigene Paketseite: Sie zeigt den Umfang des Pakets. Optionen desselben Pakets sind Alternativen im Warenkorb.'
: ($page !== null
? 'Zugeordnet: „'.$pageName.'“. Optionen derselben Produktseite sind Alternativen im Warenkorb.'
: 'Der Shop zeigt ein Angebot auf der Seite eines Programms. Wähle in der Maske die Produktseite. Ein Paket (Katalog → Pakete), das für sich verkauft wird, erhält dort „Eigene Paketseite“ und zeigt seinen Umfang; ein Lizenzartikel braucht dagegen ein Programm, das unter „Programme“ angelegt und zur Anzeige freigegeben ist. Ein Modul kann keine Produktseite sein.'),
'stand' => $own || $page !== null ? 'erledigt' : 'offen',
'aktion' => $own || $page !== null ? null : $activate,
],
[
'titel' => 'Produktseite öffentlich',
'text' => ! $own && $page === null
? 'Wird geprüft, sobald eine Produktseite zugeordnet ist.'
: ($own
? 'Die eigene Paketseite ist öffentlich, sobald die aktive Fassung ein Kauf mit Preis ist.'
: ($shown
? 'Das Programm ist zur Anzeige freigegeben. Das Angebot erscheint in der Shop-Suche und auf der Produktseite.'
: 'Das Programm „'.$pageName.'“ ist nicht zur Anzeige freigegeben oder kein Programm. Das Angebot ist dort nicht auffindbar.')),
'stand' => $shown ? 'erledigt' : 'offen',
'aktion' => $page === null || $shown ? null : ['label' => 'Programm öffnen', 'href' => EditorialCatalog::editUrl($page)],
'titel' => 'Produktseite im Shop',
'text' => match (true) {
! $hasActive => 'Die Produktseite ergibt sich aus der Fassung: Sie ist die Seite des Artikels (oder des Pakets), den die Option verkauft. Du ordnest sie nicht zu.',
$pageUrl !== null && $buyable => 'Die Option erscheint auf der Produktseite '.parse_url($pageUrl, PHP_URL_PATH).' und im Shop. Optionen desselben Artikels sind Alternativen im Warenkorb.',
$pageUrl !== null => 'Sobald die Option ein Kauf mit Preis ist, erscheint sie auf '.parse_url($pageUrl, PHP_URL_PATH).'.',
default => 'Diese Fassung hat mehrere Positionen und damit keine Produktseite. Verkauft wird genau ein Artikel oder ein Paket; mehrere Artikel gemeinsam verkaufst du als Paket.',
},
'stand' => $buyable && $pageUrl !== null ? 'erledigt' : 'offen',
'aktion' => $hasActive && $pageUrl === null ? $activate : null,
],
]);
}