@extends('layouts.app') @section('content')

Search Product for Bill

{{-- Buy Outside Button --}}
{{-- Search Form --}}
{{-- Modal for Product Quantity --}} {{-- Outside Order Form --}} {{-- Rest of your existing content (Search Results and Cart Section) --}} @if(isset($products) && $products->count())

Search Results

@foreach($products as $product)
{{-- Top Section: Details and Price --}}
{{-- Left: Product Details --}}

{{ $product->name }}

Company: {{ $product->company }}

Category: @foreach ((is_array($product->categories) ? $product->categories : json_decode($product->categories, true) ?? []) as $category) {{ $category }} @endforeach

Salt: {{ $product->salt }}

Unit Type: {{ $product->unit_type }}

Stock: {{ $product->quantity }} left

{{-- Right: Price Details --}}

Retail: {{ $product->retail_price }}

Doctor: {{ $product->doctor_price }}

Local: {{ $product->local_price }}

Purchase: {{ $product->purchase_price }}

{{-- Product Image --}}
{{ $product->name }}
{{-- Bottom Section: Button --}}
@php $productJson = json_encode([ 'id' => $product->id, 'name' => $product->name, 'company' => $product->company, 'unit_type' => $product->unit_type, 'salt' => $product->salt, 'stock' => $product->quantity, 'category' => is_array($product->categories) ? implode(', ', $product->categories) : $product->categories, ]); @endphp @if ($product->quantity > 0) @else
Out of Stock
Buy Outside @endif
@endforeach
@endif {{-- Cart Section --}}

Cart

@csrf
@endsection @section('scripts') @endsection