{{--
--}}
Showing {{ $products->firstItem() }}-{{ $products->lastItem() }} of {{ $products->total() }} Results
filter
@forelse ($products as $key => $value)
@empty
@php
$oldPrice = $value->old_price;
$newPrice = $value->new_price;
if ($oldPrice > 0) {
$discount = (($oldPrice - $newPrice) / $oldPrice) * 100;
$discount = round($discount); // round kore integer %
} else {
$discount = 0;
}
$images = $value->images; // সব images
// main image (প্রথম)
$firstImage = $images->first()->image ?? 'https://placehold.co/400x400/f8bbd0/ffffff?text=Product';
// secondary image (random, first বাদ দিয়ে)
if($images->count() > 1) {
$secondImage = $images->skip(1)->random()->image;
} else {
$secondImage = $firstImage; // না থাকলে main image দেখাবে
}
@endphp
@if ($discount > 0)
{{ $discount }}
%
off
@endif
{{ $value->name }}
৳ {{ $value->new_price }}
{{ $value->old_price }}
50
Panjabi
No products available in this category!
@endforelse
{{ $products->links('pagination::bootstrap-4') }}