@foreach($products as $product)
@php $images = array_filter(explode(',', $product->image)); $main_image = (!empty($images[0]) && $images[0] != 'zummXD2dvAtI.png') ? $images[0] : 'no-image.jpg'; $hover_image = (isset($images[1]) && !empty($images[1]) && $images[1] != $main_image) ? $images[1] : null; @endphp {{ $product->name }} @if($hover_image) {{ $product->name }} @endif @php $stock_qty = DB::table('product_warehouse')->where('product_id', $product->id)->sum('qty'); @endphp @if($stock_qty <= 0)
Sold Out
@elseif($product->promotion_price)
-{{ round((($product->price - $product->promotion_price) / $product->price) * 100) }}%
@endif
{{ $product->name }} @if($product->promotion_price) Rs {{ number_format($product->price, 0) }} Rs {{ number_format($product->promotion_price, 0) }} @else Rs {{ number_format($product->price, 0) }} @endif
@endforeach