@extends('user.layout') @section('styles') @endsection @php $user = Auth::guard('web')->user(); $package = \App\Http\Helpers\UserPermissionHelper::currentPackagePermission($user->id); @endphp @section('content') @if (is_null($package)) @php $pendingMemb = \App\Models\Membership::query() ->where([['user_id', '=', Auth::id()], ['status', 0]]) ->whereYear('start_date', '<>', '9999') ->orderBy('id', 'DESC') ->first(); $pendingPackage = isset($pendingMemb) ? \App\Models\Package::query()->findOrFail($pendingMemb->package_id) : null; @endphp @if ($pendingPackage)
{{ __('You have requested a package which needs an action (Approval / Rejection) by Admin. You will be notified via mail once an action is taken.') }}
{{ __('Pending Package') . ':' }} {{ $pendingPackage->title }} {{ __($pendingPackage->term) }} {{ __('Decision Pending') }}
@else
{{ __('Your membership is expired. Please purchase a new package / extend the current package.') }}
@endif @else
@if ($package_count >= 2) @if ($next_membership->status == 0)
{{ __('You have requested a package which needs an action (Approval / Rejection) by Admin. You will be notified via mail once an action is taken.') }}
@elseif ($next_membership->status == 1)
{{ __('You have another package to activate after the current package expires. You cannot purchase / extend any package, until the next package is activated') }}
@endif @endif @if (!empty($current_package))
{{ __('Current Package') }}: {{ $current_package->title ?? '' }} @if(!empty($current_package->term)) {{ __($current_package->term) }} @endif @if (!empty($current_membership) && !empty($current_membership->expire_date)) | {{ __('Expire Date') }}: @if ($current_membership->is_trial == 1) {{ Carbon\Carbon::parse($current_membership->expire_date)->format('M-d-Y') }} {{ __('Trial') }} @else {{ ($current_package->term ?? '') === 'lifetime' ? __('Lifetime') : Carbon\Carbon::parse($current_membership->expire_date)->format('M-d-Y') }} @endif @endif
@endif @if ($package_count >= 2 && !empty($next_package))
{{ __('Next Package To Activate') }}: {{ $next_package->title }} {{ __($next_package->term ?? '') }} @if (!empty($current_package) && ($current_package->term ?? '') != 'lifetime' && (!empty($current_membership) && $current_membership->is_trial != 1) && !empty($next_membership)) ( {{ __('Activation Date') . ':' }} {{ Carbon\Carbon::parse($next_membership->start_date)->format('M-d-Y') }}, {{ __('Expire Date') . ':' }} {{ ($next_package->term ?? '') === 'lifetime' ? __('Lifetime') : Carbon\Carbon::parse($next_membership->expire_date)->format('M-d-Y') }}) @endif @if (!empty($next_membership) && $next_membership->status == 0) {{ __('Decision Pending') }} @endif
@endif
@endif @if (!empty($is_expired))

{{ __('Your Subscription Has Expired') }}

{{ __('Your plan expired on') }} {{ !empty($expired_membership->expire_date) ? \Carbon\Carbon::parse($expired_membership->expire_date)->format('M d, Y h:i A') : 'recently' }}. {{ __('Renew your plan or select a package below to immediately restore full store access.') }}

@if (!empty($expired_package)) {{ __('Renew :pkg Now', ['pkg' => $expired_package->title]) }} @endif
@endif @php // Smart Tier Filtering for LaunchShop / Ecombuilder $currPkg = $current_package ?? ($expired_package ?? null); $currPrice = $currPkg ? (float)($currPkg->price ?? 0) : 0; $renewPlan = $currPkg; // Filter packages: all higher packages are eligible for upgrade $upgradePlans = $packages->filter(function($p) use ($currPkg, $currPrice) { if (!$currPkg) return true; if ($p->id == $currPkg->id) return false; if ((float)($p->price ?? 0) > $currPrice) return true; if ((int)($p->product_limit ?? 0) > (int)($currPkg->product_limit ?? 0)) return true; if ((int)($p->order_limit ?? 0) > (int)($currPkg->order_limit ?? 0)) return true; $titleLower = strtolower($p->title ?? ''); if (strpos($titleLower, 'pro') !== false || strpos($titleLower, 'premium') !== false || strpos($titleLower, 'standard') !== false || strpos($titleLower, 'enterprise') !== false || strpos($titleLower, 'business') !== false) { return true; } return false; })->values(); // If upgradePlans is empty and other packages exist, show all alternative packages so the expired user can upgrade or switch if ($upgradePlans->isEmpty() && count($packages) > 1) { $upgradePlans = $packages->filter(function($p) use ($currPkg) { return !$currPkg || $p->id != $currPkg->id; })->values(); } if (!$renewPlan && count($packages) > 0) { $renewPlan = $packages->first(); } $getPackageFeatures = function($pkg) use ($allPfeatures) { $list = []; if (!$pkg) return $list; // 1. Categories $list[] = [ 'label' => __('Categories Limit'), 'value' => ($pkg->categories_limit != '999999' ? $pkg->categories_limit : __('Unlimited')), ]; // 2. Products $list[] = [ 'label' => __('Products Limit'), 'value' => ($pkg->product_limit != '999999' ? $pkg->product_limit : __('Unlimited')), ]; // 3. Orders $list[] = [ 'label' => __('Orders Limit'), 'value' => ($pkg->order_limit != '999999' ? $pkg->order_limit : __('Unlimited')), ]; // 4. Languages $list[] = [ 'label' => __('Additional Languages'), 'value' => ($pkg->language_limit != '999999' ? $pkg->language_limit : __('Unlimited')), ]; $features = is_array($pkg->features) ? $pkg->features : (json_decode($pkg->features, true) ?? []); // 5. Blog if (is_array($features) && in_array('Blog', $features)) { $list[] = [ 'label' => __('Posts Limit'), 'value' => ($pkg->post_limit != '999999' ? $pkg->post_limit : __('Unlimited')), ]; } // 6. Custom Page if (is_array($features) && in_array('Custom Page', $features)) { $list[] = [ 'label' => __('Custom Pages Limit'), 'value' => ($pkg->number_of_custom_page != '999999' ? $pkg->number_of_custom_page : __('Unlimited')), ]; } // 7. AI Content & Image Generator if (is_array($features) && in_array('AI Content & Image Generator', $features)) { if (!empty($pkg->ai_engine)) { $list[] = [ 'label' => __('AI Engine'), 'value' => strtoupper($pkg->ai_engine), ]; } $list[] = [ 'label' => __('AI Token Limit'), 'value' => ($pkg->ai_token_limit != '999999' ? $pkg->ai_token_limit : __('Unlimited')), ]; $list[] = [ 'label' => __('AI Image Limit'), 'value' => ($pkg->ai_image_limit != '999999' ? $pkg->ai_image_limit : __('Unlimited')), ]; } // 8. Other features in json if (is_array($features)) { foreach ($features as $f) { if (!in_array($f, ['Blog', 'Custom Page', 'AI Content & Image Generator'])) { $list[] = [ 'label' => __($f), 'value' => null, ]; } } } return $list; }; @endphp @if(!empty($is_expired)) {{-- ========================================== --}} {{-- EXPIRED VIEW: HORIZONTAL RECTANGLE LAYOUT --}} {{-- ========================================== --}} {{-- SECTION 1: RENEW CURRENT PLAN --}}

{{ __('Please renew your current plan to use the features') }}

@if($renewPlan)
{{ __('Current Plan') }}

{{ $renewPlan->title }}

@if(!empty($renewPlan->term)) {{ __($renewPlan->term) }} @endif

{{ __('Your subscription has expired. Renew your current plan now to immediately keep your live store online and restore full access.') }}

@foreach ($getPackageFeatures($renewPlan) as $fItem)
{{ $fItem['label'] }} @if(!is_null($fItem['value'])) : {{ $fItem['value'] }} @endif
@endforeach
{{ $renewPlan->price == 0 ? __('Free') : '₹' . round($renewPlan->price) }} /{{ __($renewPlan->term) }} @if(stripos($renewPlan->term ?? '', 'year') !== false || stripos($renewPlan->term ?? '', 'annu') !== false) 20% OFF @endif
{{ __('Instant automatic reactivation upon payment confirmation') }}
{{ __('Pay Now') }}
@endif
{{-- SECTION 2: UPGRADE PLAN TO EXPLORE NEW FEATURES (HIGHER TIERS ONLY) --}} @if(count($upgradePlans) > 0)

{{ __('Upgrade your plan to explore new features') }}

@foreach ($upgradePlans as $upPkg)
{{ __('Upgrade Option') }}

{{ $upPkg->title }}

@if(!empty($upPkg->term)) {{ __($upPkg->term) }} @endif

{{ __('Upgrade to this plan to unlock higher product limits, unlimited orders, and advanced features for your store.') }}

@foreach ($getPackageFeatures($upPkg) as $fItem)
{{ $fItem['label'] }} @if(!is_null($fItem['value'])) : {{ $fItem['value'] }} @endif
@endforeach
{{ $upPkg->price == 0 ? __('Free') : '₹' . round($upPkg->price) }} /{{ __($upPkg->term) }} @if(stripos($upPkg->term ?? '', 'year') !== false || stripos($upPkg->term ?? '', 'annu') !== false) 20% OFF @endif
{{ __('Switch plan instantly with seamless feature upgrade') }}
{{ __('Pay Now') }}
@endforeach
@endif @else {{-- ==================================================== --}} {{-- ACTIVE VIEW: CLASSIC PLAN-WISE DISPLAY (HEXAGON CARDS) --}} {{-- ==================================================== --}}
@foreach ($packages as $key => $package) @php $colorClass = 'theme-color-' . ($key % 4); $isCurrent = isset($current_package->id) && $current_package->id === $package->id; $isNext = $package_count >= 2 && !empty($next_package) && $next_package->id == $package->id && !empty($next_membership) && $next_membership->status == 1; @endphp

{{ __($package->title) }}

@if ($isCurrent) {{ __('Current') }} @elseif ($isNext) {{ __('Next') }} @endif
{{ $package->price == 0 ? __('Free') : '₹' . round($package->price) }} /{{ __($package->term) }} @if(stripos($package->term ?? '', 'year') !== false || stripos($package->term ?? '', 'annu') !== false) 20% OFF @endif
@if ($package_count < 2) @else
@if ($isCurrent) @else @endif
@endif
@endforeach
@endif

Secure & Reliable

Your data is secure with enterprise-grade protection.

Powerful Features

Everything you need to grow your business online.

24/7 Support

Our support team is always ready to help you.

Scale Your Business

Flexible plans that grow with your business.

@endsection