@php use Illuminate\Support\Str; $quantities = collect($cartItems)->pluck('quantity', 'product_id'); $cdr_pdfs = collect($cartItems)->pluck('cdr_pdf', 'product_id'); $imagess = collect($cartItems)->pluck('images', 'product_id'); $user_texts = collect($cartItems)->pluck('user_text', 'product_id'); $previews = collect($cartItems)->pluck('preview', 'product_id'); @endphp @if (count($product) == 0)

Your Cart is Empty

Looks like you haven't added anything to your cart yet. Let's explore some great products!

Browse Products
@endif
@foreach ($product as $i => $item) @php $img = $images[$item['id']][0]['image'] ?? 'default.jpg'; $quantity = $quantities[$item['id']] ?? 1; $price = $item['mrp']; $offerPrice = $item['sales_price']; $discount = $price - $offerPrice; $cdr_pdf = $cdr_pdfs[$item['id']]; $images = $imagess[$item['id']]; $user_text = $user_texts[$item['id']]; $preview = $previews[$item['id']]; @endphp
{{ Str::limit($item['product_name'], 40) }}
Brand: {{ $item['brand']['name'] ?? 'Unknown' }}
@if ($discount > 0) {{ round(($discount / $price) * 100) }}% OFF @endif
₹{{ $offerPrice }}
@if ($discount > 0)
₹{{ $price }}
@endif
@if ($isDb)
Remove
@else
Remove
@endif
@if (!empty($cdr_pdf)) @php $cdr_pdf = json_decode($cdr_pdf, true); @endphp @foreach ($cdr_pdf as $item) @endforeach @endif @if (!empty($preview)) @php $preview = json_decode($preview, true); @endphp @foreach ($preview as $item) @endforeach @endif
@endforeach
@if (count($product) > 0)
@php // $subtotal = 0; // $shipping = 0; // $gst = 0; // foreach ($product as $item) { // $qty = $quantities[$item['id']] ?? 1; // $subtotal += $item['sales_price'] * $qty; // $gst += $item['sales_price'] * $qty * ($item['gst'] / 100); // } // $gst = round($gst, 2); // $total = $subtotal; @endphp
Still exploring?

Keep browsing and find something you love.

Continue Shopping
@endif