Erkläre bei der Produktseiten-Zuordnung, warum ein Modul oder Lizenzartikel keine eigene Seite bekommt
Die Auswahl nennt je Eintrag, ob der Shop die Seite zeigen kann (Programm mit Anzeigefreigabe), und die Fehlermeldung zur eigenen Paketseite nennt den Weg über Pakete oder ein Programm. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9041afda80
commit
1950dc377b
4 files changed
+51
-5
No files matched your search
@@ -107,7 +107,7 @@ public function activate(Offer $offer, array $lines, array $attributes = []): Of
|
||||
], $attributes);
|
||||
|
||||
if ($offer->standalone_bundle && (count($lines) !== 1 || ! $lines[0]['target'] instanceof BundleVersion)) {
|
||||
throw new DomainRuleException('Ein Angebot mit eigener Paketseite besteht aus genau einer Paketfassung. Wähle eine Paketfassung oder ordne das Angebot der Seite eines Programms zu.');
|
||||
throw new DomainRuleException('Ein Angebot mit eigener Paketseite besteht aus genau einer Paketfassung (Katalog → Pakete). Für einen Lizenzartikel ordnest du das Angebot der Seite eines Programms zu: Das Programm muss als Programm angelegt und zur Anzeige freigegeben sein, ein Modul genügt nicht.');
|
||||
}
|
||||
|
||||
$this->assertAttributes($attributes);
|
||||
|
||||
@@ -286,20 +286,32 @@ private function productPages(): array
|
||||
{
|
||||
$catalog = app(PublicCatalogReader::class);
|
||||
|
||||
return [self::OWN_BUNDLE_PAGE => 'Eigene Paketseite · zeigt den Umfang des Pakets (nur für ein Angebot aus genau einer Paketfassung)'] + Composition::query()
|
||||
return [self::OWN_BUNDLE_PAGE => 'Eigene Paketseite · nur für ein Angebot aus genau einer Paketfassung (Katalog → Pakete), nicht für einen Lizenzartikel'] + Composition::query()
|
||||
->with('editorialContentKind')
|
||||
->whereNull('archived_at')
|
||||
->orderBy('designation')
|
||||
->get()
|
||||
->sortBy(fn (Composition $composition): int => $catalog->shownVersion($composition) !== null ? 0 : 1)
|
||||
->sortBy(fn (Composition $composition): int => $catalog->shownVersion($composition) !== null ? 0 : (in_array($composition->editorialContentKind?->slug, PublicCatalogReader::PUBLIC_KINDS, true) ? 1 : 2))
|
||||
->mapWithKeys(fn (Composition $composition): array => [
|
||||
$composition->id => ($composition->display_title ?: $composition->designation)
|
||||
.' ('.($composition->editorialContentKind?->label ?? 'Zusammenstellung').')'
|
||||
.($catalog->shownVersion($composition) !== null ? ' · im Shop auffindbar' : ' · nicht öffentlich, im Shop nicht auffindbar'),
|
||||
.self::pageHint($catalog, $composition),
|
||||
])
|
||||
->all();
|
||||
}
|
||||
|
||||
/** Sagt bei jeder Auswahl, ob die Seite im Shop auffindbar ist und was fehlt, wenn nicht. */
|
||||
private static function pageHint(PublicCatalogReader $catalog, Composition $composition): string
|
||||
{
|
||||
if ($catalog->shownVersion($composition) !== null) {
|
||||
return ' · im Shop auffindbar';
|
||||
}
|
||||
|
||||
return in_array($composition->editorialContentKind?->slug, PublicCatalogReader::PUBLIC_KINDS, true)
|
||||
? ' · noch nicht zur Anzeige freigegeben, im Shop nicht auffindbar'
|
||||
: ' · kein Programm, im Shop nicht auffindbar (der Shop zeigt nur Programme)';
|
||||
}
|
||||
|
||||
/**
|
||||
* Vorbelegung aus der aktiven Fassung; ohne aktive Fassung eine leere Position.
|
||||
*
|
||||
|
||||
@@ -277,7 +277,7 @@ public function forOffer(Offer $offer): array
|
||||
? '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, das für sich verkauft wird, erhält dort „Eigene Paketseite“ und zeigt seinen Umfang; sonst erscheint es auf der Seite eines fremden Programms.'),
|
||||
: '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,
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user