@extends('layouts.app') @section('title', 'Promotions') @section('page', 'products') @section('productsNav', 'promotions') @php $statusVariant = fn ($s) => $s === 'Active' ? 'success' : 'danger'; @endphp @section('content') @include('partials.products-nav') @if (session('success')) {{ session('success') }} @endif @if ($errors->any()) {{ $errors->first() }} @endif

Total

{{ $total }}

All promotions

Active

{{ $active }}

Live discounts

In App

{{ $inApp }}

Shown to customers

Inactive

{{ $inactive }}

Paused

@forelse ($promotions as $row) @php $groupIds = $row->priceGroups->pluck('id')->map(fn ($id) => (string) $id)->values()->all(); $groupNames = $row->priceGroups->map(fn ($g) => $g->short_label ?: $g->name)->implode(', '); $inPeriod = $row->isWithinActivePeriod(); @endphp {{ $row->product?->name ?? '—' }} @if ($row->product?->code)
{{ $row->product->code }}
@endif @if ($row->discount_type === 'percent') {{ rtrim(rtrim(number_format((float) $row->discount_value, 2, '.', ''), '0'), '.') }}% @else {{ money($row->discount_value) }} OFF @endif {{ $row->periodLabel() }} @if ($row->status === 'Active' && ! $inPeriod)
Outside period
@endif {{ $groupNames ?: '—' }} @if ($row->show_in_app) Shown @else Hidden @endif {{ $row->status }}
@csrf @method('DELETE')
@empty No promotions yet. Add a product discount here. @endforelse
@csrf
Each product can have one promotion.
Percent: 0–100. Fixed: amount in {{ currency_code() }}.
Leave blank for no end date. Empty both = always (while Active).
@forelse ($priceGroups as $group)
@empty

No active price groups found.

@endforelse
Tick the price groups that should receive this discount on POS.
@endsection @push('styles') @endpush @push('scripts') @endpush