@extends("client.layouts.app") @section("title", $current ? $current->name : __("client.order_a_new_product")) @section("content") {{-- The store, one category at a time: the categories down the side (a row of chips on a phone), the chosen one's plans beside them. --}} @if(session("error"))
{{ session("error") }}
@endif @if(! $current)
🛒

{{ __('client.store.no_products_at_all') }}

@else @php // An icon for a category, guessed from its name. $catIcon = function (string $name): string { $n = strtolower($name); foreach ([ 'ri-global-line' => ['domain'], 'ri-shield-check-line' => ['ssl', 'certificate', 'security'], 'ri-mail-line' => ['mail', 'workspace', 'workplace'], 'ri-server-line' => ['vps', 'dedicated', 'server', 'cloud'], 'ri-group-line' => ['reseller'], 'ri-wordpress-line' => ['wordpress'], 'ri-layout-line' => ['website', 'builder'], 'ri-key-2-line' => ['licen'], ] as $icon => $words) { foreach ($words as $w) { if (str_contains($n, $w)) { return $icon; } } } return 'ri-hard-drive-2-line'; }; $cycleLabel = fn (string $cycle) => __('common.billing.'.($cycle === 'semiannually' ? 'semi_annually' : $cycle)); @endphp

{{ $current->headline ?: $current->name }}

@if($current->tagline)

{{ $current->tagline }}

@elseif(! $current->headline)

{{ __('client.store.subtitle') }}

@endif
@foreach($products as $product) @php $pricedCycles = $product->pricedCycles($currency?->id); $startingCycle = (string) array_key_first($pricedCycles); $startingPrice = $pricedCycles[$startingCycle] ?? null; // What the card lists: the plan's feature lines when the // operator wrote them (f1-f7, as the homepage uses), else a // description written one feature a line, else the limits // the product enforces. $opts = is_array($product->config_options) ? $product->config_options : []; $features = []; for ($i = 1; $i <= 7; $i++) { if (! empty($opts["f{$i}"])) { $features[] = (string) $opts["f{$i}"]; } } $desc = trim(strip_tags(str_ireplace(['
', '
', '
', '

', ''], "\n", (string) $product->description))); $descLines = array_values(array_filter(array_map('trim', preg_split('/\R/', $desc)))); $paragraph = null; if (! $features && count($descLines) > 1) { $features = $descLines; } elseif ($desc !== '') { $paragraph = \Illuminate\Support\Str::limit($desc, 160); } if (! $features) { $features = array_map(fn ($r) => $r['text'], $product->resourceSummary()); } @endphp @endforeach
@endif @endsection