@php $cardStyle = ui('product_card_style', 'modern'); $imgRatio = ui('product_img_ratio', '1/1'); $actionStyle = ui('product_action_style', 'hover'); $ratingStyle = ui('product_rating_style', 'stars'); // Default badge to null if not provided $badge = $badge ?? null; $ratioMap = ['1/1' => '100%', '3/4' => '133%', '4/3' => '75%']; $ratioPadding = $ratioMap[$imgRatio] ?? '100%'; $cardClasses = match($cardStyle) { 'minimal' => 'border-0 bg-transparent', 'bordered' => 'border shadow-none', 'shadow' => 'border-0 shadow-lg', default => 'border-0 shadow-sm rounded-4' }; @endphp
{{-- Badges --}}
@if($badge) {{ $badge }} @elseif($product->sale_price && $product->price > $product->sale_price) @php $discount = round((($product->price - $product->sale_price) / $product->price) * 100); @endphp -{{ $discount }}% @endif
{{-- Wishlist Button (Top Right) --}}
@csrf
{{-- Product Image --}} {{ $product->name }} {{-- Card Body --}}
{{-- Category --}} @if($product->category) {{ $product->category->name }} @endif {{-- Name --}}
{{ $product->name }}
{{-- Rating --}}
4.2
(15)
{{-- Price --}}
@if($product->sale_price) ₹{{ number_format($product->sale_price, 0) }} ₹{{ number_format($product->price, 0) }} @else ₹{{ number_format($product->price, 0) }} @endif
{{-- Hover Action Footer --}}