@extends('layouts.app') @section('title', 'Checkout') @section('content')

Checkout

@csrf @if($errors->any())

Please fix the following errors:

    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @if(session('error'))

{{ session('error') }}

@endif
{{-- Checkout Form --}}
{{-- Shipping Address --}}

Shipping Address

@if($addresses->count() > 0)
@foreach($addresses as $index => $address) @endforeach
@else

You need a saved address to place an order.

Add Address โ†’
@endif @error('shipping_address_id')

{{ $message }}

@enderror
{{-- Delivery Type --}}

Delivery Method

@if($pickupHubs->count() > 0) @endif
{{-- Billing Address --}}

Billing Address

{{-- Payment Method --}}

Payment Method

{{-- Card --}} {{-- Paystack --}} {{-- MTN Mobile Money --}} {{-- Telecel Money --}} {{-- Cash on Delivery --}} {{-- PayPal --}}
{{-- Coupon Code --}}

Coupon Code

{{-- Order Notes --}}

Order Notes (Optional)

{{-- Order Summary --}}

Order Summary

@foreach($cartData['items'] as $item)
@if($item->product->primaryImage) {{ $item->product->name }} @else
{{ substr($item->product->name, 0, 1) }}
@endif

{{ $item->product->name }}

Qty: {{ $item->quantity }}

@if(($item->product->warehouse ?? 'ghana') === 'china') ๐Ÿ‡จ๐Ÿ‡ณ Ships from China ยท ~{{ $item->product->china_freight_days ?? 21 }} days @else ๐Ÿ‡ฌ๐Ÿ‡ญ Ships from Ghana @endif
{{ price(($item->variant?->price ?? $item->product->price) * $item->quantity) }}
@endforeach
@php $hasChinaItems = $cartData['items']->some(fn($item) => ($item->product->warehouse ?? 'ghana') === 'china'); $hasGhanaItems = $cartData['items']->some(fn($item) => ($item->product->warehouse ?? 'ghana') === 'ghana'); @endphp @if($hasChinaItems && $hasGhanaItems)

โš ๏ธ Your order contains items from both Ghana and China warehouses

Ghana items will ship immediately. China items will ship separately after freight arrival (~{{ $cartData['items']->first(fn($i) => ($i->product->warehouse ?? 'ghana') === 'china')?->product->china_freight_days ?? 21 }} working days).

@elseif($hasChinaItems)

๐Ÿ“ฆ All items ship from China warehouse

Estimated freight arrival: ~{{ $cartData['items']->first(fn($i) => ($i->product->warehouse ?? 'ghana') === 'china')?->product->china_freight_days ?? 21 }} working days

@endif
Subtotal {{ price($cartData['subtotal']) }}
Shipping $0.00
Tax $0.00
Total {{ price($cartData['subtotal']) }}
@if($addresses->count() === 0)

โš ๏ธ Please add a shipping address before placing an order

@endif

By placing your order, you agree to our Terms & Conditions

@push('scripts') @endpush @endsection