@extends('layouts.client') @section('title') {{$title}} @endsection @section('content-clients')
@csrf
{{-- SẢN PHẨM TRONG ĐƠN --}} @if(!Auth::check())
Sản phẩm trong đơn ({{count(Cart::content())}})
@foreach(Cart::content() as $item)
{{ $item->name }} (SL: {{ $item->qty }})
Danh mục: {{ $item->options->ten_danh_muc }} | NSX: {{ $item->options->ten_NSX }}
Giá sản phẩm: {{number_format($item->price,0,',','.')}}đ
{{ number_format($item->price * $item->qty, 0, ',', '.') }}đ
@endforeach
@else
Sản phẩm trong đơn ({{count($cart)}})
@foreach($products as $item)
{{ $item->products->ten_san_pham }} (SL: {{ $item->qty }})
Danh mục: {{ $item->products->danhMuc->ten_danh_muc }} | NSX: {{ $item->products->nhaSanXuat->ten_NSX }}
Giá sản phẩm: {{number_format($item->price,0,',','.')}}đ
{{ number_format($item->price * $item->qty, 0, ',', '.') }}đ
@endforeach
@endif @if(Auth::check()) {{-- Đã đăng nhập, lấy tên, sđt người đang đăng nhập --}}
Người đặt hàng
Họ tên: {{ Auth::user()->ho_ten }}
Email: {{ Auth::user()->email }}
@if(empty(Auth::user()->so_dien_thoai)) @else
Số điện thoại: {{ Auth::user()->so_dien_thoai }}
@endif
@else {{-- Nếu chưa đăng nhập thì hiển thị form người đặt hàng --}}
Người đặt hàng
@error('ho_ten_VL') {{$message}} @enderror @error('so_dien_thoai_VL') {{$message}} @enderror
@endif {{-- Địa chỉ nhận hàng --}} @if(Auth::check()) @if(count($addresses) == 0) {{-- Nếu chưa có địa chỉ thì hiển thị form thêm địa chỉ --}}
Địa chỉ nhận hàng
@error('province') {{$message}} @enderror
@error('district') {{$message}} @enderror
@error('ward') {{$message}} @enderror
@error('address_detail') {{$message}} @enderror
@else {{-- Đã có địa chỉ nhận hàng --}}
Địa chỉ nhận hàng
Chỉnh sửa
@foreach($addresses as $key => $address)
mac_dinh ? 'checked' : '' }} >
@endforeach
@endif @else {{-- Nếu chưa đăng nhập thì hiển thị form địa chỉ nhận hàng --}}
Địa chỉ nhận hàng
@error('province') {{$message}} @enderror
@error('district') {{$message}} @enderror
@error('ward') {{$message}} @enderror
@error('address_detail') {{$message}} @enderror
@endif {{-- Xuất hóa đơn điện tử --}}
Xuất hóa đơn điện tử
{{-- Thông tin khuyến mãi --}} @if($promotion) {{-- Lựa chọn thanh toán --}}
Phương thức thanh toán (*)
@error('payment_method') {{$message}} @enderror
{{--
--}}
Đã Áp Dụng Phiếu Giảm Giá
{{ $promotion->ma_khuyen_mai }}

Số tiền giảm: @if($promotion->hinh_thuc_giam_gia == 1) Giảm {{ $promotion->gia_tri_khuyen_mai }}% giá trị đơn hàng @else Giảm {{ number_format($promotion->gia_tri_khuyen_mai, 0, ',', '.') }} đ @endif

Giá trị đơn hàng tối thiểu: {{ number_format($promotion->gia_tri_toi_thieu, 0, ',', '.') }} đ

Áp dụng từ {{ \Carbon\Carbon::parse($promotion->ngay_bat_dau)->format('d/m/Y H:i:s') }} đến {{ \Carbon\Carbon::parse($promotion->ngay_ket_thuc)->format('d/m/Y H:i:s') }}

@else
Phương thức thanh toán (*)
@error('payment_method') {{$message}} @enderror
{{--
--}}
@endif
{{-- THÔNG TIN ĐƠN HÀNG --}} @if(Auth::check())
Thông tin đơn hàng
{{-- Tổng tiền --}}
Tổng tiền
{{ number_format(intval(str_replace('.', '', $cartTotal)), 0, ',', '.') }}đ
{{-- Tổng khuyến mãi --}}
Tổng khuyến mãi
@if($promotion) -{{ number_format(intval($promotionAmount), 0, ',', '.') }}đ @else 0đ @endif
{{-- Phí vận chuyển --}}
Phí vận chuyển
0 đ
@php $totalPriceOld = intval(str_replace('.', '', $totalPrice)); @endphp {{-- Cần thanh toán --}}
Cần thanh toán
{{ number_format($totalAfterPromotion, 0, ',', '.') }}đ
@else
Thông tin đơn hàng
Tổng tiền
{{Cart::total()}}đ
{{-- Tổng khuyến mãi --}}
Tổng khuyến mãi
@php $totalPriceOld = intval(str_replace('.', '', Cart::total())); $totalPrice = intval(str_replace('.', '', Cart::total())); @endphp @php if($promotion){ $totalPriceOld = intval(str_replace('.', '', Cart::total())); $totalPrice = intval(str_replace('.', '', Cart::total())); if($promotion->hinh_thuc_giam_gia == 1){ $totalPrice = $totalPrice - ($totalPrice * $promotion->gia_tri_khuyen_mai / 100); }else{ $totalPrice = $totalPrice - $promotion->gia_tri_khuyen_mai; } } @endphp
@if($promotion) @if($promotion->hinh_thuc_giam_gia == 1) -{{number_format($totalPriceOld * $promotion->gia_tri_khuyen_mai / 100,0,',','.')}}đ @else -{{number_format($promotion->gia_tri_khuyen_mai,0,',','.')}}đ @endif @else 0đ @endif
{{-- Phí vận chuyển --}}
Phí vận chuyển
0 VND
{{-- Cần thanh toán --}}
Cần thanh toán
{{ number_format(intval(str_replace('.', '', $totalPrice)), 0, ',', '.') }}đ
@endif @if($promotion) @endif {{-- BTN Đặt Hàng --}}
Bằng việc tiến hành đặt mua hàng, bạn đồng ý với
Điều khoản dịch vụChính sách xử lý dữ liệu cá nhân
của Gia Dụng Văn Hậu
@endsection @section('stylesheet') @endsection @section('scriptsPayment') @endsection