Pricing
The customer always pays the lowest of: base price, sale price, and any live rule. Checkout recalculates server-side.
@foreach (['overview' => 'Overview', 'base' => 'Base prices & bundles', 'sales' => 'Scheduled sales', 'coupons' => 'Coupons', 'history' => 'Price history'] as $k => $l)
@endforeach
@if ($tab === 'overview')
@php $c = $calendar; @endphp
{{ $c['start']->format('F Y') }} pricing calendar
1 {{ strtoupper($c['start']->format('M')) }}15{{ $c['days'] }} {{ strtoupper($c['start']->format('M')) }}
@forelse ($c['rules'] as $r)
@php
$from = max(1, $r->starts_at->month === $c['start']->month && $r->starts_at->year === $c['start']->year ? $r->starts_at->day : 1);
$to = $r->ends_at && $r->ends_at->month === $c['start']->month && $r->ends_at->year === $c['start']->year ? $r->ends_at->day : $c['days'];
$hex = $r->variant?->colour?->hex ?? $r->colour?->hex ?? '#111111';
$label = ['fixed_price' => '→ '.money($r->value), 'amount_off' => money($r->value).' off', 'percent_off' => ($r->value / 100).'% off'][$r->type->value];
@endphp
@empty
No sales this month.
@endforelse
@if (now()->isSameMonth($c['start']))
@endif
Pink line = today. Click a row to edit.
@endif
@if ($tab === 'base')
| Variant | Base | Sale | Customer pays | Source | |
@foreach ($variants as $row)
@php $v = $row['v']; $q = $row['quote']; @endphp
$priceVariantId === $v->id])>
| {{ $v->displayName() }}{{ $v->sku }}@if ($row['separate']) · separately {{ money($row['separate']) }}@endif |
{{ money($v->price) }} |
{{ $v->sale_price ? money($v->sale_price) : '—' }} |
{{ $q->unit }} |
@if ($q->source === 'rule'){{ $q->rule->name }}@elseif ($q->source === 'sale_price')Sale price@elseBase@endif |
|
@endforeach
@endif
@if ($tab === 'sales')
| Sale | Applies to | Change | When | Status | |
@forelse ($rules as $r)
| {{ $r->name }}@if ($r->campaign_key){{ $r->campaign_key }}@endif |
{{ $r->variant?->displayName() ?? $r->product?->name ?? ($r->colour ? 'All '.$r->colour->name : '—') }} |
{{ ['fixed_price' => '→ '.money($r->value), 'amount_off' => money($r->value).' off', 'percent_off' => ($r->value / 100).'% off'][$r->type->value] }} |
{{ $r->starts_at->format('j M, H:i') }} – {{ $r->ends_at?->format('j M, H:i') ?? 'ongoing' }} |
{{ $r->state() }} |
|
@empty
| No scheduled sales yet. |
@endforelse
@endif
@if ($tab === 'coupons')
| Code | Value | Used | Limit | Expires | Source | Status | |
@forelse ($coupons as $c)
@php $state = ! $c->is_active ? ['Paused', 'warn'] : ($c->ends_at?->isPast() ? ['Ended', null] : ($c->starts_at?->isFuture() ? ['Scheduled', 'info'] : ['Live', 'ok'])); @endphp
| {{ $c->code }} |
{{ $c->valueLabel() }}@if ($c->min_subtotal)min {{ money($c->min_subtotal) }}@endif |
{{ number_format($c->times_used) }} |
{{ $c->usage_limit ? number_format($c->usage_limit) : '—' }} |
{{ $c->ends_at?->format('j M Y') ?? '—' }} |
{{ $c->source }} |
{{ $state[0] }} |
|
@empty
| No coupons yet. |
@endforelse
@endif
@if ($tab === 'history')
| When | Variant | Field | Old | New | By | Reason |
@forelse ($history as $h)
| {{ $h->created_at->format('j M Y, H:i') }} | {{ $h->variant?->displayName() }}{{ $h->variant?->sku }} | {{ $h->field }} |
{{ $h->old_value !== null ? money($h->old_value) : '—' }} | {{ $h->new_value !== null ? money($h->new_value) : '—' }} | {{ $h->user?->name ?? 'System' }} | {{ $h->reason }} |
@empty
| No price changes recorded. |
@endforelse
@endif