Files
laraundfelix/resources/views/shop/optionen.blade.php
T
LarsandClaude Sonnet 5.5 0154182f3b Führe Rabattcodes, Nutzerkreis der Lizenzoption und Pflichtangaben der Kasse ein
Domäne: Rabattcodes mit Geltungsbereich (Warenkorb oder gewählte Ziele) und
Einlösungsberechtigung (allgemein oder freigeschaltete Konten) unabhängig
voneinander; Prüfung bei Eingabe, in jeder Übersicht und unter Sperre vor
Bestellabschluss (Prüfsumme der Übersicht enthält den Rabatt). Rabatt je
Position, Zwischensumme und Zahlbetrag in der Bestellung; Stripe erhält den
Preis nach Rabatt. Nutzerkreis (Einzel-/Mehrfachlizenz, Trainerzahl) an der
Angebotsfassung, kopiert in Bestellposition und Erwerb, Teil der Prüfung
"Bereits erworben". OfferService::activate lehnt Angebote ohne veröffentlichten
Artikelstand ab. Kasse: Zustimmungen als Pflichtangabe mit Nachweis,
"Zahlungspflichtig bestellen", Rechnungsweg für Organisationen, Erstattung über
Stripe, Widerruf erklären. Produktivfreigabe SHOP_LIVE_RELEASE standardmäßig aus.

Bestandstests geändert (fachlich überholt, Assertions nicht abgeschwächt): die
Schaltfläche heißt "Zahlungspflichtig bestellen" (§ 312j BGB), die Summe heißt
"Zu zahlen", der Vereinshinweis steht als Rollenliste; Bestellungen über die
Kasse senden jetzt die Zustimmungen.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 19:42:02 +01:00

69 lines
3.8 KiB
PHP

{{--
Kaufbare Lizenzoptionen unter dem fachlichen Inhalt einer Produktseite.
Parameter: $options (ProductOptions), $cart (Cart), $switchTo (Angebotskennung eines ausstehenden Wechsels)
--}}
@if ($options !== [])
<section class="shop-options" aria-labelledby="shop-options-title">
<h2 id="shop-options-title">Lizenzoptionen</h2>
<p class="shop-options-lede">Wähle die Lizenz, die zu deiner Nutzung passt. Jede Option ist einzeln kaufbar. Preis und Bedingungen gelten ab dem Bestellabschluss; es wird nichts reserviert.</p>
@if ($errors->has('shop'))
<p class="errors" role="alert">{{ $errors->first('shop') }}</p>
@endif
@if ($switchTo)
@php
$wanted = collect($options)->first(fn ($option) => $option['offer']->id === (int) $switchTo);
$current = $wanted ? $cart->alternativeTo($wanted['offer']) : null;
@endphp
@if ($wanted && $current)
<div class="shop-switch ui-notice ui-notice-warning" role="region" aria-labelledby="shop-switch-title">
<p id="shop-switch-title" class="ui-notice-title">Optionen wechseln?</p>
<p>In deinem Warenkorb liegt bereits „{{ $current->optionName() }}“. Diese Produktseite wird nur mit einer Option bestellt. Möchtest du zu „{{ $wanted['name'] }}“ wechseln?</p>
<div class="shop-actions">
<form method="post" action="{{ route('cart.switch', $wanted['offer']) }}">
@csrf
<button class="button" type="submit">Zu „{{ $wanted['name'] }}“ wechseln</button>
</form>
<a class="button button-secondary" href="{{ route('public.program', $wanted['offer']->composition_id) }}">Bei „{{ $current->optionName() }}“ bleiben</a>
</div>
</div>
@endif
@endif
<ul class="shop-option-list">
@foreach ($options as $option)
<li class="shop-option">
<h3>{{ $option['name'] }}</h3>
<p class="shop-price"><span class="sr-only">Preis: </span>{{ $option['price'] }}</p>
<dl class="shop-facts">
<div><dt>Geeignet für</dt><dd>{{ $option['for'] }}</dd></div>
<div><dt>Laufzeit</dt><dd>{{ $option['term'] }}</dd></div>
<div><dt>Nutzerkreis</dt><dd>{{ $option['licence'] }}</dd></div>
</dl>
@if ($option['licence_note'])
<p class="shop-note">{{ $option['licence_note'] }}</p>
@endif
<h4>Umfang und Nutzungsrechte</h4>
<ul class="shop-scope">
@foreach ($option['scope'] as $item)
<li>
<strong>{{ $item['article'] }}</strong>
<span>{{ $item['purpose'] }}@if ($item['rights'] !== []): {{ implode(', ', $item['rights']) }}@endif</span>
</li>
@endforeach
</ul>
@if ($cart->has($option['offer']))
<p class="shop-in-cart">Im Warenkorb. <a href="{{ route('cart') }}">Zum Warenkorb</a></p>
@else
<form method="post" action="{{ route('cart.add', $option['offer']) }}">
@csrf
<button class="button" type="submit">In den Warenkorb<span class="sr-only">: {{ $option['name'] }}</span></button>
</form>
@endif
</li>
@endforeach
</ul>
</section>
@endif