@extends('layouts.master') @section('title') Aramian Brother`s Jewelry @endsection @section('content') @php use App\Helpers\Helpers; @endphp {{-- --}} {{-- --}} @if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @if($errors) @foreach ($errors->all() as $error)
{{ $error }}
@endforeach @endif
{{-- --}} {{-- --}}
@csrf

Shipping Details

@if ($errors->has('fullname')) {{ $errors->first('fullname') }} @endif
@if ($errors->has('street_address')) {{ $errors->first('street_address') }} @endif
@if ($errors->has('country')) {{ $errors->first('country') }} @endif
@if ($errors->has('state_province')) {{ $errors->first('state_province') }} @endif
@if ($errors->has('town_city')) {{ $errors->first('town_city') }} @endif
@if ($errors->has('zip')) {{ $errors->first('zip') }} @endif
@if ($errors->has('phone_number')) {{ $errors->first('phone_number') }} @endif
@if ($errors->has('email')) {{ $errors->first('email') }} @endif
@if ($errors->has('password')) {{ $errors->first('password') }} @endif
{{--
--}}

Your order

@php $subTotal=0; $discountPrice = 0; @endphp @foreach ($addCart as $cart) @php if($cart->product->discount_price > 0) $price=$cart->product->discount_price; else{ $price=$cart->product->price; } $cartTotal = $price * $cart->products_count @endphp @php $subTotal+=$price * $cart->products_count; $discountPrice+=$cart->product->price * $cart->products_count; @endphp @endforeach @php if($subTotal > 0){ $vat = $subTotal * 10.25 /100; }else{ $vat = 0; } @endphp @php $discountSubTotal = $discountPrice+$vat; $total = $subTotal+$vat @endphp @if ($total < $discountSubTotal) @php $discountTotal = $discountSubTotal - $discountPrice + $vat; // dd($discountTotal); @endphp @endif
Product Total
{{$cart->product->title}} × {{$cart->products_count}} {{ Helpers::getUserNumberFormat()->format($cartTotal) }}
Cart Subtotal {{ Helpers::getUserNumberFormat()->format($subTotal) }}
Shipping $0
Tax {{ Helpers::getUserNumberFormat()->format($vat) }}
Discount {{ Helpers::getUserNumberFormat()->format($discountTotal) }}
Order Total {{ Helpers::getUserNumberFormat()->format($total) }}
@endsection