diff --git a/app/Http/Controllers/Bo/Re7Controller.php b/app/Http/Controllers/Bo/Re7Controller.php index 858a928..0c2fef4 100644 --- a/app/Http/Controllers/Bo/Re7Controller.php +++ b/app/Http/Controllers/Bo/Re7Controller.php @@ -79,6 +79,10 @@ class Re7Controller extends Controller $this->getRandomWeightedElementIndex($settings->web_coupons) ); + if (!$settings->reductions_activated) { + return abort(404); + } + $crmCoupon = new Reduction(); return view('theme::pages.participation.won', compact('discount', 'crmCoupon')); } @@ -118,6 +122,12 @@ class Re7Controller extends Controller */ public function mailDiscount(): View { + /** @var \App\Models\Settings */ + $settings = app(Settings::class); + if (!$settings->reductions_activated) { + return abort(404); + } + return view('back::pages.re7-preview-mail', [ 'render_url' => route('re7.mail-print', [ 'type' => 'discount' diff --git a/resources/views/layouts/re7-offcanvas.blade.php b/resources/views/layouts/re7-offcanvas.blade.php index 0768842..6355de9 100644 --- a/resources/views/layouts/re7-offcanvas.blade.php +++ b/resources/views/layouts/re7-offcanvas.blade.php @@ -21,10 +21,12 @@
{{ __('Participation') }} - {{-- WON BR --}} - {{ __('Bon de réduction') }} + @if ($settingsGlobal->reductions_activated) + {{-- WON BR --}} + {{ __('Bon de réduction') }} + @endif {{-- WON PRIZE --}} @foreach (\App\Models\Prize::getCached() as $prize) @@ -50,10 +52,12 @@
{{ __('Mails') }} - {{-- WON BR MAIL --}} - {{ __('Bon de réduction') }} + @if ($settingsGlobal->reductions_activated) + {{-- WON BR MAIL --}} + {{ __('Bon de réduction') }} + @endif {{-- WON PRIZE MAIL --}} @foreach (\App\Models\Prize::getCached() as $prize)