{{-- ===== HOSTING PLANS ===== --}} @php $c = $content ?? collect(); $hpTitle = $c->has('title') ? $c->get('title')->content_value : __('sections.hosting.title'); $hpSubtitle = $c->has('subtitle') ? $c->get('subtitle')->content_value : __('sections.hosting.subtitle'); $promoIcon = $c->has('promo_icon') ? $c->get('promo_icon')->content_value : 'ri-gift-2-line'; $promoTitle = $c->has('promo_title') ? $c->get('promo_title')->content_value : __('sections.hosting.promo_title'); $promoText = $c->has('promo_text') ? $c->get('promo_text')->content_value : __('sections.hosting.promo_text'); $promoCta = $c->has('promo_cta') ? $c->get('promo_cta')->content_value : __('sections.hosting.claim_offer'); $promoUrl = ($c->has('promo_url') ? trim((string) $c->get('promo_url')->content_value) : '') ?: '/client/store'; $hostingProducts = isset($products) ? $products->filter(fn($p) => $p->type === 'hosting') : collect(); $icons = ['ri-rocket-line', 'ri-speed-line', 'ri-flashlight-line', 'ri-vip-crown-line']; @endphp {{-- Without a hosting product only the promo panel would be left. --}} @if($hostingProducts->isNotEmpty())

{{ $hpTitle }}

{{ $hpSubtitle }}

{{-- Promo sidebar --}}

{{ $promoTitle }}

{{ $promoText }}

{{ $promoCta }}
{{-- Plan cards --}} {{-- values() so $idx is 0,1,2: the collection keeps its original keys after filtering, which put the "most popular" badge on whichever plan happened to be second in the unfiltered list. --}} @foreach($hostingProducts->take(3)->values() as $idx => $product) @php $priced = $product->pricedCycles($currency?->id ?? null); $priceCycle = isset($priced['monthly']) ? 'monthly' : (string) array_key_first($priced); $monthlyPrice = $priced[$priceCycle] ?? null; $annualPrice = $priced['annually'] ?? null; $configOptions = is_string($product->config_options) ? json_decode($product->config_options, true) : ($product->config_options ?? []); // Hand-written feature lines win when an operator has set them; // otherwise the card states the plan's real limits, which cannot // drift from what the panel enforces the way typed copy does. $features = []; for ($i = 1; $i <= 7; $i++) { if (!empty($configOptions["f{$i}"])) $features[] = $configOptions["f{$i}"]; } if (! $features) { $features = array_map(fn ($r) => $r['text'], $product->resourceSummary()); } $isPopular = $idx === 1; @endphp
@if($isPopular)
{{ __('sections.hosting.most_popular') }}
@endif
{{ $product->name }}
{{ $product->description }}
@if($monthlyPrice !== null)
{{ display_money_fmt($monthlyPrice) }}/{{ $priceCycle === 'monthly' ? 'mo' : $priceCycle }}
@else
{{ __('client.store.contact_us') }}
@endif
@foreach($features as $feature)
{{ $feature }}
@endforeach
@if(__('sections.hosting.control_panel') !== '')
{{ __('sections.hosting.control_panel') }}
@endif {{ __('sections.hosting.get_started') }}
@endforeach
@endif