- Zwei Schalter: Shop::visible (SHOP_PUBLIC) und Shop::checkoutOpen; ist der Shop nur sichtbar, fuehren Warenkorb, Kasse und Jetzt kaufen auf eine Hinweisseite (noindex), ohne Warenkorb und Bestellung - Einzelkauf (Checkout::place, Route member.offers.buy) entfernt; Bestellung nur aus dem Warenkorb - Jetzt kaufen an der Produktseite oeffnet die Bestellübersicht, Bereits erworben auf der Produktseite - Menuepunkte in den Shop nur bei sichtbarem Shop, /angebote leitet auf /shop, Seeder fuehrt Shop - Mitgliederseite Angebote zeigt nur kostenlose Angebote zum Uebernehmen - Middleware EnsureCheckoutOpen laeuft vor der Anmeldepruefung - Plan und ADR-53, DEPLOYMENT.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
23 lines
521 B
PHP
23 lines
521 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use App\Domain\Commerce\Shop;
|
|
use Closure;
|
|
use Illuminate\Http\Request;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
/**
|
|
* Schalter 1: Shop, Produktseiten und Hinweisseite gibt es nur, wenn der Shop sichtbar ist (Shop::visible). Sonst
|
|
* antwortet die Anwendung, als gäbe es sie nicht.
|
|
*/
|
|
class EnsureShopVisible
|
|
{
|
|
public function handle(Request $request, Closure $next): Response
|
|
{
|
|
abort_unless(Shop::visible(), 404);
|
|
|
|
return $next($request);
|
|
}
|
|
}
|