@extends("frontend.main") @section("content") @php $total = 0 @endphp
@if(! empty( $cart) )
@csrf @if(count($cart))
@foreach($cart as $key => $item) @if($item['product_type'] == 4)

{{ $item['product']->name }}



Chọn hệ điều hành
@if($item['os_group']->count()) @foreach($item['os_group']->all() as $_item)
{{ $_item->name }} {{ $_item->name }}
@endforeach @endif

Dịch vụ bổ sung
@if($item['addon']->count()) @foreach($item['addon']->all() as $_item)
@endforeach @endif
@else

{{ $item['product']->name }}


@endif @endforeach
@endif
Thông tin đơn hàng
@foreach($cart as $key => $item) @if(! is_null(session('vps')) && $item['product_type'] === 4 ) @foreach(session('vps')[$key]['addon'] as $_key => $_add) @if($_add['value']) @php($total += $_add['value'] * $_add['price'] * session('vps')[$key]['time_buy']) @endif @endforeach @endif
{{ $item['product']->name }} @switch($item['product_type']) @case(3) x {{ (! is_null(session('hosting')) ? session('hosting')[$key]['time_buy'] : null) ?? ((! is_null(old('hosting')) ? old('hosting')[$key]['time_buy'] : null ) ?? 12) }} Tháng @break @case(4) x {{ (! is_null(session('vps')) ? session('vps')[$key]['time_buy'] : null) ?? ((! is_null(old('vps')) ? old('vps')[$key]['time_buy'] : null ) ?? 1) }} Tháng @break @endswitch
@switch($item['product_type']) @case(3) {{ number_format(($item['price'] * ((! is_null(session('hosting')) ? session('hosting')[$key]['time_buy'] : null) ?? ((! is_null(old('hosting')) ? old('hosting')[$key]['time_buy'] : null ) ?? 12))),0,'.',',') }} đ @php($total += $item['price']* ((! is_null(session('hosting')) ? session('hosting')[$key]['time_buy'] : null) ?? ((! is_null(old('hosting')) ? old('hosting')[$key]['time_buy'] : null ) ?? 12))) @break @case(4) {{ number_format($item['price'] * ((! is_null(session('vps')) ? session('vps')[$key]['time_buy'] : null) ?? ((! is_null(old('vps')) ? old('vps')[$key]['time_buy'] : null ) ?? 1)),0,'.',',') }} đ @php($total += $item['price']* ((! is_null(session('vps')) ? session('vps')[$key]['time_buy'] : null) ?? ((! is_null(old('vps')) ? old('vps')[$key]['time_buy'] : null ) ?? 1))) @break @endswitch
Dịch vụ bổ sung
@if($item['product_type'] === 4) @if(! is_null(session('vps'))) @foreach(session('vps')[$key]['addon'] as $_key => $_add) @if($_add['value'])
{{ strtoupper($_key) }}
{{ number_format($_add['value'] * $_add['price'],0,'.','.') }} đ
X {{$_add['value']}}
@endif @endforeach @endif @endif
@endforeach @if(session('coupon'))
Giảm giá @switch(session('coupon')['coupon_type']) @case(1) {{ number_format((session('coupon')['coupon_value'] / 100 ) * $total,0,'.',',') }} đ @php($total -= (session('coupon')['coupon_value'] / 100 ) * $total) @break @case(2) {{ number_format(session('coupon')['coupon_value'],0,'.',',') }} đ @php($total -= session('coupon')['coupon_value']) @break @endswitch
@endif @if($total < 0) @php($total = 0) @endif
Tổng tiền (chưa VAT) {{ number_format($total,0,'.',',') }} đ
VAT {{ number_format($total * (10/100),0,'.',',') }} @php($total += $total * (10/100) ) đ
Thành tiền {{ number_format($total,0,'.',',') }} đ
@if(! session('coupon'))
Bạn có mã giảm giá?
@csrf
@endif
@else
@endif
@endsection @if(! empty($cart)) @push('viewScripts') @endpush @endif