@extends('layouts.login') @section('nav') @include('header.login') @endsection @section('title')

Bonjour {{$user->familyName}} {{$user->givenName}}

@endsection @section('content')
@if (!empty($user->tags))

Vous avez encore une formule en cours :

  • Nom de la formule : {{$user->tags[0]['name']}}
  • Date de fin : {{\Carbon\Carbon::parse($user->tags[0]['validThrough'])->format('d-m-Y')}}
@endif
@csrf

Etape 2: Choisissez votre formule et votre date

@error('dateDebut') {{ $message }} @enderror
@php $FIRST = ['/venicegym/offers/137286', '/venicegym/offers/137284']; $LAST = '/venicegym/offers/141558'; $productsCol = collect($products); // 1) Mettre 137286 et 137284 en premier [$first, $rest] = $productsCol->partition(function ($p) use ($FIRST) { return in_array($p->offre->offre_id ?? '', $FIRST, true); }); // Ordonner ce bloc "first" selon l'ordre voulu dans $FIRST $first = $first->sortBy(function ($p) use ($FIRST) { return array_search($p->offre->offre_id ?? '', $FIRST, true); }); // 2) Mettre 141558 en dernier [$last, $middle] = $rest->partition(function ($p) use ($LAST) { return ($p->offre->offre_id ?? '') === $LAST; }); // 3) Ordre final : FIRST -> MIDDLE -> LAST $orderedProducts = $first->concat($middle)->concat($last); @endphp @foreach ($orderedProducts as $product) @php $offer = $product->offre ?? null; $offerUri = $offer->offre_id ?? ''; $highlight = $offerUri === '/venicegym/offers/141558'; @endphp

{{ $product->name }}

{{ $product->name }}
{{-- Prix de l'offre simple ou de l'offre principale du bundle --}} @php $offer = $product->offre ?? null; $offerId = $offer ? (int) $offer->id : 0; $toEuro = function ($v) { $isCents = is_numeric($v) && (int)$v == $v && $v >= 1000; return number_format($isCents ? ($v / 100) : $v, 2, ',', ' '); }; $primarySubOffer = $offer?->primarySousOffre(); $hasBundle = $primarySubOffer !== null; $bundleBasePrice = $primarySubOffer?->priceTI; $qrCodeOffer = $offer?->qrCodeSousOffre(); $isWeekly = $offer && ( in_array($offer->offre_id ?? '', [ '/venicegym/offers/137286', '/venicegym/offers/137284' ], true) || ($offer->rhythmBilling ?? null) === 'week4' ); $weeklyAmount = $offer ? ((isset($offer->recurrentPriceTI) && $offer->recurrentPriceTI > 0) ? $offer->recurrentPriceTI : ($offer->priceTI / 4)) : null; @endphp @if ($product->type === 'counter' && $offer)

{{ $toEuro($hasBundle ? $bundleBasePrice : $offer->priceTI) }} €

@elseif ($product->type === 'subscription' && $offer) @if ($hasBundle && !in_array((int) $product->product_id, [300178, 300180], true))

{{ $toEuro($bundleBasePrice / 4) }} € / semaine

@elseif ($hasBundle)

{{ $toEuro($bundleBasePrice) }} €

@elseif ($isWeekly)

{{ $toEuro($weeklyAmount) }} € / semaine

@else

{{ $toEuro($offer->priceTI) }} €

@endif @endif @if ($qrCodeOffer)

@if ($qrCodeOffer->priceTI > 0) Accès QR Code et application inclus : {{ $toEuro($qrCodeOffer->priceTI) }} € @else Accès QR Code et application inclus sans supplément @endif

@endif
{{ $product->offre->info_acces_duree }}

{{ $product->offre->info_duree }}

{{ $product->offre->info_acces_service }}

{{ $product->offre->info_engagement }}

{{-- Bouton choisir (PAS de ici) --}}
@endforeach

Site web réalisé par Kalam Conseil

@endsection @section('js') @endsection