@extends('layouts.app') @section('content') @include('proedge.admin.discounts._styles') @php $hasFilters = request()->hasAny(['keyword', 'discount_type', 'status', 'partner']); @endphp
| Discount | @include('proedge.admin.discounts._th', ['field' => 'duration', 'label' => 'Duration'])Plans | @include('proedge.admin.discounts._th', ['field' => 'partner', 'label' => 'Partner']) @include('proedge.admin.discounts._th', ['field' => 'codes_count', 'label' => 'Codes']) @include('proedge.admin.discounts._th', ['field' => 'redemptions_count', 'label' => 'Used'])Budget | @include('proedge.admin.discounts._th', ['field' => 'is_active', 'label' => 'Status'])In Stripe | Options | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @if($offer->description) {{-- Hovering the name shows the note, the same as the Offer column on Promo Codes. Escaped: it is free text an admin typed. --}} {{ $offer->name }} {{ $offer->description }} @else {{ $offer->name }} @endif | {{ $offer->summary ?: $offer->discount_type }} | {{-- The same words the Add Offer form uses. "Once" and "Forever" on their own read as a number of payments, which they are not: a customer who renews early has more payments than months. --}} @if($offer->duration === 'months') {{ $offer->duration_in_months }} calendar month{{ $offer->duration_in_months == 1 ? '' : 's' }} @elseif($offer->duration === 'forever') Every renewal @else Signup payment only @endif | {{-- No rows means every plan, which is what an offer created before plans were tiered will show. --}} @forelse($offer->plans as $offerPlan) {{ $offerPlan->name }} @empty All plans @endforelse | {{ $offer->partner ?: '—' }} | {{ $offer->codes_count }} | {{ $offer->redemptions_count }} | @if($offer->budget_cap) {{ number_format((float) $offer->budget_used, 2) }} / {{ number_format((float) $offer->budget_cap, 2) }} @else — @endif | @if($offer->is_active) Active @else Inactive @endif @if($offer->auto_apply) @if($offer->usable_public_codes_count > 0) {{-- Worth its own badge: this one applies to customers who never asked for it. --}} Automatic @else {{-- Checkout applies an automatic offer by handing out one of its codes. With none live and unreserved there is nothing to hand out, and it silently does nothing. --}} Automatic — no code yet, won't apply @endif @endif |
@if($offer->externalId())
{{ $offer->externalId() }}
@else
trial — no coupon
@endif
|
{{-- Only the fields Stripe will still accept a change to. The percentage, amount and duration are fixed when the coupon is created, so they are shown on the row but never editable. --}} @if($offer->redemptions_count > 0) {{-- The ledger points at this offer and rule_snapshot is the only record of what was given, so it stays. --}} in use @else @php // Built here and JSON-encoded below, so the name is escaped // for JavaScript: an apostrophe in an offer name would // otherwise end the string and stop the handler compiling, // which submits the form with no confirmation at all. $deleteWarning = 'Delete ' . $offer->name . ($offer->codes_count ? ' and its ' . $offer->codes_count . ' code(s)' : '') . " from Poolpix and from Stripe?\n\nThis cannot be undone."; @endphp @endif |
@if($hasFilters)
No offers match those filters.
@else
No offers yet. Use the + button to create one, or run
php artisan discounts:sync in poolpix-website-api to import
anything that already exists in Stripe.
@endif
|
||||||||||