@php $intervalLabels = ['month' => __('Mensual'), 'year' => __('Anual'), 'one_time' => __('Pago único')]; $defaultInterval = $intervals->contains(\App\Enums\Commerce\BillingInterval::Month) ? 'month' : ($intervals->first()?->value ?? 'month'); $firstImage = $microapp->media->first(); // Se prepara aquí: dentro de la plantilla, "@context" se tomaría por una directiva de Blade. $jsonLd = json_encode([ '@context' => 'https://schema.org', '@type' => 'SoftwareApplication', 'name' => $microapp->name, 'description' => $microapp->seoDescription(), 'applicationCategory' => 'BusinessApplication', 'operatingSystem' => 'Web', 'url' => route('catalog.show', $microapp->slug), 'offers' => $plans->flatMap(fn ($plan) => $plan->activePrices->map(fn ($price) => [ '@type' => 'Offer', 'name' => $plan->name, 'price' => number_format($price->amount / 100, 2, '.', ''), 'priceCurrency' => $price->currency, ]))->values()->all(), ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP); @endphp {{-- Cabecera de la landing --}}

{{ $microapp->name }}

{{ $microapp->tagline }}

@if ($plans->isNotEmpty() && $microapp->is_available) {{ __('Ver planes y precios') }} @else {{ __('Disponible próximamente') }} @endif @if (count($microapp->faqs ?? []) > 0) {{ __('Preguntas frecuentes') }} @endif
@if ($firstImage)
{{ $firstImage->alt ?: $microapp->name }}
@endif
@if ($microapp->description)

{{ __('Qué es :name', ['name' => $microapp->name]) }}

@foreach (preg_split('/\R{2,}/', trim($microapp->description)) as $paragraph)

{!! nl2br(e($paragraph)) !!}

@endforeach
@endif @if (count($microapp->features ?? []) || count($microapp->benefits ?? []))
@if (count($microapp->features ?? []))

{{ __('Características principales') }}

    @foreach ($microapp->features as $feature)
  • {{ $feature }}
  • @endforeach
@endif @if (count($microapp->benefits ?? []))

{{ __('Beneficios') }}

    @foreach ($microapp->benefits as $benefit)
  • {{ $benefit }}
  • @endforeach
@endif
@endif @if (count($microapp->audiences ?? []))

{{ __('Para quién es') }}

    @foreach ($microapp->audiences as $audience)
  • {{ $audience }}
  • @endforeach
@endif @if ($microapp->media->count() > 1)

{{ __('Capturas') }}

    @foreach ($microapp->media->skip(1) as $media)
  • {{ $media->alt ?: $microapp->name }}
  • @endforeach
@endif {{-- Planes y precios --}}

{{ __('Planes y precios') }}

{{ config('commerce.prices_include_tax') ? __('Precios con IVA incluido.') : __('Precios sin IVA.') }} {{ __('Puedes contratar para ti o para una organización que administres.') }}

@if ($intervals->count() > 1)
@foreach ($intervals as $interval) @endforeach
@endif
@if ($plans->isEmpty() || ! $microapp->is_available) @else
    @foreach ($plans as $plan) @php $promotion = $promotions[$plan->id] ?? null; @endphp
  • @if ($plan->is_highlighted) {{ __('Recomendado') }} @endif

    {{ $plan->name }}

    @if ($plan->description)

    {{ $plan->description }}

    @endif @php $planIntervals = $plan->activePrices->map(fn ($p) => $p->interval->value)->values(); $fallback = ! $planIntervals->contains($defaultInterval); @endphp @foreach ($plan->activePrices as $price) @php $visibleByDefault = $price->interval->value === $defaultInterval || ($fallback && $loop->first); @endphp

    {{ $price->isFree() ? __('Gratis') : \App\Support\Commerce\Money::format($price->amount, $price->currency, compact: true) }} @if (! $price->isFree()) {{ $price->isRecurring() ? $price->interval->suffix() : __('pago único') }} @endif

    @if ($price->interval->value === 'year')

    {{ __('Equivale a :amount al mes', ['amount' => \App\Support\Commerce\Money::format(intdiv($price->amount, 12), $price->currency)]) }}

    @endif @if ($price->access_days)

    {{ __('Acceso durante :days días', ['days' => $price->access_days]) }}

    @endif @if ($promotion && ! $price->isFree())

    {{ $promotion->label() }}

    @endif @if ($plan->trial_days > 0 && $price->isRecurring())

    {{ trans_choice('{1} :count día de prueba gratis|[2,*] :count días de prueba gratis', $plan->trial_days, ['count' => $plan->trial_days]) }}

    @endif
    {{ $price->isFree() ? __('Empezar gratis') : ($plan->trial_days > 0 && $price->isRecurring() ? __('Probar gratis') : __('Contratar')) }}
    @endforeach @if (count($plan->features ?? []))
      @foreach ($plan->features as $feature)
    • {{ $feature }}
    • @endforeach
    @endif

    {{ $plan->audience->label() }}@if ($plan->seats_limit) · {{ trans_choice('{1} :count usuario|[2,*] hasta :count usuarios', $plan->seats_limit, ['count' => $plan->seats_limit]) }}@endif

  • @endforeach
@endif @if ($bundles->isNotEmpty())

{{ __('También incluida en paquetes') }}

@endif
@if (count($microapp->faqs ?? []))

{{ __('Preguntas frecuentes') }}

@foreach ($microapp->faqs as $faq)
{{ $faq['q'] }}

{!! nl2br(e($faq['a'])) !!}

@endforeach
@endif