{{-- HEADER --}}

🔥 Flash Sale

Ends in:
View All
{{-- PRODUCTS --}}
@foreach($flashProducts as $product)
{{-- DISCOUNT BADGE --}} @if($product->discount > 0) -{{ round(($product->discount / $product->unit_price) * 100) }}% @endif {{-- IMAGE --}}
{{ $product->name }}
@php $price = $product->unit_price - $product->discount; @endphp {{-- BODY --}}
{{ $product->category->name }}
{{ Str::limit($product->name, 40) }}
Rs {{ number_format($price, 2) }}
@if($product->discount > 0) Rs {{ number_format($product->unit_price, 2) }} @endif
{{-- ACTION --}} @php $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
@endforeach