Files
portal-api/resources/views/frontend/cart/partials/product-details.blade.php
T
2025-07-29 08:53:41 +07:00

70 lines
3.3 KiB
PHP

<div class="bg-white rounded-lg border border-gray-200 p-6" x-data="{ loading: true }" data-skeleton-id="product-details">
<input type="hidden" name="product_id" value="{{ $product->id }}" />
<input type="hidden" name="product_type" value="{{ $item['product_type'] }}" />
<!-- Skeleton Loading -->
<template x-if="loading">
<div class="animate-pulse">
<div class="flex items-center justify-between mb-4">
<div class="h-6 bg-gray-200 rounded w-1/3"></div>
<div class="h-6 bg-gray-200 rounded w-1/4"></div>
</div>
<div class="space-y-3">
<div class="h-4 bg-gray-200 rounded w-full"></div>
<div class="h-4 bg-gray-200 rounded w-5/6"></div>
<div class="h-4 bg-gray-200 rounded w-4/6"></div>
<div class="h-4 bg-gray-200 rounded w-3/4"></div>
</div>
</div>
</template>
<!-- Actual Content -->
<template x-if="!loading">
<div>
<div class="flex items-center justify-between mb-4">
<h2 class="text-xl font-semibold text-gray-800 border-b-2 border-blue-500 pb-2">
{{ $product->name }}
@if ($item['product_type'] == 4)
<span class="text-sm text-gray-500">(VPS)</span>
@elseif ($item['product_type'] == 3)
<span class="text-sm text-gray-500">(Hosting)</span>
@endif
</h2>
<div class="text-right">
@if ($product->price_sale && $product->price_sale < $product->price)
<div class="text-lg font-bold text-red-600">
{{ format_price($product->price_sale) }}/{{ __('tháng') }}
</div>
<div class="text-sm text-gray-400 line-through">
{{ format_price($product->price) }}/{{ __('tháng') }}
</div>
@else
<div class="text-lg font-bold text-gray-800">
{{ format_price($product->price) }}/{{ __('tháng') }}
</div>
@endif
</div>
</div>
<!-- Product Features -->
<div class="space-y-2 text-sm text-gray-700">
@if ($item['product_type'] == 3)
<!-- Hosting Features -->
<div>• {{ number_format($product->disk ?? 2000) }} MB {{ __('dung lượng SSD') }}.</div>
<div>• 1 {{ __('Addon domain') }}.</div>
<div>• 10 {{ __('Sub-domains') }}.</div>
<div>• {{ __('Không giới hạn Alias Domain') }}.</div>
<div>• {{ __('Không giới hạn Database') }}.</div>
<div>• {{ __('Không giới hạn tài khoản FTP') }}.</div>
<div>• {{ __('Control Panel') }}: Cpanel.</div>
@else
<!-- VPS Features -->
@include('frontend.cart.partials.vps-features', [
'product' => $product,
'parentLoading' => 'loading'
])
@endif
</div>
</div>
</template>
</div>