yoco updated to use webhook
This commit is contained in:
@@ -0,0 +1,420 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Order #' . $order->order_number . ' - Order Details')
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
/* Page-specific typography overrides */
|
||||
h1 {
|
||||
font-family: 'Abril Fatface', cursive;
|
||||
font-size: 2.5rem;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: 'Abril Fatface', cursive;
|
||||
font-size: 1.6rem;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-family: var(--font-sans);
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.page-intro {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.page-intro p {
|
||||
color: var(--text-secondary);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
/* Card styles */
|
||||
.card {
|
||||
padding: var(--spacing-lg);
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.card-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
padding-bottom: var(--spacing-lg);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.card-section:last-child {
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.content-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
gap: var(--spacing-lg);
|
||||
}
|
||||
|
||||
/* Order items styling */
|
||||
.order-item {
|
||||
padding: var(--spacing-md);
|
||||
background-color: white;
|
||||
border-radius: 20px;
|
||||
margin-bottom: var(--spacing-md);
|
||||
border: 1px solid var(--border-color);
|
||||
transition: var(--transition);
|
||||
}
|
||||
|
||||
.order-item:hover {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.item-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.item-name {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.item-price {
|
||||
font-weight: 700;
|
||||
color: var(--accent-dark);
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.item-meta {
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* Payment action styling */
|
||||
.payment-action-box {
|
||||
padding: var(--spacing-lg);
|
||||
border-radius: 20px;
|
||||
margin-top: var(--spacing-lg);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.payment-action-box.pending {
|
||||
background-color: var(--accent-light);
|
||||
border: 2px solid var(--accent-dark);
|
||||
}
|
||||
|
||||
.payment-action-box.failed {
|
||||
background-color: var(--accent-light);
|
||||
border: 2px solid var(--accent-dark);
|
||||
}
|
||||
|
||||
.payment-action-box.success {
|
||||
background-color: var(--accent-light);
|
||||
border: 2px solid var(--accent-dark);
|
||||
}
|
||||
|
||||
.payment-amount {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.payment-amount-label {
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.9rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.payment-amount-value {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.pending .payment-amount-value {
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.failed .payment-amount-value {
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.success .payment-amount-value {
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-block;
|
||||
padding: 1rem 2rem;
|
||||
background-color: var(--accent-dark);
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 20px;
|
||||
font-weight: 600;
|
||||
transition: var(--transition);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
background-color: var(--accent-pink);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.btn-pending {var(--accent-dark);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-failed {
|
||||
background-color: var(--accent-dark)
|
||||
background-color: #dc3545;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.success-check {
|
||||
font-sivar(--accent-dark)m;
|
||||
color: #28a745;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 0.4rem 0.8rem;
|
||||
border-radius: 20px;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.status-badge.paid {var(--accent-light);
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.status-badge.pending {
|
||||
background-color: var(--accent-light);
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.status-badge.failed {
|
||||
background-color: var(--accent-light);
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.status-badge.processing {
|
||||
background-color: var(--accent-light);
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.status-badge.shipped {
|
||||
background-color: var(--accent-light);
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.status-badge.delivered {
|
||||
background-color: var(--accent-light);
|
||||
color: var(--accent-dark)or: #d4edda;
|
||||
color: #155724;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.content-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
.payment-action-box {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.payment-amount {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="page-intro">
|
||||
<h1>Order Details</h1>
|
||||
<p>Order #{{ $order->order_number }}</p>
|
||||
</div>
|
||||
|
||||
<div class="content-grid">
|
||||
<!-- Main Content -->
|
||||
<div>
|
||||
<!-- Order Status -->
|
||||
<div class="card">
|
||||
<h2>Order Status</h2>
|
||||
<div class="card-section">
|
||||
<span class="status-badge {{ $order->status }}">
|
||||
{{ str_replace('_', ' ', ucfirst($order->status)) }}
|
||||
</span>
|
||||
<p style="margin-top: var(--spacing-sm); color: var(--text-secondary); font-size: 0.9rem;">
|
||||
Ordered on {{ $order->created_at->format('d M Y \a\t H:i') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Order Items -->
|
||||
<div class="card">
|
||||
<h2>Order Items</h2>
|
||||
@foreach($order->items as $item)
|
||||
<div class="order-item">
|
||||
<div class="item-header">
|
||||
<div>
|
||||
<div class="item-name">{{ $item->product->name }}</div>
|
||||
<div class="item-meta">{{ $item->type }}</div>
|
||||
@if($item->length)
|
||||
<div class="item-meta">Length: {{ $item->length }}m</div>
|
||||
@endif
|
||||
@if($item->width && $item->height)
|
||||
<div class="item-meta">Dimensions: {{ $item->width }}m × {{ $item->height }}m</div>
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<div class="item-price">R {{ number_format($item->price, 2) }}</div>
|
||||
<div class="item-meta" style="text-align: right;">Qty: {{ $item->quantity }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<!-- Shipping Details -->
|
||||
<div class="card">
|
||||
<h2>Delivery Details</h2>
|
||||
|
||||
<div class="card-section">
|
||||
<h3>Customer Information</h3>
|
||||
<dl style="color: var(--text-secondary);">
|
||||
<div class="spec-group">
|
||||
<dt>Name:</dt>
|
||||
<dd>{{ $order->customer_name }}</dd>
|
||||
</div>
|
||||
<div class="spec-group">
|
||||
<dt>Email:</dt>
|
||||
<dd>{{ $order->customer_email }}</dd>
|
||||
</div>
|
||||
<div class="spec-group">
|
||||
<dt>Phone:</dt>
|
||||
<dd>{{ $order->customer_phone }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="card-section">
|
||||
<h3>Shipping Address</h3>
|
||||
<p style="color: var(--text-secondary); line-height: 1.6;">{{ $order->shipping_address }}</p>
|
||||
</div>
|
||||
|
||||
@if($order->notes)
|
||||
<div class="card-section">
|
||||
<h3>Order Notes</h3>
|
||||
<p style="color: var(--text-secondary);">{{ $order->notes }}</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div>
|
||||
<!-- Order Summary & Payment -->
|
||||
<div class="card">
|
||||
<h2>Order Summary</h2>
|
||||
|
||||
<div class="card-section">
|
||||
<div class="payment-row" style="display: flex; justify-content: space-between; margin-bottom: var(--spacing-sm); color: var(--text-secondary);">
|
||||
<span>Subtotal:</span>
|
||||
<span>R {{ number_format($order->total, 2) }}</span>
|
||||
</div>
|
||||
<div class="payment-row total" style="display: flex; justify-content: space-between; border-top: 2px solid var(--border-color); padding-top: var(--spacing-md); font-weight: 700; font-size: 1.2rem;">
|
||||
<span>Total:</span>
|
||||
<span>R {{ number_format($order->total, 2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 style="margin-top: var(--spacing-lg); margin-bottom: var(--spacing-md);">Payment Status</h3>
|
||||
|
||||
<div style="padding: var(--spacing-sm); background-color: var(--accent-light); border-radius: 20px; margin-bottom: var(--spacing-lg);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<strong>Payment</strong>
|
||||
<span class="status-badge {{ $order->payment_status }}">{{ ucfirst($order->payment_status) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Payment Actions -->
|
||||
@if($order->payment_status === 'pending' && $order->yoco_redirect_url)
|
||||
<div class="payment-action-box pending">
|
||||
<div>
|
||||
<h3 style="margin-top: 0; color: var(--accent-dark);">Payment Required</h3>
|
||||
<p style="color: var(--accent-dark); margin: var(--spacing-sm) 0 0 0;">Click below to complete your payment.</p>
|
||||
<a href="{{ $order->yoco_redirect_url }}"
|
||||
target="_blank"
|
||||
class="btn btn-pending"
|
||||
style="margin-top: var(--spacing-md);">
|
||||
Pay Now
|
||||
</a>
|
||||
</div>
|
||||
<div class="payment-amount">
|
||||
<div class="payment-amount-label">Amount Due</div>
|
||||
<div class="payment-amount-value">R {{ number_format($order->total, 2) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@elseif($order->payment_status === 'failed' && $order->yoco_redirect_url)
|
||||
<div class="payment-action-box failed">
|
||||
<div>
|
||||
<h3 style="margin-top: 0; color: var(--accent-dark);">Payment Failed</h3>
|
||||
<p style="color: var(--accent-dark); margin: var(--spacing-sm) 0 0 0;">Please try your payment again.</p>
|
||||
<a href="{{ $order->yoco_redirect_url }}"
|
||||
target="_blank"
|
||||
class="btn btn-failed"
|
||||
style="margin-top: var(--spacing-md);">
|
||||
Retry Payment
|
||||
</a>
|
||||
</div>
|
||||
<div class="payment-amount">
|
||||
<div class="payment-amount-label">Amount Due</div>
|
||||
<div class="payment-amount-value">R {{ number_format($order->total, 2) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@elseif($order->payment_status === 'paid')
|
||||
<div class="payment-action-box success">
|
||||
<div style="display: flex; gap: var(--spacing-md); align-items: flex-start;">
|
||||
<div class="success-check">✓</div>
|
||||
<div>
|
||||
<h3 style="margin-top: 0; color: var(--accent-dark);">Payment Received</h3>
|
||||
<p style="color: var(--accent-dark); margin: var(--spacing-sm) 0 0 0; font-size: 0.9rem;">Thank you! Your order is being processed.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Back Link -->
|
||||
<div style="text-align: center; margin-top: var(--spacing-lg);">
|
||||
<a href="{{ route('my-orders') }}" style="color: var(--accent-dark); text-decoration: none; font-weight: 600;">
|
||||
← Back to Orders
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,277 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'My Orders - Additional Design')
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
h1 {
|
||||
font-family: 'Abril Fatface', cursive;
|
||||
font-size: 2.5rem;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: 'Abril Fatface', cursive;
|
||||
font-size: 1.8rem;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.page-intro {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.page-intro p {
|
||||
color: var(--text-secondary);
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.orders-section {
|
||||
margin-bottom: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.btn-new {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.btn-new {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.table-container {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
thead {
|
||||
background-color: var(--bg-secondary);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
th {
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
text-align: left;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
tbody tr {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
tbody tr:hover {
|
||||
background-color: var(--bg-primary);
|
||||
}
|
||||
|
||||
td {
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
font-size: 0.95rem;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.order-number {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: 0.35rem 0.75rem;
|
||||
border-radius: 20px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.btn-view {
|
||||
color: var(--text-primary);
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
transition: var(--transition);
|
||||
}
|
||||
|
||||
.btn-view:hover {
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
background-color: var(--bg-secondary);
|
||||
border-radius: 8px;
|
||||
padding: var(--spacing-xl);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.empty-state p {
|
||||
font-size: 1.05rem;
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.empty-state a {
|
||||
color: var(--text-primary);
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
padding: var(--spacing-sm) var(--spacing-lg);
|
||||
background-color: var(--accent-dark);
|
||||
color: white;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
transition: var(--transition);
|
||||
}
|
||||
|
||||
.empty-state a:hover {
|
||||
background-color: #333;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
table {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
}
|
||||
|
||||
.btn-new {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="page-intro">
|
||||
<h1>My Orders</h1>
|
||||
<p>View your standard and custom orders</p>
|
||||
</div>
|
||||
|
||||
<!-- Standard Orders -->
|
||||
<div class="orders-section">
|
||||
<h2>Standard Orders</h2>
|
||||
|
||||
@if ($standardOrders->count() > 0)
|
||||
<div class="table-container">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Order #</th>
|
||||
<th>Date</th>
|
||||
<th>Total</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($standardOrders as $order)
|
||||
<tr>
|
||||
<td class="order-number">{{ $order->order_number }}</td>
|
||||
<td>{{ $order->created_at->format('d M Y') }}</td>
|
||||
<td><strong>R{{ number_format($order->total, 2) }}</strong></td>
|
||||
<td>
|
||||
<span class="status-badge {{ $order->status }}">
|
||||
{{ ucfirst(str_replace('_', ' ', $order->status)) }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('my-orders.detail', $order) }}" class="btn-view">View Details</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="empty-state">
|
||||
<p>You haven't placed any standard orders yet.</p>
|
||||
<a href="{{ route('wallpapers') }}">Browse Products</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Custom Orders -->
|
||||
<div class="orders-section">
|
||||
<div class="section-header">
|
||||
<h2 style="margin-bottom: 0;">Custom Orders</h2>
|
||||
<a href="{{ route('custom-orders.create') }}" class="btn btn-new">+ New Custom Order</a>
|
||||
</div>
|
||||
|
||||
@if ($customOrders->count() > 0)
|
||||
<div class="table-container">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Order #</th>
|
||||
<th>Type</th>
|
||||
<th>Total</th>
|
||||
<th>Status</th>
|
||||
<th>Deposit</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($customOrders as $order)
|
||||
<tr>
|
||||
<td class="order-number">{{ $order->order_number }}</td>
|
||||
<td class="capitalize">{{ ucfirst($order->type) }}</td>
|
||||
<td><strong>R{{ number_format($order->total_cost, 2) }}</strong></td>
|
||||
<td>
|
||||
<span class="status-badge {{ $order->status }}">
|
||||
{{ str_replace('_', ' ', ucfirst($order->status)) }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="status-badge {{ $order->deposit_status }}">
|
||||
{{ ucfirst($order->deposit_status) }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('custom-orders.show', $order) }}" class="btn-view">View Details</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="empty-state">
|
||||
<p>You haven't created any custom orders yet.</p>
|
||||
<a href="{{ route('custom-orders.create') }}">Create Custom Order</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,94 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<h1 class="text-3xl font-bold mb-8">Pending Payments</h1>
|
||||
|
||||
@if($orders->isEmpty())
|
||||
<div class="bg-blue-50 border border-blue-200 rounded-lg p-6">
|
||||
<p class="text-blue-800">You have no pending payments. All your orders are either paid or cancelled.</p>
|
||||
<a href="{{ route('order-history') }}" class="mt-4 inline-block text-blue-600 hover:text-blue-800 font-semibold">
|
||||
← Back to Order History
|
||||
</a>
|
||||
</div>
|
||||
@else
|
||||
<div class="space-y-4">
|
||||
@foreach($orders as $order)
|
||||
<div class="border border-gray-200 rounded-lg p-6 hover:shadow-lg transition-shadow">
|
||||
<div class="flex justify-between items-start mb-4">
|
||||
<div>
|
||||
<h2 class="text-xl font-semibold text-gray-900">{{ $order->order_number }}</h2>
|
||||
<p class="text-sm text-gray-600">
|
||||
Ordered: {{ $order->created_at->format('M d, Y @ H:i') }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<p class="text-2xl font-bold text-gray-900">R {{ number_format($order->total, 2) }}</p>
|
||||
<span class="inline-block mt-2 px-3 py-1 bg-yellow-100 text-yellow-800 text-xs font-semibold rounded-full">
|
||||
@if($order->payment_status === 'pending')
|
||||
Payment Pending
|
||||
@elseif($order->payment_status === 'failed')
|
||||
Payment Failed
|
||||
@else
|
||||
{{ ucfirst($order->payment_status) }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-gray-50 rounded p-4 mb-4">
|
||||
<h3 class="font-semibold text-gray-900 mb-3">Order Items</h3>
|
||||
<div class="space-y-2">
|
||||
@foreach($order->items as $item)
|
||||
<div class="flex justify-between text-sm text-gray-700">
|
||||
<span>{{ $item->product->name }}</span>
|
||||
<span>{{ $item->quantity }} x R {{ number_format($item->price, 2) }}</span>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4 text-sm mb-4 pb-4 border-b border-gray-200">
|
||||
<div>
|
||||
<p class="text-gray-600">Customer Name</p>
|
||||
<p class="font-semibold text-gray-900">{{ $order->customer_name }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-gray-600">Shipping Address</p>
|
||||
<p class="font-semibold text-gray-900">{{ $order->shipping_address }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($order->yoco_redirect_url)
|
||||
<div class="flex gap-3">
|
||||
<a href="{{ $order->yoco_redirect_url }}"
|
||||
target="_blank"
|
||||
class="flex-1 bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-4 rounded-lg text-center transition-colors">
|
||||
Complete Payment with Yoco
|
||||
</a>
|
||||
<a href="{{ route('order-history') }}"
|
||||
class="flex-1 bg-gray-200 hover:bg-gray-300 text-gray-800 font-semibold py-3 px-4 rounded-lg text-center transition-colors">
|
||||
Back
|
||||
</a>
|
||||
</div>
|
||||
@else
|
||||
<div class="bg-red-50 border border-red-200 rounded p-4">
|
||||
<p class="text-red-800 text-sm">
|
||||
<strong>Note:</strong> Payment link is not available for this order. Please contact support.
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="mt-8">
|
||||
<a href="{{ route('order-history') }}" class="text-blue-600 hover:text-blue-800 font-semibold">
|
||||
← Back to All Orders
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,275 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'My Account - Additional Design')
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
h1 {
|
||||
font-family: 'Abril Fatface', cursive;
|
||||
font-size: 2.5rem;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.page-intro {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.page-intro p {
|
||||
color: var(--text-secondary);
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.account-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
gap: var(--spacing-lg);
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.card {
|
||||
background: white;
|
||||
padding: var(--spacing-lg);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
font-family: 'Abril Fatface', cursive;
|
||||
font-size: 1.8rem;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.card h3 {
|
||||
font-family: var(--font-sans);
|
||||
font-size: 1.3rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group textarea {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
font-size: 1rem;
|
||||
font-family: inherit;
|
||||
background-color: var(--bg-primary);
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--text-primary);
|
||||
box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.account-type {
|
||||
padding: var(--spacing-sm) 0;
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: 0.4rem 1rem;
|
||||
border-radius: 20px;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.badge-admin {
|
||||
background-color: var(--accent-pink);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.badge-customer {
|
||||
background-color: var(--accent-light);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.sidebar-card {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.sidebar-card ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sidebar-card li {
|
||||
padding: 0.75rem 0;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.sidebar-card li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.sidebar-card a {
|
||||
color: var(--text-primary);
|
||||
font-weight: 500;
|
||||
transition: var(--transition);
|
||||
}
|
||||
|
||||
.sidebar-card a:hover {
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.help-box {
|
||||
background-color: var(--accent-light);
|
||||
padding: var(--spacing-lg);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.help-box h3 {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.help-box p {
|
||||
font-size: 0.95rem;
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.help-box a {
|
||||
font-weight: 600;
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
|
||||
.alert {
|
||||
padding: var(--spacing-sm);
|
||||
border-radius: 4px;
|
||||
margin-bottom: var(--spacing-lg);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.alert-success {
|
||||
background-color: #e8f5e9;
|
||||
border: 1px solid #c8e6c9;
|
||||
color: #2e7d32;
|
||||
}
|
||||
|
||||
.btn-logout {
|
||||
color: #c53030;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
transition: var(--transition);
|
||||
}
|
||||
|
||||
.btn-logout:hover {
|
||||
color: #a02424;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.account-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="page-intro">
|
||||
<h1>My Account</h1>
|
||||
<p>Manage your profile and view your orders</p>
|
||||
</div>
|
||||
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="account-grid">
|
||||
<!-- Profile Section -->
|
||||
<div>
|
||||
<div class="card">
|
||||
<h2>Profile Information</h2>
|
||||
|
||||
<form action="{{ route('my-account.update') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" id="name" name="name" value="{{ auth()->user()->name }}" required>
|
||||
@error('name')
|
||||
<p style="color: #c53030; font-size: 0.9rem; margin-top: 0.25rem;">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" id="email" name="email" value="{{ auth()->user()->email }}" required>
|
||||
@error('email')
|
||||
<p style="color: #c53030; font-size: 0.9rem; margin-top: 0.25rem;">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group account-type">
|
||||
<label>Account Type</label>
|
||||
@if (auth()->user()->is_admin)
|
||||
<span class="badge badge-admin">Admin</span>
|
||||
@else
|
||||
<span class="badge badge-customer">Customer</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn">Update Profile</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div>
|
||||
<div class="card sidebar-card">
|
||||
<h3>Quick Links</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ route('my-orders') }}">📦 My Orders</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('custom-orders.create') }}">➕ New Custom Order</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="help-box">
|
||||
<h3>Need Help?</h3>
|
||||
<p>Contact us for assistance with your account or orders.</p>
|
||||
<a href="mailto:support@example.com">support@example.com</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; padding: var(--spacing-lg) 0; border-top: 1px solid var(--border-color);">
|
||||
<form action="{{ route('logout') }}" method="POST" style="display: inline;">
|
||||
@csrf
|
||||
<button type="submit" class="btn-logout">Sign Out</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user