@foreach ($packages as $index => $package)
@php
$titleKey = strtolower($package->title);
$isRecommended = str_contains($titleKey, 'premium');
$isBestValue = ($package->recommended == 2);
$cardClass = $isRecommended ? 'card-recommended' : ($isBestValue ? 'card-best-value' : '');
$planSubtitle = !empty($package->meta_description) ? $package->meta_description : ucfirst($package->title).' '.__('Plan');
$periodLabel = strtolower($package->term) == 'lifetime' ? 'one-time' : (strtolower($package->term) == 'yearly' ? 'year' : 'month');
// Features
$pFeatures = json_decode($package->features, true) ?: [];
$packageFormattedFeatures = [];
if ($allFeatures->isEmpty()) {
$packageFormattedFeatures = [];
$limitVal = $package->categories_limit ?? 0;
if ($limitVal > 0 || $limitVal == 999999) {
$packageFormattedFeatures[] = ['text' => 'Categories Limit : '.($limitVal==999999?'Unlimited':$limitVal), 'has' => true];
}
$limitVal = $package->product_limit ?? 0;
if ($limitVal > 0 || $limitVal == 999999) {
$packageFormattedFeatures[] = ['text' => 'Products Limit : '.($limitVal==999999?'Unlimited':$limitVal), 'has' => true];
}
$limitVal = $package->order_limit ?? 0;
if ($limitVal > 0 || $limitVal == 999999) {
$packageFormattedFeatures[] = ['text' => 'Orders Limit : '.($limitVal==999999?'Unlimited':$limitVal), 'has' => true];
}
$limitVal = $package->language_limit ?? 0;
if ($limitVal > 0 || $limitVal == 999999) {
$packageFormattedFeatures[] = ['text' => 'Additional Languages : '.($limitVal==999999?'Unlimited':$limitVal), 'has' => true];
}
$limitVal = $package->post_limit ?? 0;
if ($limitVal > 0 || $limitVal == 999999) {
$packageFormattedFeatures[] = ['text' => 'Posts Limit : '.($limitVal==999999?'Unlimited':$limitVal), 'has' => true];
}
$limitVal = $package->number_of_custom_page ?? 0;
if ($limitVal > 0 || $limitVal == 999999) {
$packageFormattedFeatures[] = ['text' => 'Custom Pages : '.($limitVal==999999?'Unlimited':$limitVal), 'has' => true];
}
$fallbackPills = [
'Custom Domain' => 'Custom Domain',
'Subdomain' => 'Subdomain',
'QR Builder' => 'QR Builder',
'Blog' => 'Blog',
'Custom Page' => 'Custom Page',
'Google Login' => 'Google Login',
'Google Analytics' => 'Google Analytics',
'Google Recaptcha' => 'Google Recaptcha',
'WhatsApp Chat Button' => 'WhatsApp Chat Button',
'Tawk to' => 'Tawk to',
'AI Content & Image Generator' => 'AI Content & Image Generator'
];
foreach ($fallbackPills as $k => $name) {
if ($k === 'AI Content & Image Generator') {
continue;
}
if ($k !== 'Blog' && $k !== 'Custom Page') {
if (in_array($k, $pFeatures)) {
$packageFormattedFeatures[] = ['text' => $name, 'has' => true];
}
}
}
} else {
foreach ($allFeatures as $feature) {
if ($feature->keyword === 'AI Content & Image Generator' || $feature->name === 'AI Content & Image Generator') {
continue;
}
$has = false;
$text = $feature->name;
if ($feature->type === 'limit') {
$limitVal = $package->{$feature->limit_key} ?? 0;
$formattedVal = ($limitVal == 999999) ? __('Unlimited') : $limitVal;
if ($feature->limit_key === 'order_limit' && $limitVal != 999999) {
$formattedVal .= '/' . ($package->term == 'monthly' ? 'm' : 'yr');
}
$text = str_replace('{limit}', $formattedVal, $text);
$has = ($limitVal > 0 || $limitVal == 999999);
} elseif ($feature->type === 'standard') {
$has = in_array($feature->keyword, $pFeatures);
if ($has && !empty($feature->limit_key)) {
$limitVal = $package->{$feature->limit_key} ?? 0;
$formattedVal = ($limitVal == 999999) ? __('Unlimited') : $limitVal;
$text = str_replace('{limit}', $formattedVal, $text);
} elseif (!empty($feature->limit_key)) {
$limitVal = $package->{$feature->limit_key} ?? 0;
$formattedVal = ($limitVal == 999999) ? __('Unlimited') : $limitVal;
$text = str_replace('{limit}', $formattedVal, $text);
}
} elseif ($feature->type === 'custom') {
$has = in_array($feature->name, $pFeatures);
}
$packageFormattedFeatures[] = ['text' => $text, 'has' => $has];
}
}
// Post-process features to customize "Additional Languages" dynamically based on plan title key
// Basic: strikeout, Standard: 1 Additional Language, Premium: 3 Additional Languages
// Find if "Additional Languages" already exists in the formatted features
$foundLangKey = false;
foreach ($packageFormattedFeatures as $key => $feat) {
if (stripos($feat['text'], 'Additional Languages') !== false || stripos($feat['text'], 'languages') !== false) {
$foundLangKey = $key;
break;
}
}
$langLimit = $package->language_limit ?? 0;
$customHas = ($langLimit > 0 || $langLimit == 999999);
$customText = $customHas ? ($langLimit == 999999 ? __('Unlimited Languages') : $langLimit . ' ' . __('Additional Language') . ($langLimit > 1 ? 's' : '')) : __('Additional Languages');
if ($foundLangKey !== false) {
// Override the existing feature
$packageFormattedFeatures[$foundLangKey]['text'] = $customText;
$packageFormattedFeatures[$foundLangKey]['has'] = $customHas;
} else {
// If it doesn't exist, append it
$packageFormattedFeatures[] = ['text' => $customText, 'has' => $customHas];
}
$visibleCount = 7;
$visibleFeats = array_slice($packageFormattedFeatures, 0, $visibleCount);
$extraFeats = array_slice($packageFormattedFeatures, $visibleCount);
// CTA href
if ($package->is_trial === '1' && $package->price != 0) {
$ctaHref = $selectedTemplate
? route('front.register.view', ['status'=>'regular','id'=>$package->id]).'?template='.urlencode($selectedTemplate)
: route('front.select.template', ['status'=>'regular','id'=>$package->id]);
} elseif ($package->price == 0) {
$ctaHref = $selectedTemplate
? route('front.register.view', ['status'=>'regular','id'=>$package->id]).'?template='.urlencode($selectedTemplate)
: route('front.select.template', ['status'=>'regular','id'=>$package->id]);
} else {
$ctaHref = $selectedTemplate
? route('front.register.view', ['status'=>'regular','id'=>$package->id]).'?template='.urlencode($selectedTemplate)
: route('front.select.template', ['status'=>'regular','id'=>$package->id]);
}
@endphp
@if($titleKey == 'standard' && ($customPackage->most_popular_status ?? 1))
{{ $customPackage->most_popular_title ?? 'Most Popular' }}
{{ $customPackage->most_popular_desc ?? 'Ideal balance for growing businesses with all essential tools.' }}
@endif
@if($titleKey == 'premium' && ($customPackage->most_people_choice_status ?? 1))
{{ $customPackage->most_people_choice_title ?? 'Most People Choice' }}
{{ $customPackage->most_people_choice_desc ?? 'Best value with all premium features and a free domain.' }}
@endif
@if($titleKey == 'basic')
@if(strtolower($term) == 'monthly')
Monthly Billing
Only Basic plan is available with monthly billing.
Monthly Billing
Only Basic plan is available with monthly billing.
@else
@if($customPackage->most_popular_status ?? 1)
{{ $customPackage->most_popular_title ?? 'Most Popular' }}
{{ $customPackage->most_popular_desc ?? 'Ideal balance for growing businesses with all essential tools.' }}
@endif
@endif
@endif
@if($titleKey == 'standard' && strtolower($term) == 'monthly' && ($customPackage->most_popular_status ?? 1))
{{ $customPackage->most_popular_title ?? 'Most Popular' }}
{{ $customPackage->most_popular_desc ?? 'Ideal balance for growing businesses with all essential tools.' }}
@endif
{{-- Top badge --}}
@if($isRecommended)
RECOMMENDED
@elseif($isBestValue)
BEST VALUE
@endif
{{-- Icon --}}
@if($titleKey == 'basic')
@elseif($titleKey == 'standard')
@elseif($titleKey == 'premium')
@else
@endif
{{-- Title --}}
Ecom {{ __($package->title) }}
{{ $planSubtitle }}
{{-- Price --}}
@if($package->price == 0)
{{ __('Free') }}
@else
{{ $be->base_currency_symbol ?? '₹' }}{{ number_format($package->price, 0) }}
/ {{ $periodLabel }}
@endif
@if(strtolower($package->term)=='monthly' && $titleKey == 'basic')
Just ₹1999/Yearly
@else
@if(strtolower($package->term)=='yearly' || $titleKey == 'standard' || $titleKey == 'premium')
Billed yearly
@else
One-time access fee
@endif
@endif
{{-- Visible features --}}
@foreach($visibleFeats as $feat)
@php
$isPremiumFreeDomain = ($titleKey == 'premium' && (stripos($feat['text'], 'Free .in Domain') !== false || stripos($feat['text'], 'Free Domain') !== false));
@endphp
-
@if($isPremiumFreeDomain)
@elseif($feat['has'])
@else
@endif
{{ __($feat['text']) }}
@endforeach
{{-- Extra features (collapsed) --}}
@php $hasExtra = (count($extraFeats) > 0); @endphp
@if($hasExtra)
@endif
{{-- CTA Button with correct name --}}
Select Ecom {{ __($package->title) }}
@endforeach
@if(strtolower($term) != 'monthly' && ($customPackage->enterprise_status ?? 1))
{{-- Enterprise card --}}
@if($customPackage->most_people_choice_status ?? 1)
{{ $customPackage->most_people_choice_title ?? 'Most People Choice' }}
{{ $customPackage->most_people_choice_desc ?? 'Best value with all premium features and a free domain.' }}
@endif
{{ $customPackage->enterprise_title ?? 'Enterprise' }}
{{ $customPackage->enterprise_subtitle ?? 'Kickstart Your E-commerce Business.' }}
{{ $customPackage->enterprise_price ?? 'Custom' }}
{{ $customPackage->enterprise_billing_note ?? 'Tailored to your needs' }}
@php
$eFeatures = array_filter(array_map('trim', explode("\n", $customPackage->enterprise_features ?? "Free .com Domain Every Year\nEverything in Premium\nUnlimited Staff Accounts\nDedicated Account Manager\nCustom Integrations\nSLA & Uptime Guarantee\nPriority 24/7 Support")));
@endphp
@foreach($eFeatures as $efItem)
@php
$isDomain = (stripos($efItem, 'domain') !== false);
@endphp
-
@if($isDomain)
{{ __($efItem) }}
@else
{{ __($efItem) }}
@endif
@endforeach
@endif