Your Cart

@php if (auth()->check()) { $cartData = isset($cartData) ? $cartData : \App\Models\Cart::with(['product','variant'])->where('user_id', auth()->id())->get(); $frequentlyBought = isset($frequentlyBought) ? $frequentlyBought : \App\Models\Product::with(['category', 'variants'])->whereIn('category_id',[2,3])->whereNotIn('id', $cartData->pluck('product_id')->toArray())->whereNotIn('id', $cartData->pluck('product_id')->toArray())->with('variants')->select('id','images', 'name', 'slug', 'images', 'category_id')->active()->inRandomOrder()->limit(5)->get(); } else { $guest_id = Session::get('guest_id') ?? Cookie::get('guest_id') ?? null; $cartData = \App\Models\GuestCart::with(['product','variant'])->where('guest_id', $guest_id)->get() ?? collect(); $frequentlyBought = isset($frequentlyBought) ? $frequentlyBought : \App\Models\Product::with(['category', 'variants'])->whereIn('category_id',[2,3])->whereNotIn('id', $cartData->pluck('product_id')->toArray())->whereNotIn('id', $cartData->pluck('product_id')->toArray())->with('variants')->select('id','images', 'name', 'slug', 'images', 'category_id')->active()->inRandomOrder()->limit(5)->get(); } $price=0; foreach ($cartData as $key => $value) { $price+= $value->variant->price * $value->quantity; } @endphp
@forelse($cartData as $item)
{{--
{{$item->quantity}}
--}}

{{$item->quantity}} x

@php $images = explode(',', $item->product->images); $first_img = $images[0]; @endphp

₹ {{formatIndianNumber($item->variant->price) ?? ''}}

@empty

Your Cart is Empty

@endforelse {{--

New Customer?

Create an account with us and you’ll be able to:

  • Check out faster
  • Save multiple shipping anddesses
  • Access your order history
  • Track new orders
  • Save items to your Wishlist
Create an account --}}

Edit {{--

Total Price

₹ {{formatIndianNumber($price-$bundle_amount) ?? ''}}

Bundle Discount 5% off ( ₹{{$bundle_amount ?? ''}} )
--}}

Frequently Bought

@foreach($frequentlyBought as $item) @endforeach {{--

New Customer?

Create an account with us and you’ll be able to:

  • Check out faster
  • Save multiple shipping anddesses
  • Access your order history
  • Track new orders
  • Save items to your Wishlist
Create an account --}}

More {{--

Total Price

₹ {{formatIndianNumber($price-$bundle_amount) ?? ''}}

Bundle Discount 5% off ( ₹{{$bundle_amount ?? ''}} )
--}}