@php $u = auth()->user(); $cfg = $u?->current_workspace_id ? \App\Models\WaProviderConfig::query()->forWorkspace($u->current_workspace_id)->first() : null; $sf = $u?->current_workspace_id ? \App\Models\WaStorefront::where('workspace_id', $u->current_workspace_id)->first() : null; $cur = $sf?->currency_code ?: 'INR'; @endphp
@include('user.store._sidebar', ['current' => 'coupons', 'cfg' => $cfg, 'sf' => $sf])
{{ __('Store / Coupons') }}

{{ __('Discount codes') }}

{{ __('Codes customers can apply at checkout — percent or flat off, with optional minimum spend, cap, free shipping, expiry and usage limit.') }}

@if (session('status'))
{{ session('status') }}
@endif @if ($errors->any())
@foreach ($errors->all() as $e)
{{ $e }}
@endforeach
@endif {{-- Create --}}
@csrf
{{ __('New coupon') }}
{{-- List --}}
@forelse ($coupons as $c) @empty @endforelse
{{ __('Code') }} {{ __('Discount') }} {{ __('Conditions') }} {{ __('Used') }} {{ __('Status') }}
{{ $c->code }} {{ $c->type === 'percent' ? $c->amount . '%' : \App\Models\WaProduct::formatCurrency($c->amount, $cur) }} @if ($c->free_shipping) + {{ __('free ship') }} @endif @if ($c->min_subtotal_minor) {{ __('min') }} {{ \App\Models\WaProduct::formatCurrency($c->min_subtotal_minor, $cur) }} @endif @if ($c->expires_at) · {{ __('exp') }} {{ $c->expires_at->format('d M Y') }} @endif @if ($c->usage_limit) · {{ __('limit') }} {{ $c->usage_limit }} @endif {{ $c->used_count }}
@csrf @method('PUT')
@csrf @method('DELETE')
{{ __('No coupons yet. Create one above.') }}
@if ($coupons->hasPages())
{{ $coupons->links() }}
@endif