Trenne Shop sichtbar und Checkout offen und kaufe nur noch ueber die Kasse
CI Feature / test (push) Successful in 3m23s
Deploy Test / test (push) Successful in 3m22s
Deploy Test / deploy (push) Successful in 30s

- 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>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-26 07:17:25 +01:00
1 parent 28e3342b1f
commit 3d76062097
36 files changed
+756 -150

No files matched your search

+24
View File
@@ -3,6 +3,7 @@
namespace App\Domain\Cms;
use App\Domain\Cms\Widgets\Support\SafeUrl;
use App\Domain\Commerce\Shop;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -79,6 +80,11 @@ public function scopeVisible(Builder $query): void
public function href(): ?string
{
// Ein Menüpunkt in den Shop erscheint nicht, solange der Shop nicht sichtbar ist: Er führte ins Leere (404).
if ($this->pointsIntoShop() && ! Shop::visible()) {
return null;
}
if ($this->page !== null) {
return $this->page->path === '/' ? url('/') : url($this->page->path);
}
@@ -94,6 +100,24 @@ public function href(): ?string
return $this->url;
}
/** Ziel ist der Shop selbst oder eine seiner Seiten: Übersicht, Produktseiten, Hinweisseite, Warenkorb, Kasse. */
private function pointsIntoShop(): bool
{
$path = $this->targetPath();
if ($path === null) {
return false;
}
foreach (['/shop', '/warenkorb', '/kasse', '/kauf-noch-nicht-moeglich'] as $prefix) {
if ($path === $prefix || str_starts_with($path, $prefix.'/')) {
return true;
}
}
return false;
}
/**
* Pfad des Ziels innerhalb der Website (für die Kennzeichnung des aktiven Eintrags); null bei externen Zielen.
*/