@php use App\Enumerables\Currency; use App\Order; use App\ProductModel; $currency = Currency::GBP; $currencySign = '£ '; /** * @var Order $order * @var ProductModel $productModel */ if (isset($_COOKIE['currency']) && (int) $_COOKIE['currency'] != Currency::GBP) { $currency = Currency::CNY; $currencySign = '¥ '; } $currentMonth = date('m'); $currentYear = date('Y'); $maxYear = $currentYear + 2; $language = config('app.locale'); $checked = ($checked ?? false) ? 'checked' : ''; $discountPercentage = $discount['percentage'] ?? 0; $isCheckout = $isCheckout ?? false; @endphp @foreach($items as $item) @php /** * @var \App\ProductModel|\App\Course|\App\VirtualCourse|\Modules\Translation\Entities\TranslationService $productModel * @var array $item */ $productModel = \App\Cart::getProductModel($item['product_type'], $item['product_id']); $itemImage = $productModel->productImage($language); $title = $productModel->title($language); if ($item['product_type'] == \App\Enumerables\OrderItemTypes::TRANSLATION) { $subtitle = $productModel->subtitle( $language, null, new \Modules\Translation\Entities\TranslationDetails([ 'language' => $item['translation_language'], 'urgency' => $item['translation_urgency'], 'count' => $item['translation_count'], ]) ); } else { $subtitle = $productModel->subtitle($language); } $totalItemDiscount = ($item['discountEvent'] ?? 0) + ($item['discountValue'] ?? 0); @endphp
@if(!$isCheckout)
@endif
@php $hasLink = $itemImage->hasLink(); @endphp
@php $hasLink = $title->hasLink(); @endphp {{$title}} @php $hasLink = $subtitle->hasLink(); @endphp {{$subtitle}} @foreach($productModel->eventTexts($currency) as $activity)
{{($language == 'en') ? $activity->activityName : $activity->activityNameChinese}}
@if($activity->countdown)
{{__('countdown')}} {{$activity->countdown}}
@endif
@endforeach
@if($productModel->isDeposit()) @if($item['product_type'] != \App\Enumerables\OrderItemTypes::VIRTUAL_COURSE) {{__('deposit-refund-note')}} @endif @elseif($item['product_type'] != \App\Enumerables\OrderItemTypes::TRANSLATION) @endif {{$currencySign.number_format($item['totalFees'], 2, ".", ",")}} @if($totalItemDiscount > 0) {{$currencySign.number_format($item['totalFees'] - $totalItemDiscount, 2, ".", ",")}} @endif @if($discountPercentage) @include('order.components.max_discount', [ 'item' => $productModel, 'lang' => $language, 'discountPercentage' => $discountPercentage ]) @endif
@if($productModel->canChangeQuantity() && !$isCheckout) @include('order.support.item_quantity', [ 'item' => $item ]) @else {{$item['item_count']}} @endif
{{ $currencySign.number_format( ($item['totalFees'] - ($item['discountValue'] ?? 0) - ($item['discountEvent'] ?? 0)) * ($item['item_count'] ?? 1), 2 ) }}
@if($isCheckout) @if($item['product_type'] == \App\Enumerables\OrderItemTypes::TRANSLATION) {{__('N/A')}} @else {{$item['startDate']}} @endif @else @include('order.components.cart_item_start_date_select') @endif
@endforeach