@php
$total = 0;
@endphp
@foreach ($productItems as $key => $item)
@php
$product = App\Models\Shop\Product::where('id', $key)->first();
$total += $item['price'];
// calculate tax
$taxAmount = $tax->product_tax_amount;
@endphp
@php
$position = $currencyInfo->base_currency_symbol_position;
$symbol = $currencyInfo->base_currency_symbol;
@endphp
{{ __('Cart Total') }}
{{ $position == 'left' ? $symbol : '' }}{{ $total }}{{ $position == 'right' ? $symbol : '' }}
@if (Session::has('discount'))
{{ __('Discount') }}
- {{ $position == 'left' ? $symbol : '' }}{{ Session::get('discount') }}{{ $position == 'right' ? $symbol : '' }}
{{ __('Subtotal ') }}
{{ $position == 'left' ? $symbol : '' }}{{ $total - Session::get('discount') }}{{ $position == 'right' ? $symbol : '' }}
@endif
@php
$tax_amount = ($total - Session::get('discount')) * ($taxAmount / 100);
@endphp
{{ __('Tax') }} {{ $tax->product_tax_amount . '%' }}
+ {{ $position == 'left' ? $symbol : '' }}{{ number_format($tax_amount, 2, '.', ',') }}{{ $position == 'right' ? $symbol : '' }}
@if (!onlyDigitalItemsInCart())
@php
$shipping_id = Session::get('shipping_id');
if ($shipping_id != null) {
$charge = App\Models\Shop\ShippingCharge::where('id', $shipping_id)->first();
$shipping_charge = $charge->shipping_charge;
} else {
$charge = App\Models\Shop\ShippingCharge::first();
$shipping_charge = $charge->shipping_charge;
}
@endphp
{{ __('Shipping Charge') }}
+ {{ $position == 'left' ? $symbol : '' }}{{ $shipping_charge }}{{ $position == 'right' ? $symbol : '' }}
@else
@php
$shipping_charge = 0;
@endphp
@endif
@php
// calculate grand total
$grandTotal = $total - Session::get('discount') + $shipping_charge + $tax_amount;
@endphp
{{ __('Total') }}
{{ $position == 'left' ? $symbol : '' }}
{{ number_format($grandTotal, 2, '.', ',') }}
{{ $position == 'right' ? $symbol : '' }}