@extends('frontend.layout.app') @section('content')

@if($alreadyPurchasedCompulsoryItems) Additional Items & AddOns @else Compulsory Items & AddOns @endif

  • Home
  • @if($alreadyPurchasedCompulsoryItems) Additional Items @else Compulsory Items @endif
@csrf {{-- Show message if compulsory items already purchased --}} @if($alreadyPurchasedCompulsoryItems) @endif {{-- Show compulsory items only if not purchased --}} @if(!$alreadyPurchasedCompulsoryItems)

Order Compulsory Items

@if($items->count() > 0)
@foreach ($items as $item) @endforeach
Image Item Name School Price MRP Quantity
@if ($item->image) {{ $item->name }} @else
No Image
@endif
{{ $item->name }} @if($item->stock_status != 'in_stock') Out of Stock @endif {{ $item->school ? $item->school->name : '-' }} ₹{{ number_format($item->price, 2) }} ₹{{ number_format($item->mrp, 2) }} stock_status != 'in_stock' ? 'disabled' : '' }}>
@else
No compulsory items available for your standard/gender.
@endif @endif {{-- Always show Add Ons section --}}
Add-Ons Available (School Specific)
@if($addons->count())
@foreach ($addons as $add)
@if($add->image) {{ $add->name }} @else No Image @endif
Price: @if(isset($add->sp)) ₹{{ number_format($add->sp, 2) }} @else N/A @endif
@endforeach
@else
No add-ons available for this school at the moment.
@endif
{{-- Submit button with dynamic text and state --}}
@php $hasItemsToOrder = false; // Check if there are in-stock compulsory items if (!$alreadyPurchasedCompulsoryItems && $items->where('stock_status', 'in_stock')->count() > 0) { $hasItemsToOrder = true; } // Check if there are addons available if ($addons->count() > 0) { $hasItemsToOrder = true; } @endphp @if(!$hasItemsToOrder)
@if($alreadyPurchasedCompulsoryItems) No add-ons available to order @else No items available to order @endif
@endif
@push('styles') @endpush @endsection