@extends('frontend.layouts.app') @section('content') Home {{ $menu->name }} {{ $menu->name }} {{ $products->count() }} item{{ $products->count() > 1 ? 's' : '' }} found @if($products->count()) @foreach ($products as $product) @php // মূল দাম $originalPrice = (float) ($product->price ?? 0); // ✅ আসল discount column ব্যবহার করছি $offerPrice = (float) ($product->discount_price ?? 0); // offer থাকলে: discount_price > 0 এবং price এর চেয়ে কম $hasOffer = $offerPrice > 0 && $offerPrice < $originalPrice; // কার্ডে যে current/sale price দেখাবো $salePrice = $hasOffer ? $offerPrice : $originalPrice; // পুরনো দাম (strike-through) – শুধুই offer থাকলে $oldPrice = $hasOffer ? $originalPrice : null; @endphp {{-- Product Image --}} {{-- Product Content --}} {{ $product->name }} {{-- current / sale price --}} ৳ {{ number_format($salePrice, 0) }} {{-- পুরনো দাম (strike) – offer থাকলে --}} @if($oldPrice) ৳ {{ number_format($oldPrice, 0) }} @endif @endforeach @else No products found. Please check back later or browse another category. @endif @endsection @push('style') @endpush @push('script') @endpush
Please check back later or browse another category.