@php
// ১. প্রাইস ক্যালকুলেশন লজিক
$finalDomainPrice = 0;
// যদি নতুন ডোমেইন হয়, তবেই প্রাইস সেট হবে
if (!$isOwnDomain && isset($extInfo)) {
$finalDomainPrice = $extInfo->registration_price;
}
$freeLabel = false;
// ২. ফ্রি ডোমেইন চেক লজিক (শুধুমাত্র নতুন ডোমেইনের জন্য)
if(!$isOwnDomain && $hostingPlan && $hostingPlan->free_domain == 1 && isset($extInfo)) {
$rawExtIds = $hostingPlan->free_domain_extensions;
$allowedIds = [];
if (is_array($rawExtIds)) {
$allowedIds = $rawExtIds;
} else {
$decoded = json_decode($rawExtIds, true);
$allowedIds = is_array($decoded) ? $decoded : explode(',', $rawExtIds);
}
// এক্সটেনশন আইডি ম্যাচ করলে ফ্রি
if (in_array((string)$extInfo->id, array_map('strval', array_map('trim', $allowedIds)))) {
$finalDomainPrice = 0;
$freeLabel = true;
}
}
// ৩. মোট হিসাব
$grandTotal = $finalDomainPrice;
if($hostingPlan) {
$grandTotal += $hostingPlan->price_yearly;
}
@endphp
{{-- ডোমেইন ইনফো ডিসপ্লে --}}
{{-- [FIXED] ব্যাজ টাইটেল --}}
{{ $isOwnDomain ? 'হোস্টিং ডোমেইন' : 'নির্বাচিত ডোমেইন' }}
{{ $domain }}
{{-- [FIXED] ডেসক্রিপশন টেক্সট --}}
@if($isOwnDomain)
বিদ্যমান (Existing)
@else
রেজিস্ট্রেশন (১ বছর)
@endif
@if($isOwnDomain)
৳ ০.০০
@elseif($freeLabel)
৳ ০.০০ (ফ্রি)
@else
৳ {{ number_format($extInfo->registration_price ?? 0, 2) }}
@endif
{{-- হোস্টিং ইনফো ডিসপ্লে --}}
@if($hostingPlan)
নির্বাচিত হোস্টিং
{{ $hostingPlan->name }}
ক্যাটাগরি: {{ $hostingPlan->category }}
হোস্টিং ফি (১ বছর)
৳ {{ number_format($hostingPlan->price_yearly, 2) }}
@endif
{{-- সর্বমোট হিসাব --}}
সর্বমোট:
৳ {{ number_format($grandTotal, 2) }}
{{-- এলার্ট মেসেজ --}}
@if($freeLabel && !$isOwnDomain)
অভিনন্দন! এই প্যাকেজের সাথে আপনার ডোমেইনটি একদম ফ্রি।
@endif
পেমেন্ট সফল হলে আপনার সার্ভিসগুলো অটোমেটিক/ম্যানুয়াল প্রসেস করা হবে।