Files
laraundfelix/resources/views/shop/optionen.blade.php
T
LarsandClaude Sonnet 5.5 1ce2e1e51f Gib Paketen eine eigene Produktseite und ergänze Tests zu Nutzerkreis und Verkaufsstart
Ein eigenständig vermarktetes Paket (offers.standalone_bundle) erhält /pakete/{id}
mit seinem tatsächlichen Umfang, Shop-Kachel und Suche. Die Angebotsmaske kennt
Nutzerkreis und Anzahl Trainer. Zwei Bestandstests (CartTest, Vergleich der
Rechte und Erwerbsarten) legen die Vergleichsangebote jetzt als Einzellizenz an,
weil der Nutzerkreis zum identischen Umfang gehört; ihre Aussagen bleiben.
Eine Rechnungs- oder Stripe-Bestellung lässt sich nicht mit der Testzahlung bestätigen.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 19:47:15 +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="{{ app(\App\Domain\Commerce\ProductOptions::class)->pageUrl($wanted['offer']) }}">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