@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
@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; } @endphp @php $cartTotal=$price * $cart->products_count; @endphp {{-- --}} @php $subTotal+=$price * $cart->products_count; $discountPrice+=$cart->product->price * $cart->products_count; @endphp @endforeach
Delete Image Product Price Size Quantity Total
{{$cart->product->title}} {{ Helpers::getUserNumberFormat()->format($price) }} @if ($cart->product->category->short_name == 'rings') @endif {{ Helpers::getUserNumberFormat()->format($cartTotal) }}In Stock
{{--

Coupon

Enter your coupon code if you have one.

--}}

Cart Totals

Subtotal

{{ Helpers::getUserNumberFormat()->format($subTotal) }}

Shipping

$0

Tax

@php if($subTotal > 0){ $vat = $subTotal * 10.25 /100; }else{ $vat = 0; } @endphp

{{ Helpers::getUserNumberFormat()->format($vat) }}

{{-- Calculate shipping --}} @php $discountSubTotal = $discountPrice+$vat; $total = $subTotal+$vat; // dd($discountTotal); @endphp @if ($total < $discountSubTotal) @php $discountTotal = $discountSubTotal - $discountPrice + $vat; $total = $subTotal+$vat; // dd($discountTotal); @endphp

Discount

{{ Helpers::getUserNumberFormat()->format($discountTotal)}}

@endif

Total

{{ Helpers::getUserNumberFormat()->format($total)}}

@endsection