@extends('layouts.candidate') @section('title', '考題商品') @section('content')

輸入序號兌換

@csrf

序號可能是「整包」或「單一科目」,兌換後會自動顯示在下方「我的購買」

我的購買

@forelse($purchases as $purchase) @php $product = $purchase->examProduct; @endphp
{{ $product->title }} {{ $purchase->subject?->name ?? '整包' }}
@foreach($product->files as $file) @if($purchase->subject === null || $file->exam_product_subject_id === $purchase->subject->id) {{ $file->subject ? $file->subject->name . ':' : '' }}{{ $file->original_name }} @endif @endforeach
@empty
尚未購買任何考題商品
@endforelse

商品列表

@forelse($products as $product) @php $wholeProductOwned = $candidate->hasAccessTo($product); @endphp
{{ $product->title }}
@if($product->description)

{{ $product->description }}

@endif
整包
@if($product->isDiscountActive()) {{ number_format($product->price, 0) }} {{ number_format($product->discount_price, 0) }} @else {{ number_format($product->price, 0) }} @endif @if($wholeProductOwned) 已購買 @elseif(!$product->isPurchasable()) 暫不供應 @endif
@if($product->subjects->isNotEmpty())
@foreach($product->subjects as $subject) @php $subjectOwned = $wholeProductOwned || $candidate->hasAccessTo($product, $subject); @endphp
{{ $subject->name }}
@if($subject->isDiscountActive()) {{ number_format($subject->price, 0) }} {{ number_format($subject->discount_price, 0) }} @else {{ number_format($subject->price, 0) }} @endif @if($subjectOwned) 已購買 @elseif(!$subject->isPurchasable()) 暫不供應 @endif
@endforeach
@endif

目前僅支援序號兌換或客服開通,可整包購買,也可只買其中一科

@empty
目前沒有上架中的商品
@endforelse
@endsection