@extends('web.home.layout.master') @section('content')
@php $user = Auth::user(); @endphp @if ($user == null)

Returning customer? Please Login

@endif
@php $productdata = App\Models\Product::where('id', $productid)->first(); $total = $productprice * $quantity; @endphp @php try { $user = Auth::user(); $totalPrice = 0; $totalWeightInGrams = 0; $productdata = App\Models\Product::where('id', $productid)->first(); $totalWeightInGrams = $productdata->weight * $quantity; $totalWeightInKg = $totalWeightInGrams / 1000; // Calculate shipping price based on total weight in kilograms if ($totalWeightInKg > 1) { $shippingPrice = $totalWeightInKg * 80; } else { $shippingPrice = 0; } // LKR 80 per kg $totalPriceWithShipping = $totalPrice + $shippingPrice; } catch (\Throwable $th) { DB::table('error_logs')->insert([ 'message' => $th->getMessage(), 'file' => $th->getFile(), 'line' => $th->getLine(), 'trace' => $th->getTraceAsString(), 'created_at' => now(), ]); } @endphp
@csrf

Shipping details

@if (Auth::check()) @php $user = Auth::user(); @endphp @else @endif
@if (Auth::check()) @else
@endif
{{--
@php $areas = App\Models\Area::where('status', 1)->get(); $selectedArea = isset($userdata) ? $userdata->area : null; $sortedAreas = $areas->sortBy('area_name'); @endphp
--}}

Order Summary

Product Price Color Qty Subtotal
{{ $productdata->product_name }} LKR {{ number_format($productprice, 2) }} {{ $quantity }} LKR {{ number_format($total, 2) }}
Shipping (Included Weight*) LKR 0.00
Total LKR 0.00

@endsection