Release v1.5.1
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
use Core\Services\Plugins;
|
||||
|
||||
$pageTitle = $title ?? 'Store';
|
||||
$tablesReady = (bool)($tables_ready ?? false);
|
||||
$privateRoot = (string)($private_root ?? '');
|
||||
@@ -9,8 +11,11 @@ $newCustomers = is_array($new_customers ?? null) ? $new_customers : [];
|
||||
$currency = (string)($currency ?? 'GBP');
|
||||
$totalOrders = (int)($stats['total_orders'] ?? 0);
|
||||
$paidOrders = (int)($stats['paid_orders'] ?? 0);
|
||||
$totalRevenue = (float)($stats['total_revenue'] ?? 0);
|
||||
$beforeFees = (float)($stats['before_fees'] ?? 0);
|
||||
$paypalFees = (float)($stats['paypal_fees'] ?? 0);
|
||||
$afterFees = (float)($stats['after_fees'] ?? 0);
|
||||
$totalCustomers = (int)($stats['total_customers'] ?? 0);
|
||||
$reportsEnabled = Plugins::isEnabled('advanced-reporting');
|
||||
ob_start();
|
||||
?>
|
||||
<section class="admin-card">
|
||||
@@ -24,6 +29,9 @@ ob_start();
|
||||
<a href="/admin/store/settings" class="btn outline">Settings</a>
|
||||
<a href="/admin/store/orders" class="btn outline">Orders</a>
|
||||
<a href="/admin/store/customers" class="btn outline">Customers</a>
|
||||
<?php if ($reportsEnabled): ?>
|
||||
<a href="/admin/store/reports" class="btn outline">Sales Reports</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex; flex-wrap:wrap; gap:8px; margin-top:12px;">
|
||||
@@ -31,6 +39,9 @@ ob_start();
|
||||
<a href="/admin/store/settings" class="btn outline small">Settings</a>
|
||||
<a href="/admin/store/orders" class="btn outline small">Orders</a>
|
||||
<a href="/admin/store/customers" class="btn outline small">Customers</a>
|
||||
<?php if ($reportsEnabled): ?>
|
||||
<a href="/admin/store/reports" class="btn outline small">Sales Reports</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if (!$tablesReady): ?>
|
||||
@@ -62,8 +73,14 @@ ob_start();
|
||||
<div style="font-size:12px; color:var(--muted); margin-top:4px;">Paid: <?= $paidOrders ?></div>
|
||||
</div>
|
||||
<div class="admin-card" style="padding:14px;">
|
||||
<div class="label">Revenue</div>
|
||||
<div style="font-size:26px; font-weight:700; margin-top:8px;"><?= htmlspecialchars($currency, ENT_QUOTES, 'UTF-8') ?> <?= number_format($totalRevenue, 2) ?></div>
|
||||
<div class="label">Before Fees</div>
|
||||
<div style="font-size:26px; font-weight:700; margin-top:8px;"><?= htmlspecialchars($currency, ENT_QUOTES, 'UTF-8') ?> <?= number_format($beforeFees, 2) ?></div>
|
||||
<div style="font-size:12px; color:var(--muted); margin-top:4px;">Gross paid sales</div>
|
||||
</div>
|
||||
<div class="admin-card" style="padding:14px;">
|
||||
<div class="label">After Fees</div>
|
||||
<div style="font-size:26px; font-weight:700; margin-top:8px;"><?= htmlspecialchars($currency, ENT_QUOTES, 'UTF-8') ?> <?= number_format($afterFees, 2) ?></div>
|
||||
<div style="font-size:12px; color:var(--muted); margin-top:4px;">PayPal fees: <?= htmlspecialchars($currency, ENT_QUOTES, 'UTF-8') ?> <?= number_format($paypalFees, 2) ?></div>
|
||||
</div>
|
||||
<div class="admin-card" style="padding:14px;">
|
||||
<div class="label">Total Customers</div>
|
||||
@@ -86,7 +103,11 @@ ob_start();
|
||||
</div>
|
||||
<div style="display:flex; justify-content:space-between; gap:10px; color:var(--muted); font-size:12px; margin-top:4px;">
|
||||
<span><?= htmlspecialchars((string)($order['email'] ?? ''), ENT_QUOTES, 'UTF-8') ?></span>
|
||||
<span><?= htmlspecialchars((string)($order['currency'] ?? $currency), ENT_QUOTES, 'UTF-8') ?> <?= number_format((float)($order['total'] ?? 0), 2) ?></span>
|
||||
<span><?= htmlspecialchars((string)($order['currency'] ?? $currency), ENT_QUOTES, 'UTF-8') ?> <?= number_format((float)($order['payment_net'] ?? $order['total'] ?? 0), 2) ?></span>
|
||||
</div>
|
||||
<div style="display:flex; justify-content:space-between; gap:10px; color:var(--muted); font-size:12px; margin-top:4px;">
|
||||
<span>Before fees <?= htmlspecialchars((string)($order['currency'] ?? $currency), ENT_QUOTES, 'UTF-8') ?> <?= number_format((float)($order['payment_gross'] ?? $order['total'] ?? 0), 2) ?></span>
|
||||
<span>Fees <?= htmlspecialchars((string)($order['currency'] ?? $currency), ENT_QUOTES, 'UTF-8') ?> <?= number_format((float)($order['payment_fee'] ?? 0), 2) ?></span>
|
||||
</div>
|
||||
<div style="margin-top:8px;">
|
||||
<a href="/admin/store/order?id=<?= (int)($order['id'] ?? 0) ?>" class="btn outline small">View Order</a>
|
||||
|
||||
Reference in New Issue
Block a user