@php /** * The subscription-plan catalogue, as Settings → Subscription plans renders it. * * Configuration only: what each plan costs, what it allows, and — per tier — how long a new * subscriber pays nothing before that price starts. It sits with tax and currency because it is the same kind of * thing — a number the operator sets. How the catalogue is PERFORMING is a different question, read * at a different moment, and lives on its own page (admin/plans.php). * * @var array $rows plans on this page * @var array $pager pagination metadata */ @endphp

{{ t_raw('admin.plans.table_title') }}

{{ t_raw('admin.plans.table_sub') }}

@if ($rows) @foreach ($rows as $p) @php /* "Unlimited" is not a number the sorter can rank, so it sorts as the largest allowance there is rather than as zero. */ @endphp @endforeach @else @partial('table-empty', ['colspan' => 9, 'icon' => 'fa-layer-group', 'msg' => t('admin.plans.empty')]) @endif
{{ t_raw('admin.plans.table_title') }}
{{ t_raw('admin.plans.col_plan') }}{{ t_raw('common.price') }}{{ t_raw('admin.plans.col_cycle') }}{{ t_raw('admin.plans.col_max_items') }}{{ t_raw('admin.plans.col_commission') }}{{ t_raw('admin.plans.col_restaurants') }}{{ t_raw('admin.plans.col_earnings') }}{{ t_raw('common.active') }}{{ t_raw('common.actions') }}
{!! plan_tag((string) $p['slug'], (string) $p['name']) !!} {{ money($p['price']) }} {{ status_label('billing_cycle', $p['billing_cycle']) }}{!! (int) $p['max_menu_items'] === 0 ? t('admin.plans.unlimited') : number_format((int) $p['max_menu_items']) !!} {{ $p['commission_percent'] }}% @if ((int) $p['restaurants'] > 0) {{ number_format((int) $p['restaurants']) }} {{ t_raw('admin.plans.active_subs_sub', [':n' => number_format((int) $p['active_subs'])]) }} @else {{ t_raw('admin.plans.nobody_on_plan') }} @endif {{ money($p['plan_earnings']) }} {{ t_raw('admin.plans.earnings_split', [':subs' => money($p['subscription_cash']), ':commission' => money($p['commission_cash'])]) }} {!! $p['is_active'] ? t('common.yes') : t('common.no') !!}
@php /* The toolbar addresses the page this table is rendered ON, which is Settings — /admin/plans is the performance half and draws no table at all, so pointing the pager and the rows-per-page picker there sent page two to a screen with no rows on it and put the rest of the catalogue out of reach. */ @endphp @partial('table-toolbar', ['pager' => $pager, 'base' => '/admin/settings'])
@php /* The trial belongs with the prices, because it is part of what a plan costs: it decides how long a new subscriber pays nothing before the price above starts. Platform-wide rather than per-tier — a trial is an acquisition offer, not a property of one plan — so it has its own card under the catalogue instead of a field inside the per-plan modal. */ @endphp