{{-- {{dd(session('my_card'))}} --}}
@php $total_amount = []; if (!session()->has('my_card')){ $my_items = []; }else{ $my_items = session()->get('my_card'); } @endphp @foreach($my_items as $model => $items) @if($model == "App\Models\Product") @foreach($items as $model_id => $q) @php $product = \App\Models\Product::find($model_id); array_push($total_amount,($product->product_prices->first())?$product->product_prices->first()->price * $q:0) @endphp
{{$product->name_ar}}
{{--

Mr: Donatelo

--}}

{{($product->product_prices->first())?$product->product_prices->first()->price ." ". $product->product_prices->first()->currency->ar:''}}

@endforeach @elseif($model == "App\Models\Offer") @foreach($items as $model_id => $q) @php $offer = \App\Models\Offer::find($model_id); $offer_product = $offer->products->first(); array_push($total_amount,$offer->amount * $q) @endphp
{{$offer_product->name_ar}}
{{--

Mr: Donatelo

--}}

{{$offer->amount}} {{($offer_product->product_prices->first())?$offer_product->product_prices->first()->currency->ar:''}}

@endforeach @elseif($model == "App\Models\Package") @foreach($items as $model_id => $q) @php $package = \App\Models\Package::find($model_id); $package_product = $package->products->first(); array_push($total_amount,$package->total_amount * $q) @endphp
{{$package->name}}
{{--

Mr: Donatelo

--}}

{{$package->total_amount}} {{($package_product->product_prices->first())?$package_product->product_prices->first()->currency->ar:''}}

@endforeach @endif @endforeach

الملخص : @livewire('pro-online.get-total-card-qty-component') دورة

الاجمالي : {{array_sum($total_amount)}}

{{--

الاجمالي بالدولار الامريكي : 800 USD

--}} الدفع