@extends("general_base") @section("title", "Computers, Laptops, and IT Solutions Hub") @section("style") @endsection @section("content")

@if($activeDeal) @php $words = explode(' ', $activeDeal->name); $firstWord = array_shift($words); $remainingWords = implode(' ', $words); @endphp {{ $firstWord }} @if($remainingWords){{ $remainingWords }}@endif @else No Best Deals Available! @endif

@if($dealEndDate)
@endif
@php $services = $homeCustomization['services'] ?? []; @endphp @if(!empty($services)) @foreach($services as $i => $f)

{{ $f['title'] ?? '' }}

{{ $f['text'] ?? '' }}

@endforeach @endif

Latest Products

@foreach($latestProducts->take(12) as $product)
@if($product->images->first()) {{ $product->title }} @else Default Image @endif
  • @php $defaultInStock = ($product->relationLoaded('variations') ? (int)optional($product->variations->first())->in_stock > 0 : (int)($product->variations()->where('default', true)->value('in_stock') ?? 0) > 0); $variantsCount = $product->variants_count ?? $product->variations()->count(); $inStockCount = $product->in_stock_variants_count ?? $product->variations()->where('in_stock', '>', 0)->count(); $allOut = ($inStockCount === 0); $defaultOut = !$defaultInStock; @endphp @if($variantsCount > 1 && $defaultOut && !$allOut) Open @elseif(($variantsCount === 1 && $defaultOut) || ($variantsCount > 1 && $allOut)) Out of stock @else Add to Cart @endif
{{ $product->title }}
@php $avg = $product->average_rating ?? ($product->averageRating ?? 0); @endphp
@php $defaultVariation = $product->variations->where('default', true)->first(); @endphp @if($defaultVariation)
৳{{ number_format($defaultVariation->sale_price) }}
@if($defaultVariation->regular_price > $defaultVariation->sale_price)
৳{{ number_format($defaultVariation->regular_price) }}
@endif @endif
@php $icon = 'ri-star-line'; if ($avg >= 0.75) { $icon = 'ri-star-fill'; } elseif ($avg >= 0.25) { $icon = 'ri-star-half-s-fill'; } @endphp {{ number_format($avg,1) }}
@endforeach
@endsection @section("script") @endsection