{{-- ===== VPS PLANS ===== --}} @php $c = $content ?? collect(); $vpsTitle = $c->has('title') ? $c->get('title')->content_value : __('sections.vps.title'); $vpsSubtitle = $c->has('subtitle') ? $c->get('subtitle')->content_value : __('sections.vps.subtitle'); $vpsProducts = isset($products) ? $products->filter(fn($p) => $p->type === 'vps' || ($p->group && str_contains(strtolower($p->group->name), 'vps'))) : collect(); $badgeTypes = ['', 'vps-card__badge--popular', 'vps-card__badge--value', '']; $badgeTexts = ['', __('sections.vps.popular'), __('sections.vps.best_value'), '']; @endphp {{-- Nothing to show without a VPS product: a heading over an empty grid. --}} @if($vpsProducts->isNotEmpty())

{{ $vpsTitle }}

{{ $vpsSubtitle }}

{{-- VPS cards --}}
@forelse($vpsProducts->take(4)->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; $configOptions = is_string($product->config_options) ? json_decode($product->config_options, true) : ($product->config_options ?? []); $specs = []; for ($i = 1; $i <= 5; $i++) { if (!empty($configOptions["f{$i}"])) $specs[] = $configOptions["f{$i}"]; } // Same as the hosting cards: fall back to the limits the // product actually sells rather than an empty card. if (! $specs) { $specs = array_map(fn ($r) => $r['text'], $product->resourceSummary()); } @endphp
@if(!empty($badgeTexts[$idx]))
{{ $badgeTexts[$idx] }}
@endif
{{ $product->name }}
@foreach($specs as $spec)
{{ $spec }}
@endforeach
@if($monthlyPrice !== null)
{{ display_money_fmt($monthlyPrice) }}/{{ $priceCycle === 'monthly' ? 'mo' : $priceCycle }}
@else
{{ __('client.store.contact_us') }}
@endif {{ __('sections.vps.configure') }}
@empty {{-- No VPS products --}} @endforelse
@endif