@php $data = getProductInfo($product); use App\Models\Information; use App\Models\BanglaText; $info = Information::first(); $bangla_text = BanglaText::first(); $curr = $info->currency; @endphp
@php $product_webp = str_replace(['.jpg', '.jpeg', '.png'], '.webp', $product->image); $webpPath = public_path('products/' . $product_webp); $webpExists = file_exists($webpPath); @endphp @if($webpExists) @endif {{ $product->name }} - ID: {{ $product->id }} @if ( $product->after_discount > 0 || $product->stock_quantity == 0 || $product->stock_quantity == null || $product->is_free_shipping == 1)
@if ($product->after_discount > 0) @php $price = $product->sell_price; $afterDiscount = $product->after_discount; // absolute discount amount $discountAmount = $price - $afterDiscount; // discount percentage $discountPercent = $price > 0 ? round(($discountAmount / $price) * 100, 0) : 0; @endphp
{{ $discountPercent }}% Off
@endif @if ($product->stock_quantity == 0 || $product->stock_quantity == null)
STOCK OUT
@else @if ($product->is_free_shipping == 1)
ফ্রি ডেলিভারি
@endif @endif
@endif

{{ $product->name }}

@php $curr = $info->currency; @endphp @if ($curr == 'BDT') ৳ {{ (int) $data['price'] }} @elseif ($curr == 'Dollar') $ {{ $data['price'] }} @elseif ($curr == 'Euro') {{ $data['price'] }} @elseif ($curr == 'Rupee') {{ $data['price'] }} @else @endif @if ($product->after_discount > 0) @php $curr = $info->currency; @endphp @if ($curr == 'BDT') {{ (int) $data['old_price'] }} @elseif ($curr == 'Dollar') $ {{ $data['old_price'] }} @elseif ($curr == 'Euro') {{ $data['old_price'] }} @elseif ($curr == 'Rupee') {{ $data['old_price'] }} @else @endif @endif
@if ($product->type == 'single')
@csrf @if ($product->after_discount != '0') @else @endif
@else
@endif