@include('vendor.partials.menu')
@include('vendor.partials.top-header')

{{ __('messages.promocode_list') }}

@if(request()->filled('search')) Réinitialiser @endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($promocodes->isEmpty())

{{ __('messages.promocode_list_none') }}

{{ __('messages.promocode_list_none_text') }}

@else
@foreach($promocodes as $promocode) @endforeach
{{ __('messages.create_promocode_promocode') }} {{ __('messages.create_promocode_type_reduction') }} {{ __('messages.create_promocode_value') }} {{ __('messages.create_promocode_min_cart') }} {{ __('messages.create_promocode_date_exp') }} Envoyer par mail Supprimer
{{ $promocode->code }}

ID : #{{ $promocode->id }}

@if($promocode->type === 'fixed') Montant fixe @else Pourcentage @endif
@if($promocode->type === 'percent') {{ number_format($promocode->value, 2, ',', ' ') }} % @else {{ number_format($promocode->value, 2, ',', ' ') }} € @endif
{{ $promocode->min_cart_amount !== null ? number_format($promocode->min_cart_amount, 2, ',', ' ') . ' €' : '-' }} {{ $promocode->expires_at ? \Carbon\Carbon::parse($promocode->expires_at)->format('d/m/Y H:i') : '-' }}
@csrf
@foreach($promocodes as $promocode)
{{ $promocode->code }}
{{ $promocode->code }}
{{ $promocode->id }} {{ $promocode->type === 'fixed' ? 'Montant fixe' : 'Pourcentage' }}

@if($promocode->type === 'percent') {{ number_format($promocode->value, 2, ',', ' ') }} % @else {{ number_format($promocode->value, 2, ',', ' ') }} € @endif

Type réduction {{ $promocode->type === 'fixed' ? 'Montant fixe' : 'Pourcentage' }}
Valeur @if($promocode->type === 'percent') {{ number_format($promocode->value, 2, ',', ' ') }} % @else {{ number_format($promocode->value, 2, ',', ' ') }} € @endif
Minimum panier {{ $promocode->min_cart_amount !== null ? number_format($promocode->min_cart_amount, 2, ',', ' ') . ' €' : '-' }}
Date expiration {{ $promocode->expires_at ? \Carbon\Carbon::parse($promocode->expires_at)->format('d/m/Y H:i') : '-' }}
@csrf
Supprimer
@endforeach
{{ $promocodes->links() }}
@endif