@extends('front.layout') @section('styles') @endsection @section('pagename') - {{ $pageHeading ?? __('Checkout') }} @endsection @section('meta-description', !empty($seo) ? $seo->checkout_meta_description : '') @section('meta-keywords', !empty($seo) ? $seo->checkout_meta_keywords : '') @php $d_none = 'none'; $d_block = 'block'; if (!function_exists('getGatewayIcon')) { function getGatewayIcon($name) { $name = strtolower($name); if (strpos($name, 'paypal') !== false) return 'fab fa-paypal'; if (strpos($name, 'stripe') !== false) return 'fab fa-stripe'; if (strpos($name, 'razorpay') !== false) return 'fal fa-credit-card'; if (strpos($name, 'paystack') !== false) return 'fal fa-wallet'; if (strpos($name, 'flutterwave') !== false) return 'fal fa-money-bill-wave'; if (strpos($name, 'authorize') !== false) return 'fal fa-university'; if (strpos($name, 'iyzico') !== false) return 'fal fa-credit-card'; if (strpos($name, 'paytm') !== false) return 'fal fa-money-check'; if (strpos($name, 'offline') !== false) return 'fal fa-money-bill-wave'; return 'fal fa-credit-card'; } } @endphp @section('breadcrumb-title') {{ $pageHeading ?? __('Checkout') }} @endsection @section('breadcrumb-link') {{ $pageHeading ?? __('Checkout') }} @endsection @section('content') {{-- Page Header --}} {{ __('Secure Checkout') }} {{ __('Complete Your Order') }} {{ __('You\'re one step away from launching your dream store. Fill in the details below.') }} {{-- Step indicators --}} 1 {{ __('Plan') }} 2 {{ __('Details') }} 3 {{ __('Launch') }} @php $data = $data ?? session('data') ?? []; $reqHost = strtolower(trim((string)(request()->getHost() ?: ($_SERVER['HTTP_HOST'] ?? '')))); $reqHost = preg_replace('/:\d+$/', '', $reqHost); $reqHost = preg_replace('/^www\./i', '', $reqHost); $cleanAgencyHost = preg_replace('/^(launchshop|checkout|app|www|websitebuilder|website-builder|whatsappbulk|whatsapp-bulk|whatsapp|wa|ecombuilder|ecom-builder)\./i', '', $reqHost); $cleanAgencyHost = preg_replace('/^(launchshop|checkout|app|www|websitebuilder|website-builder|whatsappbulk|whatsapp-bulk|whatsapp|wa|ecombuilder|ecom-builder)\./i', '', $reqHost); $scheme = (request()->secure() || str_contains(request()->fullUrl(), 'https://') || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')) ? 'https://' : 'http://'; $isLaunchShopHost = in_array($reqHost, ['launchshop.in', 'www.launchshop.in', 'localhost', '127.0.0.1']) || str_ends_with($reqHost, 'launchshop.in') || str_contains($reqHost, 'launchshop'); if (!$isLaunchShopHost && !empty($cleanAgencyHost) && !in_array($cleanAgencyHost, ['localhost', '127.0.0.1', 'in', 'com'])) { $checkoutFormAction = "{$scheme}checkout.{$cleanAgencyHost}/membership/checkout"; } else { $checkoutFormAction = route('front.membership.checkout'); } @endphp {{-- Main checkout form --}} @csrf @if ($errors->any()) {{ __('Please resolve the following before placing your order:') }} @foreach ($errors->all() as $error) {{ $error }} @endforeach @endif {{-- Hidden fields --}} @if (($data['status'] ?? '') === 'trial') @else @if (isset($data['package']) && $data['package']->term === 'daily') @elseif(isset($data['package']) && $data['package']->term === 'weekly') @elseif(isset($data['package']) && $data['package']->term === 'monthly') @elseif(isset($data['package']) && $data['package']->term === 'lifetime') @else @endif @endif {{-- ===================== LEFT COLUMN ===================== --}} {{-- Billing Details Card --}} {{ __('Billing Details') }} {{ __('Shop Name') }} * @if ($errors->has('shop_name')) {{ $errors->first('shop_name') }} @endif {{ __('Code') }} * @if ($errors->has('country_code')) {{ $errors->first('country_code') }} @endif {{ __('Phone') }} * @if ($errors->has('phone')) {{ $errors->first('phone') }} @endif {{ __('Email Address') }} * @if ($errors->has('email')) {{ $errors->first('email') }} @endif {{ __('Street Address') }} @if ($errors->has('address')) {{ $errors->first('address') }} @endif {{ __('City') }} * @if ($errors->has('city')) {{ $errors->first('city') }} @endif {{ __('State') }} @if ($errors->has('district')) {{ $errors->first('district') }} @endif {{ __('Postcode / Zip') }} @if ($errors->has('post_code')) {{ $errors->first('post_code') }} @endif {{ __('Country') }} * @if ($errors->has('country')) {{ $errors->first('country') }} @endif {{-- Payment Method Card (only when not free/trial) --}} @if (isset($data['package']) && ($data['package']->price ?? 0) != 0 && ($data['status'] ?? '') != 'trial') {{ __('Payment Method') }} @php $paymentMethodsList = collect($data['payment_methods'] ?? [])->unique(function($item) { return strtolower($item->keyword ?? $item->name); }); @endphp {{-- Visually hide but keep select functional for forms --}} {{ __('Choose a payment method') }} @foreach ($paymentMethodsList as $payment_method) name ? 'selected' : '' }}> {{ __($payment_method->name) }} @endforeach {{-- Beautiful grid of visual payment methods --}} @foreach ($paymentMethodsList as $payment_method) @php $methodName = $payment_method->name; $iconClass = getGatewayIcon($methodName); $isSelected = old('payment_method') == $methodName; @endphp {{ __($methodName) }} @endforeach @if ($errors->has('payment_method')) {{ $errors->first('payment_method') }} @endif {{-- Iyzico --}} @error('identity_number') {{ $message }} @enderror {{-- Stripe --}} @endif {{-- Authorize.net --}} {{ __('Card Details') }} {{-- Offline Gateway Receipt --}} @if ($errors->has('receipt')) {{ $errors->first('receipt') }} @endif {{-- ===================== RIGHT COLUMN (Summary) ===================== --}} {{ __('Order Summary') }} {{-- Package badge --}} {{ __('Selected Plan') }} {{ $data['package']->title ?? 'Selected Plan' }} @if (($data['status'] ?? '') === 'trial') {{ $data['package']->trial_days ?? 14 }} {{ __('days free trial') }} @elseif(isset($data['package']) && $data['package']->term === 'lifetime') {{ __('One-time payment') }} @else {{ ucfirst($data['package']->term ?? 'plan') }} {{ __('subscription') }} @endif {{-- Details rows --}} {{ __('Start Date') }} {{ \Carbon\Carbon::today()->format('d-m-Y') }} {{ __('Expiry Date') }} @if (($data['status'] ?? '') === 'trial') {{ \Carbon\Carbon::today()->addDay($data['package']->trial_days ?? 14)->format('d-m-Y') }} @elseif(isset($data['package']) && $data['package']->term === 'daily') {{ \Carbon\Carbon::today()->addDay()->format('d-m-Y') }} @elseif(isset($data['package']) && $data['package']->term === 'weekly') {{ \Carbon\Carbon::today()->addWeek()->format('d-m-Y') }} @elseif(isset($data['package']) && $data['package']->term === 'monthly') {{ \Carbon\Carbon::today()->addMonth()->format('d-m-Y') }} @elseif(isset($data['package']) && $data['package']->term === 'lifetime') {{ __('Lifetime') }} @else {{ \Carbon\Carbon::today()->addYear()->format('d-m-Y') }} @endif {{-- Total --}} {{ __('Total Due') }} @if (($data['status'] ?? '') === 'trial') {{ __('Free') }} @elseif(isset($data['package']) && $data['package']->price == 0) {{ __('Free') }} @else {{ format_price($data['package']->price ?? 0) }} @endif {{-- Submit button --}} {{ __('Place Order') }} {{-- Trust indicators --}} {{ __('SSL secured & encrypted payment') }} {{ __('Instant store activation') }} {{ __('24/7 customer support') }} @endsection @section('scripts') @endsection
{{ __('You\'re one step away from launching your dream store. Fill in the details below.') }}
{{ $errors->first('shop_name') }}
{{ $errors->first('country_code') }}
{{ $errors->first('phone') }}
{{ $errors->first('email') }}
{{ $errors->first('address') }}
{{ $errors->first('city') }}
{{ $errors->first('district') }}
{{ $errors->first('post_code') }}
{{ $errors->first('country') }}
{{ $errors->first('payment_method') }}
{{ $message }}