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

Category/{{$category->name}}

@foreach($products as $product) @php $originalPrice = $product->unit_price; $discount = $product->discount; $price = $originalPrice - $discount; $choices = []; if($product->choice_options){ $rawChoices = json_decode($product->choice_options, true); foreach($rawChoices as $choice){ $choices[] = [ 'attribute_id' => $choice['attribute_id'], 'attribute_name' => \App\Models\Attribute::find($choice['attribute_id'])->name ?? '', 'values' => $choice['values'] ]; } } @endphp
{{ $product->name }}
{{ $product->category->name }}
{{ Str::limit($product->name, 40) }}
Rs {{ number_format($price,2) }} @if($discount > 0)
Rs {{ number_format($product->unit_price,2) }} @endif
@endforeach
@section('modal') @include('frontend.modal.addtocartmodal') @endsection @endsection @section('script') @endsection