@extends('layouts.app') @section('title', 'Finaliser votre commande | OraFresh Beauty') @section('content')
Commande

Finaliser votre commande

@csrf @auth @if(!auth()->user()->loyaltyPoints()->where('action_type', 'referral_receiver')->exists())

Avez-vous un code de parrainage ?

Entrez le code d'un ami et recevez {{ \App\Models\LoyaltyPoint::POINTS_REFERRAL_GIVER }} points bonus ! 🎁

@endif @endauth

Informations de livraison

@guest
@endguest

Mode de paiement

Résumé de la commande {{ count($cart) }}

@php $subtotal = 0; @endphp @foreach($cart as $id => $item) @php $subtotal += $item['price'] * $item['quantity']; @endphp
{{ $item['name'] }}
@csrf {{ $item['quantity'] }}
@csrf
{{ number_format($item['price'] * $item['quantity'], 2) }} DT
@endforeach
@auth @php $availablePoints = auth()->user()->total_loyalty_points ?? 0; $pointsValue = $availablePoints; // 1 point = 1 DT @endphp @if($availablePoints > 0)
{{ $availablePoints }} points disponibles ({{ number_format($availablePoints * 0.01, 2) }} DT)

💎 10 pts = 0.1 DT | 100 pts = 1 DT

@endif @endauth
Sous-total {{ number_format($subtotal, 2) }} DT
@if(session('coupon'))
Réduction ({{ session('coupon')['code'] }}) -{{ number_format(session('coupon')['discount'], 2) }} DT
@endif
Livraison
7,00 DT Gratuite dès 60 DT
Total {{ number_format($subtotal + 7 - (session('coupon')['discount'] ?? 0), 2) }} DT
Paiement sécurisé
Livraison rapide
@endsection