@extends('storefront.layout') @section('title', 'Checkout') @section('content') @php $enabledMethods = (array) ($checkoutConfig['payment_methods'] ?? ['stripe', 'cash_on_delivery']); $methodLabels = [ 'stripe' => 'Credit Card', 'cash_on_delivery' => 'Cash on Delivery', 'bank_transfer' => 'Bank Transfer', 'easypaisa' => 'EasyPaisa', 'jazzcash' => 'JazzCash', ]; $methodIcons = (array) ($checkoutConfig['payment_icons'] ?? []); $paymentAccounts = (array) ($checkoutConfig['payment_accounts'] ?? []); $paymentCfg = (array) ($checkoutConfig['payment'] ?? []); $shippingCfg = (array) ($checkoutConfig['shipping'] ?? []); $shippingOptions = (array) ($checkoutConfig['shipping_options'] ?? []); $shippingLookup = (array) ($checkoutConfig['shipping_lookup'] ?? [ 'countries' => [], 'cities_by_country' => [], 'global_cities' => [], 'areas_by_country' => [], 'global_areas' => [], 'area_hints' => [], 'zip_hints' => [], ]); $proofRequiredMethods = (array) ($paymentCfg['proof_required_methods'] ?? []); $transactionIdRequiredMethods = (array) ($paymentCfg['transaction_id_required_methods'] ?? []); $selectedMethod = old('payment_method', in_array('stripe', $enabledMethods, true) ? 'stripe' : ($enabledMethods[0] ?? 'cash_on_delivery')); $selectedShipping = old('shipping_option', $summary['selected_shipping_option'] ?? (!empty($shippingCfg['allow_pickup']) ? 'pickup' : (($shippingOptions[0]['key'] ?? '')))); $couponConfigJs = $checkoutConfig['coupon'] ?? ['is_active' => false, 'code' => '', 'type' => 'fixed', 'value' => 0]; @endphp Checkout @if($errors->any()) @foreach($errors->all() as $err) {{ $err }} @endforeach @endif @csrf @if(!empty($newCustomerDiscount)) @php $ncd = $newCustomerDiscount; $ncdValue = $ncd->discount_type === 'percentage' ? $ncd->value . '% off' : format_currency($ncd->value) . ' off'; @endphp 🎁 New customer? Create an account and get {{ $ncdValue }} on your first order! @if($ncd->is_coupon && $ncd->coupon_code) Use code {{ $ncd->coupon_code }} at checkout. @endif Create Account & Save @endif Customer details Guest Checkout Create Account & Checkout Full name Phone Email Note Password Confirm password @if(!empty($shippingCfg['allow_delivery']) || !empty($shippingCfg['allow_pickup'])) Shipping {{-- Method selector cards --}} @if(!empty($shippingCfg['allow_pickup'])) Pickup Free @endif @foreach($shippingOptions as $opt) {{ $opt['label'] ?? 'Delivery' }} {{ format_currency((float)($opt['fee'] ?? 0)) . (!empty($opt['is_distance']) ? '/km' : '') }} @endforeach Locate on map Use GPS to complete your address (same as postal lookup). Detect Per-kilometer rates use the distance above; other delivery options use a flat package fee. {{-- Country + ZIP · State/province + City + Area (one row) — packages + OpenStreetMap --}} @php $countryNames = ['af'=>'Afghanistan','al'=>'Albania','dz'=>'Algeria','ao'=>'Angola','ar'=>'Argentina','au'=>'Australia','at'=>'Austria','bd'=>'Bangladesh','be'=>'Belgium','br'=>'Brazil','ca'=>'Canada','cl'=>'Chile','cn'=>'China','co'=>'Colombia','cd'=>'DR Congo','hr'=>'Croatia','cz'=>'Czech Republic','dk'=>'Denmark','eg'=>'Egypt','et'=>'Ethiopia','fi'=>'Finland','fr'=>'France','de'=>'Germany','gh'=>'Ghana','gr'=>'Greece','gt'=>'Guatemala','hn'=>'Honduras','hk'=>'Hong Kong','hu'=>'Hungary','in'=>'India','id'=>'Indonesia','ir'=>'Iran','iq'=>'Iraq','ie'=>'Ireland','il'=>'Israel','it'=>'Italy','jp'=>'Japan','jo'=>'Jordan','ke'=>'Kenya','kr'=>'South Korea','kw'=>'Kuwait','lb'=>'Lebanon','ly'=>'Libya','my'=>'Malaysia','mx'=>'Mexico','ma'=>'Morocco','mm'=>'Myanmar','nl'=>'Netherlands','nz'=>'New Zealand','ng'=>'Nigeria','no'=>'Norway','om'=>'Oman','pk'=>'Pakistan','pe'=>'Peru','ph'=>'Philippines','pl'=>'Poland','pt'=>'Portugal','qa'=>'Qatar','ro'=>'Romania','ru'=>'Russia','sa'=>'Saudi Arabia','sn'=>'Senegal','za'=>'South Africa','es'=>'Spain','lk'=>'Sri Lanka','sd'=>'Sudan','se'=>'Sweden','ch'=>'Switzerland','sy'=>'Syria','tw'=>'Taiwan','tz'=>'Tanzania','th'=>'Thailand','tn'=>'Tunisia','tr'=>'Turkey','ug'=>'Uganda','ae'=>'United Arab Emirates','gb'=>'United Kingdom','us'=>'United States','ve'=>'Venezuela','vn'=>'Vietnam','ye'=>'Yemen','zw'=>'Zimbabwe']; @endphp Country Select country @foreach((array) ($shippingLookup['countries'] ?? []) as $countryCode) {{ $countryNames[strtolower($countryCode)] ?? strtoupper($countryCode) }} @endforeach Postal / ZIP State / Province City @foreach((array) ($shippingLookup['global_cities'] ?? []) as $cityName) @endforeach Area / locality @foreach((array) ($shippingLookup['global_areas'] ?? []) as $areaName) @endforeach Street address Shipping {{ $summary['formatted_shipping_fee'] ?? format_currency(0) }} · Order total {{ $summary['formatted_payable_total_after_coupon'] ?? ($summary['formatted_payable_total'] ?? format_currency(0)) }} {{-- /sfDeliveryAddressSection --}} @endif Coupon Coupon code Apply Payment method @foreach($enabledMethods as $method) @php $icon = $methodIcons[$method] ?? null; @endphp @if($icon) @else @endif {{ $methodLabels[$method] ?? ucfirst(str_replace('_', ' ', $method)) }} @endforeach Name on card Card number Expiry (MM/YY) CVC Your card will be securely charged using the selected payment gateway. Pay to the branch account below, then upload paid screenshot. — Copy Transaction ID * Where do I find this? After completing the payment, open your app → go to Transaction History → copy the Transaction ID shown there. Attach Payment Screenshot * Tap to select your payment receipt / screenshot Order amount paid Click on Process Order button below. ✕ Remove Process My Order {{ $summary['formatted_payable_total_after_coupon'] ?? ($summary['formatted_payable_total'] ?? '') }} @endsection
{{ $err }}
{{ $ncd->coupon_code }}
Per-kilometer rates use the distance above; other delivery options use a flat package fee.
Your card will be securely charged using the selected payment gateway.
Pay to the branch account below, then upload paid screenshot.
—
Order amount paid
Click on Process Order button below.