@extends('client.layouts.app') @section('title', __('client.cart.configure') . ': '. $product->name) @section('styles') @endsection @section('content')
@csrf @php $res = $product->resourceSummary(); @endphp @if($res) {{-- The limits the order actually buys, so the choice of app can be made against them rather than after the fact. --}}
{{ __('client.store.included_resources') }}
    @foreach($res as $r)
  • {{ $r['text'] }}
  • @endforeach

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

@endif @if(! empty($apps)) {{-- One product, any app. Selling ninety-eight apps as ninety-eight products does not scale, so the choice is made here and the order installs it. --}}
{{ __('client.cart.choose_app') }} {{ __('client.cart.app_optional') }}

{{ __('client.cart.app_intro') }}

@foreach($apps as $a) @php $hue = crc32($a['slug']) % 360; $initial = mb_strtoupper(mb_substr(trim($a['name']) ?: $a['slug'], 0, 1)); $line = $a['tagline'] ?: $a['description']; @endphp
@if($a['is_featured'])★@endif @if($a['logo_url_local']) @else
{{ $initial }}
@endif
{{ $a['name'] }}
{{ $line }}
@if(($a['extra_services'] ?? 0) > 0 || ($a['min_memory_mb'] ?? 0) > 0)
@if(($a['min_memory_mb'] ?? 0) > 0){{ $a['min_memory_mb'] >= 1024 ? round($a['min_memory_mb']/1024, 1).' GB' : $a['min_memory_mb'].' MB' }}@endif @if(($a['extra_services'] ?? 0) > 0){{ trans_choice('client.hosting.containers.services', $a['extra_services'] + 1, ['count' => $a['extra_services'] + 1]) }}@endif
@endif
@endforeach
@error('app_slug')
{{ $message }}
@enderror
@endif
{{-- Billing Cycle --}}
{{ __('client.cart.billing_cycle') }}
@php $pricedCycles = $product->pricedCycles($currency?->id); @endphp
@if($pricedCycles !== []) {{-- Only the cycles the product is sold on, so the first one really is the one that comes up selected. --}} @foreach($pricedCycles as $cycle => $cyclePrice) @endforeach @else
{{ __('client.cart.no_pricing') }}
@endif
{{-- Configurable Options --}} @if(($optionGroups ?? collect())->isNotEmpty())
{{ __('client.cart.configurable_options') }}
@foreach($optionGroups as $group) @foreach($group->options as $option) @continue($option->subs->isEmpty()) @php $selectedCycle = old('billing_cycle', (string) (array_key_first($pricedCycles) ?: 'monthly')); $previous = old('config_options.'.$option->id); @endphp
@if($option->isQuantity()) @php $unit = $option->subs->first(); @endphp qty_maximum) max="{{ $option->qty_maximum }}" @endif> {{ display_money_fmt($unit?->priceFor($selectedCycle) ?? 0) }} {{ __('client.cart.per_unit') }} @elseif($option->isCheckbox()) @php $sub = $option->subs->first(); @endphp @else @endif @error('config_options.'.$option->id)
{{ $message }}
@enderror
@endforeach @endforeach
@endif {{-- Addons --}} @if(($addons ?? collect())->isNotEmpty())
{{ __('client.cart.addons') }}
@php $selectedCycle = old('billing_cycle', (string) (array_key_first($pricedCycles) ?: 'monthly')); @endphp @php $previousAddons = array_map('intval', (array) old('addons', [])); @endphp @foreach($addons as $addon) @php $addonPrice = $addon->priceFor($selectedCycle); @endphp @endforeach
@endif {{-- Hostname: a virtual server is named, not sold a domain. --}} @if(strtolower((string) $product->server_type) === 'proxmox')
{{ __('proxmox.client.order_hostname') }} ({{ __('client.form.optional') }})
{{ __('proxmox.client.order_hostname_hint') }}
@error('domain')
{{ $message }}
@enderror
{{ __('proxmox.client.ssh_keys') }} ({{ __('client.form.optional') }})
{{ __('proxmox.client.ssh_keys_hint') }}
@error('ssh_keys')
{{ $message }}
@enderror
{{-- Domain --}} @elseif($product->show_domain_options)
{{ __('client.cart.domain') }}
@if($product->free_domain && $product->freeDomainTlds()) @php($ikaCycles = $product->freeDomainCycles())

{{ __('client.cart.free_domain_note', ['tlds' => implode(', ', $product->freeDomainTlds())]) }}@if($ikaCycles) {{ __('client.cart.free_domain_cycles', ['cycles' => implode(', ', array_map(fn ($c) => __('common.billing.'.str_replace('semiannually', 'semi_annually', $c)), $ikaCycles))]) }}@endif

@endif
@php($freeSubdomains = \App\Support\FreeSubdomains::parents()) @if($freeSubdomains) @endif
{{-- Without free subdomain domains the field is the one it always was. --}} @if($freeSubdomains)
@endif @if($freeSubdomains)
@endif @error('domain')
{{ $message }}
@enderror {{-- Whether the name can be had and what it costs: a new domain or a transfer is bought with the hosting. --}}
@endif {{-- The product's own questions, answered for this order. --}} @if(($productFields ?? collect())->isNotEmpty())
{{ __('client.cart.order_questions') }}
@include('client.partials.custom-fields', ['fields' => $productFields, 'clientId' => null])
@endif {{-- Additional Notes --}}
{{ __('client.cart.additional_notes') }} ({{ __('client.form.optional') }})
{{-- Order Summary --}}
{{ __('client.cart.order_summary') }}
{{ __('client.cart.product') }} {{ $product->name }}
{{ __('client.cart.billing_cycle') }} —
{{ __('client.cart.total') }} —
@section('scripts') @endsection @endsection