@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 }}
{{-- --- Bloc prix (inchangé) --- --}} @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, ',', ' '); }; $isWeekly = $offer && ( in_array($offerId, [11, 12], 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($offer->priceTI) }} €

@elseif ($product->type === 'subscription' && $offer) @if ($isWeekly)

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

@else

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

@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